From 707c83df362ba187d379f11c6e526b817e801079 Mon Sep 17 00:00:00 2001 From: lizhuojun Date: Mon, 22 Jul 2024 12:04:12 +0800 Subject: [PATCH 001/620] add new UDS(OpenHarmonyFrom, FileUri) Signed-off-by: lizhuojun --- .../udmf/include/udmf_err_code.h | 10 +- distributeddatamgr/udmf/include/uds.h | 141 ++++++++++++++++++ 2 files changed, 142 insertions(+), 9 deletions(-) diff --git a/distributeddatamgr/udmf/include/udmf_err_code.h b/distributeddatamgr/udmf/include/udmf_err_code.h index 4a479bdc6..105191c7c 100644 --- a/distributeddatamgr/udmf/include/udmf_err_code.h +++ b/distributeddatamgr/udmf/include/udmf_err_code.h @@ -56,22 +56,14 @@ 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 + 2), + UDMF_E_INVALID_PARAM = (UDMF_ERR + 1), } Udmf_ErrCode; #ifdef __cplusplus diff --git a/distributeddatamgr/udmf/include/uds.h b/distributeddatamgr/udmf/include/uds.h index 54c122b22..4b645561c 100644 --- a/distributeddatamgr/udmf/include/uds.h +++ b/distributeddatamgr/udmf/include/uds.h @@ -72,6 +72,20 @@ 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 + */ +typedef struct OH_UdsFileUri OH_UdsFileUri; + /** * @brief Creation a pointer to the instance of the {@link OH_UdsPlainText}. * @@ -464,6 +478,133 @@ 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. + * @see OH_UdsFileUri + * @since 12 + */ +OH_UdsFileUri* OH_UdsFileUri_Create(); + +/** + * @brief Destroy a pointer that points to the {@link OH_UdsFileUri} instance. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsFileUri}. + * @see OH_UdsFileUri + * @since 12 + */ +void OH_UdsFileUri_Destroy(OH_UdsFileUri* pThis); + +/** + * @brief Get type id from the {@link OH_UdsFileUri}. + * + * @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 + */ +const char* OH_UdsFileUri_GetType(OH_UdsFileUri* pThis); + +/** + * @brief Get file uri from the {@link OH_UdsFileUri}. + * + * @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 + */ +const char* OH_UdsFileUri_GetFileUri(OH_UdsFileUri* pThis); + +/** + * @brief Get file type from the {@link OH_UdsFileUri}. + * + * @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 + */ +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. + * @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 + */ +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. + * @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 + */ +int OH_UdsFileUri_SetFileType(OH_UdsFileUri* pThis, const char* fileType); + #ifdef __cplusplus }; #endif -- Gitee From d2fbd537e2e401c2a14936b5cf5716c484d279d8 Mon Sep 17 00:00:00 2001 From: lizhuojun Date: Tue, 23 Jul 2024 21:41:27 +0800 Subject: [PATCH 002/620] add pixelMap and errorcode Signed-off-by: lizhuojun --- distributeddatamgr/udmf/include/udmf.h | 7 +++ distributeddatamgr/udmf/include/uds.h | 61 ++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/distributeddatamgr/udmf/include/udmf.h b/distributeddatamgr/udmf/include/udmf.h index 6b06f5fb7..13a59f825 100644 --- a/distributeddatamgr/udmf/include/udmf.h +++ b/distributeddatamgr/udmf/include/udmf.h @@ -287,6 +287,7 @@ 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 */ @@ -301,6 +302,7 @@ 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 */ @@ -314,6 +316,7 @@ 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 */ @@ -327,6 +330,7 @@ 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 */ @@ -340,6 +344,7 @@ 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 */ @@ -484,6 +489,7 @@ 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 */ @@ -500,6 +506,7 @@ 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 */ diff --git a/distributeddatamgr/udmf/include/uds.h b/distributeddatamgr/udmf/include/uds.h index 4b645561c..8ed0845d9 100644 --- a/distributeddatamgr/udmf/include/uds.h +++ b/distributeddatamgr/udmf/include/uds.h @@ -40,6 +40,8 @@ #ifndef UDS_H #define UDS_H +#include "pixelmap_native.h" + #ifdef __cplusplus extern "C" { #endif @@ -86,6 +88,13 @@ typedef struct OH_UdsForm OH_UdsForm; */ typedef struct OH_UdsFileUri OH_UdsFileUri; +/** + * @brief Describes the unified data struct of open harmony pixel map. + * + * @since 12 + */ +typedef struct OH_UdsPixelMap OH_UdsPixelMap; + /** * @brief Creation a pointer to the instance of the {@link OH_UdsPlainText}. * @@ -605,6 +614,58 @@ int OH_UdsFileUri_SetFileUri(OH_UdsFileUri* pThis, const char* fileUri); */ 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. + * @see OH_UdsPixelMap + * @since 12 + */ +OH_UdsPixelMap* OH_UdsPixelMap_Create(); + +/** + * @brief Destroy a pointer that points to the {@link OH_UdsPixelMap} instance. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsPixelMap}. + * @see OH_UdsPixelMap + * @since 12 + */ +void OH_UdsPixelMap_Destroy(OH_UdsPixelMap* pThis); + +/** + * @brief Get type id 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. + * @see OH_UdsPixelMap + * @since 12 + */ +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. + * @see OH_UdsPixelMap + * @since 12 + */ +const OH_PixelmapNative* OH_UdsPixelMap_GetPixelMap(OH_UdsPixelMap* pThis); + +/** + * @brief Set form content to the {@link OH_UdsPixelMap}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsPixelMap}. + * @param pixelMap Represents a new pixel map. + * @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 + */ +int OH_UdsPixelMap_SetPixelMap(OH_UdsPixelMap* pThis, const OH_PixelmapNative* pixelMap); + #ifdef __cplusplus }; #endif -- Gitee From f8c3102daaa2f1ea9706affe813967575c5cc660 Mon Sep 17 00:00:00 2001 From: xwx1135370 Date: Thu, 25 Jul 2024 09:20:57 +0800 Subject: [PATCH 003/620] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dpart=5Fconfig?= =?UTF-8?q?=E4=B8=AD=E9=85=8D=E7=BD=AE=E7=9A=84musl=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit issue:https://gitee.com/openharmony/third_party_musl/issues/IAF1XE?from=project-issue Test:Source code compilation Signed-off-by: xwx1135370 --- third_party/musl/ndk_script/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/musl/ndk_script/BUILD.gn b/third_party/musl/ndk_script/BUILD.gn index 683b2e30d..a71e33565 100644 --- a/third_party/musl/ndk_script/BUILD.gn +++ b/third_party/musl/ndk_script/BUILD.gn @@ -208,7 +208,7 @@ group("musl_sysroot") { action("copy_ndk_uapi") { outputs = [ "${musl_target_out_dir}/${ndk_musl_include}/linux" ] script = "${musl_dir}/scripts/copy_uapi.sh" - args = [ "-i" ] + [ rebase_path("${uapi_dir}") ] + args = [ "-i" ] + [ rebase_path("${musl_uapi_dir}") ] args += [ "-o" ] + [ rebase_path("${musl_target_out_dir}/${ndk_musl_include}") ] args += [ "-t" ] + [ "${musl_arch}" ] -- Gitee From 088bd6f570e8c4342aa880b28f8f47eb50b30a1d Mon Sep 17 00:00:00 2001 From: houpengtao Date: Tue, 23 Jul 2024 12:08:29 +0800 Subject: [PATCH 004/620] add paste board ndk Signed-off-by: houpengtao --- distributeddatamgr/pasteboard/BUILD.gn | 36 +++ .../pasteboard/include/oh_pasteboard.h | 305 ++++++++++++++++++ .../include/oh_pasteboard_err_code.h | 77 +++++ .../pasteboard/libpasteboard.ndk.json | 62 ++++ 4 files changed, 480 insertions(+) create mode 100644 distributeddatamgr/pasteboard/BUILD.gn create mode 100644 distributeddatamgr/pasteboard/include/oh_pasteboard.h create mode 100644 distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h create mode 100644 distributeddatamgr/pasteboard/libpasteboard.ndk.json diff --git a/distributeddatamgr/pasteboard/BUILD.gn b/distributeddatamgr/pasteboard/BUILD.gn new file mode 100644 index 000000000..8887b53ac --- /dev/null +++ b/distributeddatamgr/pasteboard/BUILD.gn @@ -0,0 +1,36 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") +import("//foundation/distributeddatamgr/pasteboard/pasteboard.gni") + +ohos_ndk_headers("pasteboard_ndk_header") { + dest_dir = "$ndk_headers_out_dir/database/pasteboard/" + sources = [ + "./include/oh_pasteboard.h", + "./include/oh_pasteboard_err_code.h", + ] +} + +ohos_ndk_library("libpasteboard_ndk") { + output_name = "pasteboard" + output_extension = "so" + system_capability = "SystemCapability.MiscServices.Pasteboard" + ndk_description_file = "./libpasteboard.ndk.json" + min_compact_version = "12" + system_capability_headers = [ + "$ndk_headers_out_dir/database/pasteboard/oh_pasteboard.h", + "$ndk_headers_out_dir/database/pasteboard/oh_pasteboard_err_code.h", + ] +} diff --git a/distributeddatamgr/pasteboard/include/oh_pasteboard.h b/distributeddatamgr/pasteboard/include/oh_pasteboard.h new file mode 100644 index 000000000..7b7affb65 --- /dev/null +++ b/distributeddatamgr/pasteboard/include/oh_pasteboard.h @@ -0,0 +1,305 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup Pasteboard + * @{ + * + * @brief Provides the copy and paste support for the system Pasteboard. + * You can use the APIs of this module to operate the Pasteboard content of the plain text, HTML, + * URI, Want, pixel map, and other types. + * + * @since 12 + */ + +/** + * @file OH_Pasteboard.h + * + * @brief Provides APIs and enums of the Pasteboard module. + * + * @kit BasicServicesKit + * @library libpasteboard_ndk.so + * @syscap SystemCapability.MiscServices.Pasteboard + * + * @since 12 + */ + +#ifndef OH_PASTEBOARD_H +#define OH_PASTEBOARD_H + +#include +#include +#include "udmf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the types of data changes that can be observed. + * + * @since 12 + */ +typedef enum Pasteboard_SubscribeType { + /** + * @brief Change of the Pasteboard data in the local device. + */ + PASTEBOARD_SUBSCRIBE_TYPE_LOCAL = 1, + /** + * @brief Change of the Pasteboard data in the remote devices. + */ + PASTEBOARD_SUBSCRIBE_TYPE_REMOTE = 2 +} Pasteboard_SubscribeType; + +/** + * @brief Defines the callback function used to return the Pasteboard data changed. + * + * @param context The context set by {@link OH_PasteboardSubscriber_SetContext} function. + * @param type The types of data changes. For details, see {@link Pasteboard_SubscribeType}. + * @since 12 + */ +typedef void (*Pasteboard_SubscribeCallback)(void* context, Pasteboard_SubscribeType type); + +/** + * @brief Defines the Pasteboard subscriber information + * + * @since 12 + */ +typedef struct OH_PasteboardSubscriber OH_PasteboardSubscriber; + +/** + * @brief Creates a {@link OH_PasteboardSubscriber} instance. + * + * @return Returns the pointer to the {@link OH_PasteboardSubscriber} instance created if the operation is successful. + * Returns nullptr if the operation is failed. + * @see OH_PasteboardSubscriber. + * @since 12 + */ +OH_PasteboardSubscriber* OH_PasteboardSubscriber_Create(); + +/** + * @brief Destroy a {@link OH_PasteboardSubscriber} instance. + * + * @param subscriber Pointer to the {@link OH_PasteboardSubscriber} instance to destroy. + * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_PasteboardSubscriber PASTEBOARD_ErrCode. + * @since 12 + */ +int OH_PasteboardSubscriber_Destroy(OH_PasteboardSubscriber* subscriber); + +/** + * @brief Sets a callback function to return the Pasteboard data changed. + * + * @param subscriber Pointer to the {@link OH_PasteboardSubscriber} instance. + * @param callback Callback to set. For details, see {@link Pasteboard_SubscribeCallback}. + * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_PasteboardSubscriber Pasteboard_SubscribeCallback PASTEBOARD_ErrCode. + * @since 12 + */ +int OH_PasteboardSubscriber_SetCallback(OH_PasteboardSubscriber* subscriber, const Pasteboard_SubscribeCallback callback); + +/** + * @brief Obtains the callback used to return the Pasteboard data changed. + * + * @param subscriber Pointer to the {@link OH_PasteboardSubscriber} instance. + * @param callback Pointer to the {@link Pasteboard_SubscribeCallback} instance to obtain. + * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_PasteboardSubscriber Pasteboard_SubscribeCallback PASTEBOARD_ErrCode. + * @since 12 + */ +int OH_PasteboardSubscriber_GetCallback(OH_PasteboardSubscriber* subscriber, Pasteboard_SubscribeCallback* callback); + +/** + * @brief Sets a context instance, which is the first parameter in Pasteboard_SubscribeCallback. + * + * @param subscriber Pointer to the {@link OH_PasteboardSubscriber} instance. + * @param context Pointer to the context set. + * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_PasteboardSubscriber PASTEBOARD_ErrCode. + * @since 12 + */ +int OH_PasteboardSubscriber_SetContext(OH_PasteboardSubscriber* subscriber, void* context); + +/** + * @brief Obtains the context, which is the first parameter in Pasteboard_SubscribeCallback. + * + * @param subscriber Pointer to the {@link OH_PasteboardSubscriber} instance. + * @param context Pointer to the context to obtain. + * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_PasteboardSubscriber PASTEBOARD_ErrCode. + * @since 12 + */ +int OH_PasteboardSubscriber_GetContext(OH_PasteboardSubscriber* subscriber, void** context); + +/** + * @brief Represents the Pasteboard information. + * + * @since 12 + */ +typedef struct OH_Pasteboard OH_Pasteboard; + +/** + * @brief Creates a {@link OH_Pasteboard} instance. + * + * @return Returns the pointer to the {@link OH_Pasteboard} instance created if the operation is successful. + * Returns nullptr if the operation is failed. + * @see OH_Pasteboard. + * @since 12 + */ +OH_Pasteboard* OH_Pasteboard_Create(); + +/** + * @brief Destroy a {@link OH_Pasteboard} instance. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance to destroy. + * @see OH_Pasteboard. + * @since 12 + */ +void OH_Pasteboard_Destroy(OH_Pasteboard* pasteboard); + +/** + * @brief Subscribes to the Pasteboard data change. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param type Event type to subscribe to. + * @param subscriber - Pointer to the subscriber information, which specifies the callback used to + * reporting the pasteboard data change. For details, see {@link OH_PasteboardSubscriber}. + * @return Returns the status code of the execution. For details, {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_Pasteboard OH_PasteboardSubscriber PASTEBOARD_ErrCode. + * @since 12 + */ +int OH_Pasteboard_Subscribe(OH_Pasteboard* pasteboard, int type, const OH_PasteboardSubscriber* subscriber); + +/** + * @brief Unsubscribes from the Pasteboard data change. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param type Event type to subscribe to. + * @param subscriber - Pointer to the subscriber information, which specifies the callback used to + * reporting the pasteboard data change. For details, see {@link OH_PasteboardSubscriber}. + * @return Returns the status code of the execution. For details, {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_Pasteboard OH_PasteboardSubscriber PASTEBOARD_ErrCode. + * @since 12 + */ +int OH_Pasteboard_Unsubscribe(OH_Pasteboard* pasteboard, int type, const OH_PasteboardSubscriber* subscriber); + +/** + * @brief Checks whether the Pasteboard data is from a remote device. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @return Returns a boolean value, which indicates whether the the data is from a remote device. + * The value {@code false} means Pasteboard data is not from a remote device. + * The value {@code true} means the opposite. + * @see OH_Pasteboard. + * @since 12 + */ +bool OH_Pasteboard_IsRemoteData(OH_Pasteboard* pasteboard); + +/** + * @brief Obtains the source of Pasteboard data. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param source Pointer to the source data. + * @param len Length of the source data. + * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_Pasteboard PASTEBOARD_ErrCode. + * @since 12 + */ +int OH_Pasteboard_GetDataSource(OH_Pasteboard* pasteboard, char* source, unsigned int len); + +/** + * @brief Checks whether the Pasteboard has the specified type of data. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param type Poniter to the type of data to check. + * @return Returns a boolean value, which indicates whether the Pasteboard has the specified type of data. + * The value {@code true} means the Pasteboard has the specified type of data. + * The value {@code false} means the opposite. + * @see OH_Pasteboard. + * @since 12 + */ +bool OH_Pasteboard_HasType(OH_Pasteboard* pasteboard, const char* type); + +/** + * @brief Checks whether there is data in the Pasteboard. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @return Returns a boolean value, which indicates whether there is data in the Pasteboard. + * The value {@code true} means there is data in Pasteboard. + * The value {@code false} means the opposite. + * @see OH_Pasteboard. + * @since 12 + */ +bool OH_Pasteboard_HasData(OH_Pasteboard* pasteboard); + +/** + * @brief Obtains data from the Pasteboard. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param data Pointer to the {@link OH_UdmfData} instance. + * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_Pasteboard OH_UdmfData PASTEBOARD_ErrCode. + * @since 12 + */ +int OH_Pasteboard_GetData(OH_Pasteboard* pasteboard, OH_UdmfData* data); + +/** + * @brief Writes data to the Pasteboard. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param data Pointer to the {@link OH_UdmfData} instance. + * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_Pasteboard OH_UdmfData PASTEBOARD_ErrCode. + * @since 12 + */ +int OH_Pasteboard_SetData(OH_Pasteboard* pasteboard, OH_UdmfData* data); + +/** + * @brief Clears the data in the Pastedboard. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_Pasteboard PASTEBOARD_ErrCode. + * @since 12 + */ +int OH_Pasteboard_ClearData(OH_Pasteboard* pasteboard); +#ifdef __cplusplus +}; +#endif + +/** @} */ +#endif \ No newline at end of file diff --git a/distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h b/distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h new file mode 100644 index 000000000..0251eb05d --- /dev/null +++ b/distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup Pasteboard + * @{ + * + * @brief Provides the copy and paste support for the system Pasteboard. + * You can use the APIs of this module to operate the Pasteboard content of the plain text, HTML, + * URI, Want, pixel map, and other types. + * + * @since 12 + */ + +/** + * @file oh_pasteboard_err_code.h + * + * @brief Declaration error code information. + * + * @kit BasicServicesKit + * @library libpasteboard_ndk.so + * @syscap SystemCapability.MiscServices.Pasteboard + * + * @since 12 + */ + + +#ifndef OH_PASTEBOARD_ERR_CODE_H +#define OH_PASTEBOARD_ERR_CODE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the error codes. + * + * @since 12 + */ +typedef enum PASTEBOARD_ErrCode { + /** + * The operation is successful. + */ + ERR_OK = 0, + /** + * Permission verification failed. + */ + ERR_PERMISSION_ERROR = 201, + /** + * Invalid parameter is detected. + */ + ERR_INVALID_PARAMETER = 401, + /** + * The capability is not supported. + */ + ERR_DEVICE_NOT_SUPPORTED = 801, + +} PASTEBOARD_ErrCode; + +#ifdef __cplusplus +}; +#endif + +/** @} */ +#endif diff --git a/distributeddatamgr/pasteboard/libpasteboard.ndk.json b/distributeddatamgr/pasteboard/libpasteboard.ndk.json new file mode 100644 index 000000000..60631cdb2 --- /dev/null +++ b/distributeddatamgr/pasteboard/libpasteboard.ndk.json @@ -0,0 +1,62 @@ +[ + { + "first_introduced": "12", + "name": "OH_PasteBoardSubcriber_Create" + }, + { + "first_introduced": "12", + "name": "OH_PasteBoardSubcriber_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_PasteBoardSubcriber_SetCallback" + }, + { + "first_introduced": "12", + "name": "OH_PasteBoardSubcriber_GetCallback" + }, + { + "first_introduced": "12", + "name": "OH_PasteBoard_Create" + }, + { + "first_introduced": "12", + "name": "OH_PasteBoard_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_PasteBoard_Subcribe" + }, + { + "first_introduced": "12", + "name": "OH_PasteBoard_Unsubcribe" + }, + { + "first_introduced": "12", + "name": "OH_PasteBoard_IsRemoteData" + }, + { + "first_introduced": "12", + "name": "OH_PasteBoard_GetDataSrouce" + }, + { + "first_introduced": "12", + "name": "OH_PasteBoard_HasType" + }, + { + "first_introduced": "12", + "name": "OH_PasteBoard_HasData" + }, + { + "first_introduced": "12", + "name": "OH_PasteBoard_GetData" + }, + { + "first_introduced": "12", + "name": "OH_PasteBoard_SetData" + }, + { + "first_introduced": "12", + "name": "OH_PasteBoard_ClearData" + } +] \ No newline at end of file -- Gitee From 45639e2e5e50313b2e6fcd4419cd7831491e761e Mon Sep 17 00:00:00 2001 From: cold Date: Tue, 30 Jul 2024 10:11:18 +0800 Subject: [PATCH 005/620] add ndk interface for camera Signed-off-by: cold --- multimedia/camera_framework/camera.h | 2 +- multimedia/camera_framework/camera.ndk.json | 128 +++++++++++++ multimedia/camera_framework/camera_manager.h | 72 ++++++++ multimedia/camera_framework/capture_session.h | 148 +++++++++++++-- multimedia/camera_framework/photo_output.h | 171 +++++++++++++++++- multimedia/camera_framework/preview_output.h | 59 +++++- multimedia/camera_framework/video_output.h | 59 +++++- 7 files changed, 617 insertions(+), 22 deletions(-) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index c8464da9d..a10adb2ca 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -924,7 +924,7 @@ typedef struct Camera_TorchStatusInfo { /** * the current torch brightness level. */ - int32_t torchLevel; + float torchLevel; } Camera_TorchStatusInfo; /** diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index 52bbf5fc0..cfd6120d9 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -31,6 +31,14 @@ "first_introduced": "11", "name": "OH_CameraManager_UnregisterCallback" }, + { + "first_introduced": "12", + "name": "OH_CameraManager_RegisterTorchStatusCallback" + }, + { + "first_introduced": "12", + "name": "OH_CameraManager_UnregisterTorchStatusCallback" + }, { "first_introduced": "11", "name": "OH_CameraManager_GetSupportedCameras" @@ -103,6 +111,18 @@ "first_introduced": "12", "name": "OH_CameraManager_DeleteSceneModes" }, + { + "first_introduced": "12", + "name": "OH_CameraManager_IsTorchSupported" + }, + { + "first_introduced": "12", + "name": "OH_CameraManager_IsTorchSupportedByTorchMode" + }, + { + "first_introduced": "12", + "name": "OH_CameraManager_SetTorchMode" + }, { "first_introduced": "11", "name": "OH_Camera_GetCameraManager" @@ -119,6 +139,14 @@ "first_introduced": "11", "name": "OH_CaptureSession_UnregisterCallback" }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_RegisterSmoothZoomInfoCallback" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_UnregisterSmoothZoomInfoCallback" + }, { "first_introduced": "12", "name": "OH_CaptureSession_SetSessionMode" @@ -311,6 +339,34 @@ "first_introduced": "12", "name": "OH_CaptureSession_PreconfigWithRatio" }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_GetExposureValue" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_GetFocalLength" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_SetSmoothZoom" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_GetSupportedColorSpaces" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_DeleteColorSpaces" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_GetActiveColorSpace" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_SetActiveColorSpace" + }, { "first_introduced": "11", "name": "OH_MetadataOutput_RegisterCallback" @@ -339,6 +395,46 @@ "first_introduced": "11", "name": "OH_PhotoOutput_UnregisterCallback" }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_RegisterCaptureStartWithInfoCallback" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_UnregisterCaptureStartWithInfoCallback" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_RegisterCaptureEndCallback" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_UnregisterCaptureEndCallback" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_RegisterFrameShutterEndCallback" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_UnregisterFrameShutterEndCallback" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_RegisterCaptureReadyCallback" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_UnregisterCaptureReadyCallback" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_RegisterEstimatedCaptureDurationCallback" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_UnregisterEstimatedCaptureDurationCallback" + }, { "first_introduced": "11", "name": "OH_PhotoOutput_Capture" @@ -391,6 +487,22 @@ "first_introduced": "12", "name": "OH_PreviewOutput_DeleteProfile" }, + { + "first_introduced": "12", + "name": "OH_PreviewOutput_GetSupportedFrameRates" + }, + { + "first_introduced": "12", + "name": "OH_PreviewOutput_DeleteFrameRates" + }, + { + "first_introduced": "12", + "name": "OH_PreviewOutput_SetFrameRate" + }, + { + "first_introduced": "12", + "name": "OH_PreviewOutput_GetActiveFrameRate" + }, { "first_introduced": "11", "name": "OH_VideoOutput_RegisterCallback" @@ -419,6 +531,22 @@ "first_introduced": "12", "name": "OH_VideoOutput_DeleteProfile" }, + { + "first_introduced": "12", + "name": "OH_VideoOutput_GetSupportedFrameRates" + }, + { + "first_introduced": "12", + "name": "OH_VideoOutput_DeleteFrameRates" + }, + { + "first_introduced": "12", + "name": "OH_VideoOutput_SetFrameRate" + }, + { + "first_introduced": "12", + "name": "OH_VideoOutput_GetActiveFrameRate" + }, { "first_introduced": "12", "name": "OH_CameraDevice_GetCameraOrientation" diff --git a/multimedia/camera_framework/camera_manager.h b/multimedia/camera_framework/camera_manager.h index 90e55cec7..878a5b974 100644 --- a/multimedia/camera_framework/camera_manager.h +++ b/multimedia/camera_framework/camera_manager.h @@ -62,6 +62,15 @@ extern "C" { */ typedef void (*OH_CameraManager_StatusCallback)(Camera_Manager* cameraManager, Camera_StatusInfo* status); +/** + * @brief Camera manager torch status callback. + * + * @param cameraManager the {@link Camera_Manager} which deliver the callback. + * @param status the {@link Camera_TorchStatusInfo} of the torch. + * @since 12 + */ +typedef void (*OH_CameraManager_TorchStatusCallback)(Camera_Manager* cameraManager, Camera_TorchStatusInfo* status); + /** * @brief A listener for camera devices status. * @@ -98,6 +107,30 @@ Camera_ErrorCode OH_CameraManager_RegisterCallback(Camera_Manager* cameraManager */ Camera_ErrorCode OH_CameraManager_UnregisterCallback(Camera_Manager* cameraManager, CameraManager_Callbacks* callback); +/** + * @brief Register torch status change event callback. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param torchStatusCallback the {@link OH_CameraManager_TorchStatusCallback} to be registered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_CameraManager_RegisterTorchStatusCallback(Camera_Manager* cameraManager, + OH_CameraManager_TorchStatusCallback torchStatusCallback); + +/** + * @brief Unregister torch status change event callback. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param torchStatusCallback the {@link OH_CameraManager_TorchStatusCallback} to be unregistered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_CameraManager_UnregisterTorchStatusCallback(Camera_Manager* cameraManager, + OH_CameraManager_TorchStatusCallback torchStatusCallback); + /** * @brief Gets supported camera descriptions. * @@ -349,6 +382,45 @@ Camera_ErrorCode OH_CameraManager_GetSupportedSceneModes(Camera_Device* camera, */ Camera_ErrorCode OH_CameraManager_DeleteSceneModes(Camera_Manager* cameraManager, Camera_SceneMode* sceneModes); +/** + * @brief Check if the device supports torch. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param isTorchSupported whether the device supports torch. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_CameraManager_IsTorchSupported(Camera_Manager* cameraManager, + bool* isTorchSupported); + +/** + * @brief Check whether the device supports the torch with the specified torch mode. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param torchMode the {@link Camera_TorchMode} to be checked. + * @param isTorchSupported whether device supports the torch mode. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_CameraManager_IsTorchSupportedByTorchMode(Camera_Manager* cameraManager, + Camera_TorchMode torchMode, bool* isTorchSupported); + +/** + * @brief Set camera torch mode. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param torchMode the {@link Camera_TorchMode} to be set. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_CameraManager_SetTorchMode(Camera_Manager* cameraManager, + Camera_TorchMode torchMode); + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/capture_session.h b/multimedia/camera_framework/capture_session.h index 7872c5307..87fba17e4 100644 --- a/multimedia/camera_framework/capture_session.h +++ b/multimedia/camera_framework/capture_session.h @@ -47,6 +47,7 @@ #include "photo_output.h" #include "video_output.h" #include "metadata_output.h" +#include "native_buffer/native_buffer.h" #ifdef __cplusplus extern "C" { @@ -82,6 +83,16 @@ typedef void (*OH_CaptureSession_OnFocusStateChange)(Camera_CaptureSession* sess */ typedef void (*OH_CaptureSession_OnError)(Camera_CaptureSession* session, Camera_ErrorCode errorCode); +/** + * @brief Capture session smooth zoom info callback. + * + * @param session the {@link Camera_CaptureSession} which deliver the callback. + * @param smoothZoomInfo the {@link Camera_SmoothZoomInfo} which delivered by the callback. + * @since 12 + */ +typedef void (*OH_CaptureSession_OnSmoothZoomInfo)(Camera_CaptureSession* session, + Camera_SmoothZoomInfo* smoothZoomInfo); + /** * @brief A listener for capture session. * @@ -125,6 +136,30 @@ Camera_ErrorCode OH_CaptureSession_RegisterCallback(Camera_CaptureSession* sessi Camera_ErrorCode OH_CaptureSession_UnregisterCallback(Camera_CaptureSession* session, CaptureSession_Callbacks* callback); +/** + * @brief Register smooth zoom information event callback. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param smoothZoomInfoCallback the {@link OH_CaptureSession_OnSmoothZoomInfo} to be registered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_RegisterSmoothZoomInfoCallback(Camera_CaptureSession* session, + OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback); + +/** + * @brief Unregister smooth zoom information event callback. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param smoothZoomInfoCallback the {@link OH_CaptureSession_OnSmoothZoomInfo} to be unregistered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_UnregisterSmoothZoomInfoCallback(Camera_CaptureSession* session, + OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback); + /** * @brief Specifies the specific mode. * @@ -681,8 +716,8 @@ Camera_ErrorCode OH_CaptureSession_CanAddVideoOutput(Camera_CaptureSession* sess * @brief Check the preconfig type is supported or not. * * @param session the {@link Camera_CaptureSession} instance. - * @param preconfigType the target {@link Camera_PreconfigType} to set. - * @param canPreconfig the result of whether the preconfig type is supported. + * @param preconfigType The type {@link Camera_PreconfigType} to check support for. + * @param canPreconfig The result of whether preconfiguration supported. * @return {@link #CAMERA_OK} if the method call succeeds. * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. * @since 12 @@ -694,25 +729,24 @@ Camera_ErrorCode OH_CaptureSession_CanPreconfig(Camera_CaptureSession* session, * @brief Check the preconfig type with ratio is supported or not. * * @param session the {@link Camera_CaptureSession} instance. - * @param preconfigType the target {@link Camera_PreconfigType} to set. - * @param preconfigRatio the target {@link Camera_PreconfigRatio} to set. - * @param canPreconfig the result of whether the preconfig type with ratio is supported. + * @param preconfigType The type {@link Camera_PreconfigType} to check support for. + * @param preconfigRatio The ratio {@link Camera_PreconfigRatio} to check support for. + * @param canPreconfig The result of whether preconfiguration supported. * @return {@link #CAMERA_OK} if the method call succeeds. * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. * @since 12 */ Camera_ErrorCode OH_CaptureSession_CanPreconfigWithRatio(Camera_CaptureSession* session, - Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio, - bool* canPreconfig); + Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio, bool* canPreconfig); /** * @brief Set the preconfig type. * * @param session the {@link Camera_CaptureSession} instance. - * @param preconfigType the target {@link Camera_PreconfigType} to set. + * @param preconfigType The type {@link Camera_PreconfigType} to check support for. * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if the internal preconfiguration fails. * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. - * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. * @since 12 */ Camera_ErrorCode OH_CaptureSession_Preconfig(Camera_CaptureSession* session, @@ -722,16 +756,106 @@ Camera_ErrorCode OH_CaptureSession_Preconfig(Camera_CaptureSession* session, * @brief Set the preconfig type with ratio. * * @param session the {@link Camera_CaptureSession} instance. - * @param preconfigType the target {@link Camera_PreconfigType} to set. - * @param preconfigRatio the target {@link Camera_PreconfigRatio} to set. + * @param preconfigType The type {@link Camera_PreconfigType} to check support for. + * @param preconfigRatio The ratio {@link Camera_PreconfigRatio} to check support for. * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if the internal preconfiguration fails. * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. - * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. * @since 12 */ Camera_ErrorCode OH_CaptureSession_PreconfigWithRatio(Camera_CaptureSession* session, Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio); +/** + * @brief Query the exposure value. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param exposureValue the current exposure value. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_GetExposureValue(Camera_CaptureSession* session, float* exposureValue); + +/** + * @brief Get current focal length. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param focalLength the current focal length. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_GetFocalLength(Camera_CaptureSession* session, float* focalLength); + +/** + * @brief Set target zoom ratio by smooth method. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param targetZoom the target zoom ratio to set. + * @param smoothZoomMode the {@link Camera_SmoothZoomMode} instance. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_SetSmoothZoom(Camera_CaptureSession* session, + float targetZoom, Camera_SmoothZoomMode smoothZoomMode); + +/** + * @brief Get the supported color spaces. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param colorSpace the supported {@link OH_NativeBuffer_ColorSpace} list to be filled if the method call succeeds. + * @param size the size of supported color Spaces queried. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_GetSupportedColorSpaces(Camera_CaptureSession* session, + OH_NativeBuffer_ColorSpace** colorSpace, uint32_t* size); + +/** + * @brief Delete the color spaces. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param colorSpace the target {@link OH_NativeBuffer_ColorSpace} list to be deleted if the method call succeeds. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_DeleteColorSpaces(Camera_CaptureSession* session, + OH_NativeBuffer_ColorSpace* colorSpace); + +/** + * @brief Get current color space. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param colorSpace the current {@link OH_NativeBuffer_ColorSpace} . + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_GetActiveColorSpace(Camera_CaptureSession* session, + OH_NativeBuffer_ColorSpace* colorSpace); + +/** + * @brief Set current color space. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param colorSpace the target {@link OH_NativeBuffer_ColorSpace} to set. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_SetActiveColorSpace(Camera_CaptureSession* session, + OH_NativeBuffer_ColorSpace colorSpace); + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/photo_output.h b/multimedia/camera_framework/photo_output.h index 273455d17..fba42bf7a 100644 --- a/multimedia/camera_framework/photo_output.h +++ b/multimedia/camera_framework/photo_output.h @@ -94,6 +94,50 @@ typedef void (*OH_PhotoOutput_OnFrameEnd)(Camera_PhotoOutput* photoOutput, int32 */ typedef void (*OH_PhotoOutput_OnError)(Camera_PhotoOutput* photoOutput, Camera_ErrorCode errorCode); +/** + * @brief Photo output capture end callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} which deliver the callback. + * @param frameCount the frameCount which is delivered by the callback. + * @since 12 + */ +typedef void (*OH_PhotoOutput_CaptureEnd) (Camera_PhotoOutput* photoOutput, int32_t frameCount); + +/** + * @brief Photo output capture start with infomation callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} which deliver the callback. + * @param Info the {@link Camera_CaptureStartInfo} which is delivered by the callback.. + * @since 12 + */ +typedef void (*OH_PhotoOutput_CaptureStartWithInfo) (Camera_PhotoOutput* photoOutput, Camera_CaptureStartInfo* Info); + +/** + * @brief Photo output eframe shutter end callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} which deliver the callback. + * @param Info the {@link Camera_CaptureStartInfo} which is delivered by the callback. + * @since 12 + */ +typedef void (*OH_PhotoOutput_OnFrameShutterEnd) (Camera_PhotoOutput* photoOutput, Camera_FrameShutterInfo* Info); + +/** + * @brief Photo output capture ready callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} which deliver the callback. + * @since 12 + */ +typedef void (*OH_PhotoOutput_CaptureReady) (Camera_PhotoOutput* photoOutput); + +/** + * @brief Photo output estimated capture duration callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} which deliver the callback. + * @param duration the duration which is delivered by the callback. + * @since 12 + */ +typedef void (*OH_PhotoOutput_EstimatedCaptureDuration) (Camera_PhotoOutput* photoOutput, int64_t duration); + /** * @brief A listener for photo output. * @@ -145,6 +189,126 @@ Camera_ErrorCode OH_PhotoOutput_RegisterCallback(Camera_PhotoOutput* photoOutput */ Camera_ErrorCode OH_PhotoOutput_UnregisterCallback(Camera_PhotoOutput* photoOutput, PhotoOutput_Callbacks* callback); +/** + * @brief Register capture start event callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance. + * @param callback the {@link OH_PhotoOutput_CaptureStartWithInfo} to be registered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_RegisterCaptureStartWithInfoCallback(Camera_PhotoOutput* photoOutput, + OH_PhotoOutput_CaptureStartWithInfo callback); + +/** + * @brief Unregister capture start event callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance. + * @param callback the {@link OH_PhotoOutput_CaptureStartWithInfo} to be unregistered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureStartWithInfoCallback(Camera_PhotoOutput* photoOutput, + OH_PhotoOutput_CaptureStartWithInfo callback); + +/** + * @brief Register capture end event callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance. + * @param callback the {@link OH_PhotoOutput_CaptureEnd} to be registered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_RegisterCaptureEndCallback(Camera_PhotoOutput* photoOutput, + OH_PhotoOutput_CaptureEnd callback); + +/** + * @brief Unregister capture end event callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance. + * @param callback the {@link OH_PhotoOutput_CaptureEnd} to be unregistered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureEndCallback(Camera_PhotoOutput* photoOutput, + OH_PhotoOutput_CaptureEnd callback); + +/** + * @brief Register frame shutter end event callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance. + * @param callback the {@link OH_PhotoOutput_OnFrameShutterEnd} to be registered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_RegisterFrameShutterEndCallback(Camera_PhotoOutput* photoOutput, + OH_PhotoOutput_OnFrameShutterEnd callback); + +/** + * @brief Unregister frame shutter end event callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance. + * @param callback the {@link OH_PhotoOutput_OnFrameShutterEnd} to be unregistered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_UnregisterFrameShutterEndCallback(Camera_PhotoOutput* photoOutput, + OH_PhotoOutput_OnFrameShutterEnd callback); + +/** + * @brief Register capture ready event callback. After receiving the callback, can proceed to the next capture. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance. + * @param callback the {@link OH_PhotoOutput_CaptureReady} to be registered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_RegisterCaptureReadyCallback(Camera_PhotoOutput* photoOutput, + OH_PhotoOutput_CaptureReady callback); + +/** + * @brief Unregister capture ready event callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance. + * @param callback the {@link OH_PhotoOutput_CaptureReady} to be unregistered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_UnregisterCaptureReadyCallback(Camera_PhotoOutput* photoOutput, + OH_PhotoOutput_CaptureReady callback); + +/** + * @brief Register estimated capture duration event callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance. + * @param callback the {@link OH_PhotoOutput_EstimatedCaptureDuration} to be registered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_RegisterEstimatedCaptureDurationCallback(Camera_PhotoOutput* photoOutput, + OH_PhotoOutput_EstimatedCaptureDuration callback); + +/** + * @brief Unregister estimated capture duration event callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance. + * @param callback the {@link OH_PhotoOutput_EstimatedCaptureDuration} to be unregistered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_UnregisterEstimatedCaptureDurationCallback(Camera_PhotoOutput* photoOutput, + OH_PhotoOutput_EstimatedCaptureDuration callback); + /** * @brief Capture photo. * @@ -195,12 +359,13 @@ Camera_ErrorCode OH_PhotoOutput_Release(Camera_PhotoOutput* photoOutput); Camera_ErrorCode OH_PhotoOutput_IsMirrorSupported(Camera_PhotoOutput* photoOutput, bool* isSupported); /** - * @brief Get active profiles. + * @brief Get active photo output profile. * - * @param photoOutput the {@link Camera_PhotoOutput} instance which used to get active profiles. - * @param profile the active {@link Camera_Profile} will be filled if the method call succeeds. + * @param photoOutput the {@link Camera_PhotoOutput} instance to deliver active profile. + * @param profile the active {@link Camera_Profile} to be filled if the method call succeeds. * @return {@link #CAMERA_OK} if the method call succeeds. * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. * @since 12 */ Camera_ErrorCode OH_PhotoOutput_GetActiveProfile(Camera_PhotoOutput* photoOutput, Camera_Profile** profile); diff --git a/multimedia/camera_framework/preview_output.h b/multimedia/camera_framework/preview_output.h index 3fa3dcced..89e541ba6 100644 --- a/multimedia/camera_framework/preview_output.h +++ b/multimedia/camera_framework/preview_output.h @@ -168,12 +168,13 @@ Camera_ErrorCode OH_PreviewOutput_Stop(Camera_PreviewOutput* previewOutput); Camera_ErrorCode OH_PreviewOutput_Release(Camera_PreviewOutput* previewOutput); /** - * @brief Get active profiles. + * @brief Get active preview output profile. * - * @param previewOutput the {@link Camera_PreviewOutput} instance which used to get active profiles. - * @param profile the active {@link Camera_Profile} will be filled if the method call succeeds. + * @param previewOutput the {@link Camera_PreviewOutput} instance to deliver active profile. + * @param profile the active {@link Camera_Profile} to be filled if the method call succeeds. * @return {@link #CAMERA_OK} if the method call succeeds. * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. * @since 12 */ Camera_ErrorCode OH_PreviewOutput_GetActiveProfile(Camera_PreviewOutput* previewOutput, Camera_Profile** profile); @@ -188,6 +189,58 @@ Camera_ErrorCode OH_PreviewOutput_GetActiveProfile(Camera_PreviewOutput* preview */ Camera_ErrorCode OH_PreviewOutput_DeleteProfile(Camera_Profile* profile); +/** + * @brief Get supported preview output frame rate list. + * + * @param previewOutput the {@link Camera_PreviewOutput} instance to deliver supported frame rate list. + * @param frameRateRange the supported {@link Camera_FrameRateRange} list to be filled if the method call succeeds. + * @param size the size of supported {@link Camera_FrameRateRange} list will be filled. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_PreviewOutput_GetSupportedFrameRates(Camera_PreviewOutput* previewOutput, + Camera_FrameRateRange** frameRateRange, uint32_t* size); + +/** + * @brief Delete frame rate list. + * + * @param previewOutput the {@link Camera_PreviewOutput} instance to deliver supported frame rate list. + * @param frameRateRange the {@link Camera_FrameRateRange} list to be deleted. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PreviewOutput_DeleteFrameRates(Camera_PreviewOutput* previewOutput, + Camera_FrameRateRange* frameRateRange); + +/** + * @brief Set preview output frame rate. + * + * @param previewOutput the {@link Camera_PreviewOutput} instance to be set frame rate. + * @param minFps the minimum to be set. + * @param maxFps the maximum to be set. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PreviewOutput_SetFrameRate(Camera_PreviewOutput* previewOutput, + int32_t minFps, int32_t maxFps); + +/** + * @brief Get active preview output frame rate. + * + * @param previewOutput the {@link Camera_PreviewOutput} instance to deliver the active frame rate. + * @param frameRateRange the active {@link Camera_FrameRateRange} to be filled if the method call succeeds. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_PreviewOutput_GetActiveFrameRate(Camera_PreviewOutput* previewOutput, + Camera_FrameRateRange* frameRateRange); + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/video_output.h b/multimedia/camera_framework/video_output.h index 07bee9ceb..a74d0f16a 100644 --- a/multimedia/camera_framework/video_output.h +++ b/multimedia/camera_framework/video_output.h @@ -166,12 +166,13 @@ Camera_ErrorCode OH_VideoOutput_Stop(Camera_VideoOutput* videoOutput); Camera_ErrorCode OH_VideoOutput_Release(Camera_VideoOutput* videoOutput); /** - * @brief Get active profiles. + * @brief Get active video output profile. * - * @param videoOutput the {@link Camera_VideoOutput} instance which used to get active profiles. - * @param profile the active {@link Camera_VideoProfile} will be filled if the method call succeeds. + * @param videoOutput the {@link Camera_VideoOutput} instance to deliver active video profile. + * @param profile the active {@link Camera_VideoProfile} to be filled if the method call succeeds. * @return {@link #CAMERA_OK} if the method call succeeds. * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. * @since 12 */ Camera_ErrorCode OH_VideoOutput_GetActiveProfile(Camera_VideoOutput* videoOutput, Camera_VideoProfile** profile); @@ -186,6 +187,58 @@ Camera_ErrorCode OH_VideoOutput_GetActiveProfile(Camera_VideoOutput* videoOutput */ Camera_ErrorCode OH_VideoOutput_DeleteProfile(Camera_VideoProfile* profile); +/** + * @brief Get supported video output frame rate list. + * + * @param videoOutput the {@link Camera_VideoOutput} instance to deliver supported frame rate list. + * @param frameRateRange the supported {@link Camera_FrameRateRange} list to be filled if the method call succeeds. + * @param size the size of supported {@link Camera_FrameRateRange} list will be filled. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_VideoOutput_GetSupportedFrameRates(Camera_VideoOutput* videoOutput, + Camera_FrameRateRange** frameRateRange, uint32_t* size); + +/** + * @brief Delete frame rate list. + * + * @param videoOutput the {@link Camera_VideoOutput} instance to deliver supported frame rate list. + * @param frameRateRange the {@link Camera_FrameRateRange} list to be deleted. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_VideoOutput_DeleteFrameRates(Camera_VideoOutput* videoOutput, + Camera_FrameRateRange* frameRateRange); + +/** + * @brief Set video output frame rate. + * + * @param videoOutput the {@link Camera_VideoOutput} instance to be set frame rate. + * @param minFps the minimum to be set. + * @param maxFps the maximum to be set. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_VideoOutput_SetFrameRate(Camera_VideoOutput* videoOutput, + int32_t minFps, int32_t maxFps); + +/** + * @brief Get active video output frame rate. + * + * @param videoOutput the {@link Camera_VideoOutput} instance to deliver the active frame rate. + * @param frameRateRange the active {@link Camera_FrameRateRange} to be filled if the method call succeeds. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_VideoOutput_GetActiveFrameRate(Camera_VideoOutput* videoOutput, + Camera_FrameRateRange* frameRateRange); + #ifdef __cplusplus } #endif -- Gitee From b8899778e5e71e29b47552e8cc1be2dba138d30d Mon Sep 17 00:00:00 2001 From: wanjining Date: Wed, 31 Jul 2024 09:54:07 +0800 Subject: [PATCH 006/620] =?UTF-8?q?=E3=80=90CAPI=E3=80=91=E6=96=B0?= =?UTF-8?q?=E5=A2=9EText=E7=BB=84=E4=BB=B6HalfLeading=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanjining --- arkui/ace_engine/native/native_node.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index c6028a287..019a4e4ac 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -2157,6 +2157,18 @@ typedef enum { */ NODE_TEXT_CONTENT_WITH_STYLED_STRING, + /** + * @brief Sets whether to center text vertically in the text component. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: whether to center text vertically. The default value is false. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether to center text vertically. \n + * + */ + NODE_TEXT_HALF_LEADING = 1029, + /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. * -- Gitee From 3d06e579f2dc1438c7ab119526d7cf36e6b8baf0 Mon Sep 17 00:00:00 2001 From: wanjining Date: Tue, 30 Jul 2024 19:20:51 +0800 Subject: [PATCH 007/620] =?UTF-8?q?=E3=80=90CAPI=E3=80=91=E6=96=B0?= =?UTF-8?q?=E5=A2=9ECustomSpan=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanjining --- arkui/ace_engine/native/libace.ndk.json | 64 +++++++++++ arkui/ace_engine/native/native_node.h | 41 +++++++ arkui/ace_engine/native/native_type.h | 135 ++++++++++++++++++++++++ 3 files changed, 240 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index ec79d26f4..87155e52a 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -1978,5 +1978,69 @@ { "first_introduced": "12", "name": "OH_ArkUI_DialogDismissEvent_GetDismissReason" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_NodeCustomEvent_GetCustomSpanMeasureInfo" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_NodeCustomEvent_SetCustomSpanMetrics" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_NodeCustomEvent_GetCustomSpanDrawInfo" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_CustomSpanMeasureInfo_Create" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_CustomSpanMeasureInfo_Dispose" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_CustomSpanMeasureInfo_GetFontSize" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_CustomSpanMetrics_Create" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_CustomSpanMetrics_Dispose" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_CustomSpanMetrics_SetWidth" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_CustomSpanMetrics_SetHeight" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_CustomSpanDrawInfo_Create" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_CustomSpanDrawInfo_Dispose" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_CustomSpanDrawInfo_GetXOffset" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_CustomSpanDrawInfo_GetLineTop" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_CustomSpanDrawInfo_GetLineBottom" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_CustomSpanDrawInfo_GetBaseline" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index c6028a287..1ec148c39 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -122,6 +122,8 @@ typedef enum { ARKUI_NODE_GRID, /** Grid item. */ ARKUI_NODE_GRID_ITEM, + /** Custom span. */ + ARKUI_NODE_CUSTOM_SPAN, } ArkUI_NodeType; /** @@ -7389,6 +7391,45 @@ ArkUI_NodeHandle OH_ArkUI_NodeCustomEvent_GetNodeHandle(ArkUI_NodeCustomEvent* e */ ArkUI_NodeCustomEventType OH_ArkUI_NodeCustomEvent_GetEventType(ArkUI_NodeCustomEvent* event); +/** +* @brief Obtains the measurement information of a custom span through a custom component event. +* +* @param event Indicates the pointer to the custom component event. +* @param info Indicates the measurement information to be obtained. +* @return Returns the result code. +* Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. +* @since 12 +*/ +int32_t OH_ArkUI_NodeCustomEvent_GetCustomSpanMeasureInfo( + ArkUI_NodeCustomEvent* event, ArkUI_CustomSpanMeasureInfo* info); + +/** +* @brief Sets the measurement metrics of a custom span through a custom component event. +* +* @param event Indicates the pointer to the custom component event. +* @param metrics Indicates the measurement metrics to set. +* @return Returns the result code. +* Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. +* @since 12 +*/ +int32_t OH_ArkUI_NodeCustomEvent_SetCustomSpanMetrics( + ArkUI_NodeCustomEvent* event, ArkUI_CustomSpanMetrics* metrics); + +/** +* @brief Obtains the drawing information of a custom span through a custom component event. +* +* @param event Indicates the pointer to the custom component event. +* @param event Indicates the drawing information to obtain. +* @return Returns the result code. +* Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. +* @since 12 +*/ +int32_t OH_ArkUI_NodeCustomEvent_GetCustomSpanDrawInfo( + ArkUI_NodeCustomEvent* event, ArkUI_CustomSpanDrawInfo* info); + /** * @brief Defines the node content event type. * diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index f238b1d6f..0c7696551 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -2063,6 +2063,27 @@ typedef struct { float perspective; } ArkUI_RotationOptions; +/** + * @brief Defines a struct for the measurement information of a custom span. + * + * @since 12 + */ +typedef struct ArkUI_CustomSpanMeasureInfo ArkUI_CustomSpanMeasureInfo; + +/** + * @brief Defines a struct for the measurement metrics of a custom span. + * + * @since 12 + */ +typedef struct ArkUI_CustomSpanMetrics ArkUI_CustomSpanMetrics; + +/** + * @brief Defines a struct for the drawing information of a custom span. + * + * @since 12 + */ +typedef struct ArkUI_CustomSpanDrawInfo ArkUI_CustomSpanDrawInfo; + /** * @brief Defines the state of the NavDestination component. * @@ -3410,6 +3431,120 @@ int32_t OH_ArkUI_ListChildrenMainSizeOption_UpdateSize(ArkUI_ListChildrenMainSiz */ float OH_ArkUI_ListChildrenMainSizeOption_GetMainSize(ArkUI_ListChildrenMainSize* option, int32_t index); +/** + * @brief Creates measurement information for this custom span. + * + * @return Returns a CustomSpanMeasureInfo instance. + * @since 12 +*/ +ArkUI_CustomSpanMeasureInfo* OH_ArkUI_CustomSpanMeasureInfo_Create(); + +/** + * @brief Disposes of measurement information of this custom span. + * + * @since 12 +*/ +void OH_ArkUI_CustomSpanMeasureInfo_Dispose(ArkUI_CustomSpanMeasureInfo* info); + +/** + * @brief Obtains the font size of a custom span. + * + * @param info Indicates the pointer to the measurement information of a custom span. + * @return Returns the font size. If a parameter error occurs, 0.0f is returned. + * @since 12 +*/ +float OH_ArkUI_CustomSpanMeasureInfo_GetFontSize(ArkUI_CustomSpanMeasureInfo* info); + +/** + * @brief Creates measurement metrics for this custom span. + * + * @return Returns a CustomSpanMetrics instance. + * @since 12 +*/ +ArkUI_CustomSpanMetrics* OH_ArkUI_CustomSpanMetrics_Create(); + +/** + * @brief Disposes of measurement metrics of this custom span. + * + * @since 12 +*/ +void OH_ArkUI_CustomSpanMetrics_Dispose(ArkUI_CustomSpanMetrics* metrics); + +/** + * @brief Sets the width for a custom span. + * + * @param metrics Indicates the pointer to a CustomSpanMetrics instance. + * @param width Indicates the width, in px. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 12 +*/ +int32_t OH_ArkUI_CustomSpanMetrics_SetWidth(ArkUI_CustomSpanMetrics* metrics, float width); + +/** + * @brief Sets the height for a custom span. + * + * @param metrics Indicates the pointer to a CustomSpanMetrics instance. + * @param width Indicates the height, in px. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 12 +*/ +int32_t OH_ArkUI_CustomSpanMetrics_SetHeight(ArkUI_CustomSpanMetrics* metrics, float height); + +/** + * @brief Creates drawing information for this custom span. + * + * @return Returns a CustomSpanDrawInfo instance. + * @since 12 +*/ +ArkUI_CustomSpanDrawInfo* OH_ArkUI_CustomSpanDrawInfo_Create(); + +/** + * @brief Disposes of drawing information for this custom span. + * + * @since 12 +*/ +void OH_ArkUI_CustomSpanDrawInfo_Dispose(ArkUI_CustomSpanDrawInfo* info); + +/** + * @brief Obtains the x-axis offset of the custom span relative to the mounted component. + * + * @param info Indicates the pointer to the drawing information of a custom span. + * @return Returns the x-axis offset. If a parameter error occurs, 0.0f is returned. + * @since 12 +*/ +float OH_ArkUI_CustomSpanDrawInfo_GetXOffset(ArkUI_CustomSpanDrawInfo* info); + +/** + * @brief Obtains the top margin of the custom span relative to the mounted component. + * + * @param info Indicates the pointer to the drawing information of a custom span. + * @return Returns the top margin. If a parameter error occurs, 0.0f is returned. + * @since 12 +*/ +float OH_ArkUI_CustomSpanDrawInfo_GetLineTop(ArkUI_CustomSpanDrawInfo* info); + +/** + * @brief Obtains the bottom margin of the custom span relative to the mounted component. + * + * @param info Indicates the pointer to the drawing information of a custom span. + * @return Returns the bottom margin. If a parameter error occurs, 0.0f is returned. + * @since 12 +*/ +float OH_ArkUI_CustomSpanDrawInfo_GetLineBottom(ArkUI_CustomSpanDrawInfo* info); + +/** + * @brief Obtains the baseline offset of the custom span relative to the mounted component. + * + * @param info Indicates the pointer to the drawing information of a custom span. + * @return Returns the baseline offset. If a parameter error occurs, 0.0f is returned. + * @since 12 +*/ +float OH_ArkUI_CustomSpanDrawInfo_GetBaseline(ArkUI_CustomSpanDrawInfo* info); + /** * @brief Create a image frame from the image path. * @param src Indicates the image path. -- Gitee From 10f619277126a4ec34a74b0b36db43c24c38dd39 Mon Sep 17 00:00:00 2001 From: shegangbin Date: Mon, 29 Jul 2024 12:15:27 +0800 Subject: [PATCH 008/620] add native_vsync ndk interface Signed-off-by: shegangbin --- .../native_vsync/libnative_vsync.ndk.json | 1 + .../graphic_2d/native_vsync/native_vsync.h | 23 +++++++++++++++++-- .../native_window/graphic_error_code.h | 2 ++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json b/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json index b702a1d7a..196fab524 100644 --- a/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json +++ b/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json @@ -2,5 +2,6 @@ { "name": "OH_NativeVSync_Create" }, { "name": "OH_NativeVSync_Destroy" }, { "name": "OH_NativeVSync_RequestFrame" }, + { "name": "OH_NativeVSync_RequestFrameWithMultiCallback" }, { "name": "OH_NativeVSync_GetPeriod" } ] \ No newline at end of file diff --git a/graphic/graphic_2d/native_vsync/native_vsync.h b/graphic/graphic_2d/native_vsync/native_vsync.h index 069d17689..85627485c 100644 --- a/graphic/graphic_2d/native_vsync/native_vsync.h +++ b/graphic/graphic_2d/native_vsync/native_vsync.h @@ -65,7 +65,6 @@ OH_NativeVSync* OH_NativeVSync_Create(const char* name, unsigned int length); * * @syscap SystemCapability.Graphic.Graphic2D.NativeVsync * @param window Indicates the pointer to a NativeVsync instance. - * @return Returns int32_t, return value == 0, success, otherwise, failed. * @since 9 * @version 1.0 */ @@ -73,17 +72,37 @@ void OH_NativeVSync_Destroy(OH_NativeVSync* nativeVsync); /** * @brief Request next vsync with callback. + * If you call this interface multiple times in one frame, it will only call the last callback. * * @syscap SystemCapability.Graphic.Graphic2D.NativeVsync * @param nativeVsync Indicates the pointer to a NativeVsync. * @param callback Indicates the OH_NativeVSync_FrameCallback which will be called when next vsync coming. * @param data Indicates data whick will be used in callback. - * @return Returns int32_t, return value == 0, success, otherwise, failed. + * @return {@link NATIVE_ERROR_OK} 0 - Success. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - the parameter nativeVsync is NULL or callback is NULL. + * {@link NATIVE_ERROR_BINDER_ERROR} 50401000 - ipc send failed. * @since 9 * @version 1.0 */ int OH_NativeVSync_RequestFrame(OH_NativeVSync* nativeVsync, OH_NativeVSync_FrameCallback callback, void* data); +/** + * @brief Request next vsync with callback. + * If this function is called multiple times in one vsync period, all these callbacks and dataset will be called. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeVsync + * @param nativeVsync Indicates the pointer to a NativeVsync. + * @param callback Indicates the OH_NativeVSync_FrameCallback which will be called when next vsync coming. + * @param data Indicates data whick will be used in callback. + * @return {@link NATIVE_ERROR_OK} 0 - Success. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - the parameter nativeVsync is NULL or callback is NULL. + * {@link NATIVE_ERROR_BINDER_ERROR} 50401000 - ipc send failed. + * @since 12 + * @version 1.0 + */ +int OH_NativeVSync_RequestFrameWithMultiCallback( + OH_NativeVSync* nativeVsync, OH_NativeVSync_FrameCallback callback, void* data); + /** * @brief Get vsync period. * diff --git a/graphic/graphic_2d/native_window/graphic_error_code.h b/graphic/graphic_2d/native_window/graphic_error_code.h index cba61e5e8..8a2419681 100644 --- a/graphic/graphic_2d/native_window/graphic_error_code.h +++ b/graphic/graphic_2d/native_window/graphic_error_code.h @@ -80,6 +80,8 @@ typedef enum OHNativeErrorCode { NATIVE_ERROR_UNSUPPORTED = 50102000, /** @error unknown error, please check log */ NATIVE_ERROR_UNKNOWN = 50002000, + /** @error ipc send failed */ + NATIVE_ERROR_BINDER_ERROR = 50401000, /** @error the egl environment is abnormal */ NATIVE_ERROR_EGL_STATE_UNKNOWN = 60001000, /** @error egl interface invocation failed */ -- Gitee From d9d606d97a3e02ae4292f792190d0f203776b465 Mon Sep 17 00:00:00 2001 From: m30063213 Date: Wed, 31 Jul 2024 21:30:08 +0800 Subject: [PATCH 009/620] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=92=8C=E5=AE=9E=E7=8E=B0=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m30063213 --- network/netmanager/include/net_connection_type.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index 1698a6593..777c0c0be 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -69,6 +69,8 @@ typedef enum NetConn_NetCap { NETCONN_NET_CAPABILITY_NOT_VPN = 15, /** Validated */ NETCONN_NET_CAPABILITY_VALIDATED = 16, + /** portal */ + NETCONN_NET_CAPABILITY_PORTAL = 17 } NetConn_NetCap; /** -- Gitee From 0dbbc54dc7ca7d039967610ba2b757c585d71d35 Mon Sep 17 00:00:00 2001 From: zoulinken Date: Wed, 31 Jul 2024 16:13:57 +0800 Subject: [PATCH 010/620] =?UTF-8?q?C-API=E6=B7=B1=E6=B5=85=E5=8F=8A?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=AD=97=E4=BD=93=E5=A4=A7=E5=B0=8F=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E9=9C=80=E6=B1=82=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zoulinken --- arkui/ace_engine/native/libace.ndk.json | 24 +++++++++ arkui/ace_engine/native/native_node.h | 67 +++++++++++++++++++++++++ arkui/ace_engine/native/native_type.h | 19 +++++++ 3 files changed, 110 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index ec79d26f4..1e6b48594 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -1978,5 +1978,29 @@ { "first_introduced": "12", "name": "OH_ArkUI_DialogDismissEvent_GetDismissReason" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_RegisterSystemColorModeChangeEvent" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_UnregisterSystemColorModeChangeEvent" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_RegisterSystemFontStyleChangeEvent" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_UnregisterSystemFontStyleChangeEvent" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_SystemFontStyleEvent_GetFontSize" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_SystemFontStyleEvent_GetFontWeight" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 0d137b57e..e5ad45c74 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -7619,6 +7619,73 @@ int32_t OH_ArkUI_List_CloseAllSwipeActions(ArkUI_NodeHandle node, void* userData */ ArkUI_ContextHandle OH_ArkUI_GetContextByNode(ArkUI_NodeHandle node); +/** +* @brief The event called when the system color mode changes. +* Only one system color change callback can be registered for the same component. +* +* @param node Indicates the target node. +* @param userData Indicates the custom data to be saved. +* @param onColorModeChange Callback Events. +* @return Error code. +* {@link ARKUI_ERROR_CODE_NO_ERROR} Success. +* {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function parameter exception. +* {@link ARKUI_ERROR_CODE_ATTRIBUTE_OR_EVENT_NOT_SUPPORTED} The component does not support this event. +* @since 12 +*/ +int32_t OH_ArkUI_RegisterSystemColorModeChangeEvent(ArkUI_NodeHandle node, + void* userData, void (*onColorModeChange)(ArkUI_SystemColorMode colorMode, void* userData)); + +/** +* @brief Unregister the event callback when the system color mode changes. +* +* @param node Indicates the target node. +* @since 12 +*/ +void OH_ArkUI_UnregisterSystemColorModeChangeEvent(ArkUI_NodeHandle node); + +/** +* @brief The event called when the system font style changes. +* Only one system font change callback can be registered for the same component. +* +* @param node Indicates the target node. +* @param userData Indicates the custom data to be saved. +* @param onFontStyleChange Callback Events. +* @return Error code. +* {@link ARKUI_ERROR_CODE_NO_ERROR} Success. +* {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function parameter exception. +* {@link ARKUI_ERROR_CODE_ATTRIBUTE_OR_EVENT_NOT_SUPPORTED} The component does not support this event. +* @since 12 +*/ +int32_t OH_ArkUI_RegisterSystemFontStyleChangeEvent(ArkUI_NodeHandle node, + void* userData, void (*onFontStyleChange)(ArkUI_SystemFontStyleEvent* event, void* userData)); + +/** +* @brief Unregister the event callback when the system font style changes. +* +* @param node Indicates the target node. +* @since 12 +*/ +void OH_ArkUI_UnregisterSystemFontStyleChangeEvent(ArkUI_NodeHandle node); + +/** + * @brief Retrieve the font size value for system font change events. + * + * @param event Indicates a pointer to the current system font change event. + * @return Updated system font size. -1 indicates a retrieval error. + * @since 12 + */ +int32_t OH_ArkUI_SystemFontStyleEvent_GetFontSize(const ArkUI_SystemFontStyleEvent* event); + +/** + * @brief Retrieve the font thickness values for system font change events. + * + * @param event Indicates a pointer to the current system font change event. + * @return Updated system font thickness, return value type {@link ArkUI_fontWeight}, + * default value:ARKUI_FONT_WEIGHT_W100。 + * @since 12 + */ +int32_t OH_ArkUI_SystemFontStyleEvent_GetFontWeight(const ArkUI_SystemFontStyleEvent* event); + #ifdef __cplusplus }; #endif diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index f238b1d6f..616256924 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -983,6 +983,18 @@ typedef enum { ARKUI_COLOR_MODE_DARK, } ArkUI_ColorMode; +/** + * @brief Enumerates the system color modes. + * + * @since 12 + */ +typedef enum { + /** Light color mode. */ + ARKUI_SYSTEM_COLOR_MODE_LIGHT = 0, + /** Dark color mode. */ + ARKUI_SYSTEM_COLOR_MODE_DARK, +} ArkUI_SystemColorMode; + /** * @brief Enumerates the blur styles. * @@ -2137,6 +2149,13 @@ typedef enum { ARKUI_SAFE_AREA_EDGE_END = 1 << 3, } ArkUI_SafeAreaEdge; +/** + * @brief Defines parameter used by the system font style callback event. + * + * @since 12 + */ +typedef struct ArkUI_SystemFontStyleEvent ArkUI_SystemFontStyleEvent; + /** * @brief Creates a size constraint. * -- Gitee From 5c232fb1481978b47352b8a491fc69823b3ee132 Mon Sep 17 00:00:00 2001 From: m30063213 Date: Thu, 1 Aug 2024 17:39:29 +0800 Subject: [PATCH 011/620] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=92=8C=E5=AE=9E=E7=8E=B0=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m30063213 --- network/netmanager/include/net_connection_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index 777c0c0be..184479315 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -69,7 +69,7 @@ typedef enum NetConn_NetCap { NETCONN_NET_CAPABILITY_NOT_VPN = 15, /** Validated */ NETCONN_NET_CAPABILITY_VALIDATED = 16, - /** portal */ + /** Portal */ NETCONN_NET_CAPABILITY_PORTAL = 17 } NetConn_NetCap; -- Gitee From 8c088c4a4e6f3a20a78d203c3daa74c7626a3842 Mon Sep 17 00:00:00 2001 From: m30063213 Date: Fri, 2 Aug 2024 11:42:27 +0800 Subject: [PATCH 012/620] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=92=8C=E5=AE=9E=E7=8E=B0=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m30063213 --- network/netmanager/include/net_connection_type.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index 184479315..c2e25e2b5 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -69,7 +69,10 @@ typedef enum NetConn_NetCap { NETCONN_NET_CAPABILITY_NOT_VPN = 15, /** Validated */ NETCONN_NET_CAPABILITY_VALIDATED = 16, - /** Portal */ + /** + * portal + * @since 12 + */ NETCONN_NET_CAPABILITY_PORTAL = 17 } NetConn_NetCap; -- Gitee From ca95585c213b9c28839cf24771306666772d2729 Mon Sep 17 00:00:00 2001 From: happy Date: Fri, 2 Aug 2024 08:05:25 +0000 Subject: [PATCH 013/620] =?UTF-8?q?native=5Fnode.h=20=E4=B8=AD=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: happy Change-Id: I3b9eb274fe95ad8b4b5e8faa226732d38677c530 --- arkui/ace_engine/native/native_node.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 0d137b57e..f6e71e41e 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -1026,10 +1026,10 @@ typedef enum { * .string: command for drawing the path.\n * 5. Progress:\n * .value[0].i32: mask type. The parameter type is {@link ArkUI_MaskType}. - * The value is ARKUI_MASK_TYPE_PROSGRESS for the progress shape.\n + * The value is ARKUI_MASK_TYPE_PROGRESS for the progress shape.\n * .value[1].f32: current value of the progress indicator.\n * .value[2].f32: maximum value of the progress indicator.\n - * .value[3].u32: color of the progress indicator.\n + * .value[3].u32: color of the progress indicator, in 0xARGB format.\n * \n * Format of the return value {@link ArkUI_AttributeItem}, which supports five types of shapes:\n * 1. Rectangle:\n -- Gitee From b7451b431b5885b02a7b7aaa270de84c0595b8eb Mon Sep 17 00:00:00 2001 From: zhangjinyu101 Date: Fri, 2 Aug 2024 16:22:46 +0800 Subject: [PATCH 014/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9CAPI=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangjinyu101 Change-Id: Icaf53fd247e64bab521f7b373e612c155a9228be --- arkui/ace_engine/native/drag_and_drop.h | 20 ++++++++++---------- arkui/ace_engine/native/libace.ndk.json | 2 +- arkui/ace_engine/native/native_node.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arkui/ace_engine/native/drag_and_drop.h b/arkui/ace_engine/native/drag_and_drop.h index c8dc14726..2f68d95b0 100644 --- a/arkui/ace_engine/native/drag_and_drop.h +++ b/arkui/ace_engine/native/drag_and_drop.h @@ -80,22 +80,22 @@ typedef enum { */ typedef enum { /** Unknown. */ - ARKUI_PREVIEW_DRAG_STATUS_UNKNOWN = -1, + ARKUI_PRE_DRAG_STATUS_UNKNOWN = -1, /** A drag gesture is being detected. */ - ARKUI_PREVIEW_DRAG_STATUS_ACTION_DETECTING, + ARKUI_PRE_DRAG_STATUS_ACTION_DETECTING, /** The component is ready to be dragged. */ - ARKUI_PREVIEW_DRAG_STATUS_READY_TO_TRIGGER_DRAG, + ARKUI_PRE_DRAG_STATUS_READY_TO_TRIGGER_DRAG, /** A lift animation is started. */ - ARKUI_PREVIEW_DRAG_STATUS_PREVIEW_LIFT_STARTED, + ARKUI_PRE_DRAG_STATUS_PREVIEW_LIFT_STARTED, /** A lift animation is finished. */ - ARKUI_PREVIEW_DRAG_STATUS_PREVIEW_LIFT_FINISHED, + ARKUI_PRE_DRAG_STATUS_PREVIEW_LIFT_FINISHED, /** A drop animation is started. */ - ARKUI_PREVIEW_DRAG_STATUS_PREVIEW_LANDING_STARTED, + ARKUI_PRE_DRAG_STATUS_PREVIEW_LANDING_STARTED, /** A drop animation is finished. */ - ARKUI_PREVIEW_DRAG_STATUS_PREVIEW_LANDING_FINISHED, + ARKUI_PRE_DRAG_STATUS_PREVIEW_LANDING_FINISHED, /** A drop animation is terminated. */ - ARKUI_PREVIEW_DRAG_STATUS_CANCELED_BEFORE_DRAG, -} ArkUI_PreviewDragStatus; + ARKUI_PRE_DRAG_STATUS_CANCELED_BEFORE_DRAG, +} ArkUI_PreDragStatus; /** * @brief Defines an enum for drag preview scale modes. @@ -192,7 +192,7 @@ ArkUI_DragEvent* OH_ArkUI_NodeEvent_GetDragEvent(ArkUI_NodeEvent* nodeEvent); * @return Returns the interaction state prior to the drop and drop operation. * @since 12 */ -ArkUI_PreviewDragStatus OH_ArkUI_NodeEvent_GetPreviewDragStatus(ArkUI_NodeEvent* nodeEvent); +ArkUI_PreDragStatus OH_ArkUI_NodeEvent_GetPreDragStatus(ArkUI_NodeEvent* nodeEvent); /** * @brief Sets whether to disable the default drop animation. diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 250a1c13d..c7d2378dd 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -1765,7 +1765,7 @@ }, { "first_introduced": "12", - "name": "OH_ArkUI_NodeEvent_GetPreviewDragStatus" + "name": "OH_ArkUI_NodeEvent_GetPreDragStatus" }, { "first_introduced": "12", diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 1412a47cf..77375b584 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -5537,7 +5537,7 @@ typedef enum { * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is * {@link ArkUI_NodeComponentEvent}. \n * {@link ArkUI_NodeComponentEvent} contains one parameter:\n - * ArkUI_NodeComponentEvent.data[0].i32: corresponds to {@link ArkUI_PreViewDragStatus}. \n + * ArkUI_NodeComponentEvent.data[0].i32: corresponds to {@link ArkUI_PreDragStatus}. \n */ NODE_ON_PRE_DRAG = 14, /** -- Gitee From adbeca16ab2f2303e67af5c0b23c5366ad005fa3 Mon Sep 17 00:00:00 2001 From: wanjining Date: Wed, 31 Jul 2024 19:12:34 +0800 Subject: [PATCH 015/620] =?UTF-8?q?=E4=BF=AE=E8=AE=A2=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanjining --- arkui/ace_engine/native/native_node.h | 5 ++++- arkui/ace_engine/native/native_type.h | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 1ec148c39..474af5e65 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -7399,6 +7399,7 @@ ArkUI_NodeCustomEventType OH_ArkUI_NodeCustomEvent_GetEventType(ArkUI_NodeCustom * @return Returns the result code. * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. +*
Possible causes: Parameter verification failed, the parameter should not be nullptr. * @since 12 */ int32_t OH_ArkUI_NodeCustomEvent_GetCustomSpanMeasureInfo( @@ -7412,6 +7413,7 @@ int32_t OH_ArkUI_NodeCustomEvent_GetCustomSpanMeasureInfo( * @return Returns the result code. * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. +*
Possible causes: Parameter verification failed, the parameter should not be nullptr. * @since 12 */ int32_t OH_ArkUI_NodeCustomEvent_SetCustomSpanMetrics( @@ -7421,10 +7423,11 @@ int32_t OH_ArkUI_NodeCustomEvent_SetCustomSpanMetrics( * @brief Obtains the drawing information of a custom span through a custom component event. * * @param event Indicates the pointer to the custom component event. -* @param event Indicates the drawing information to obtain. +* @param info Indicates the drawing information to obtain. * @return Returns the result code. * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. +*
Possible causes: Parameter verification failed, the parameter should not be nullptr. * @since 12 */ int32_t OH_ArkUI_NodeCustomEvent_GetCustomSpanDrawInfo( diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 0c7696551..8849c3d7f 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -3435,6 +3435,7 @@ float OH_ArkUI_ListChildrenMainSizeOption_GetMainSize(ArkUI_ListChildrenMainSize * @brief Creates measurement information for this custom span. * * @return Returns a CustomSpanMeasureInfo instance. + *
If the result returns nullptr, there may be out of memory. * @since 12 */ ArkUI_CustomSpanMeasureInfo* OH_ArkUI_CustomSpanMeasureInfo_Create(); @@ -3442,6 +3443,7 @@ ArkUI_CustomSpanMeasureInfo* OH_ArkUI_CustomSpanMeasureInfo_Create(); /** * @brief Disposes of measurement information of this custom span. * + * @param info The CustomSpanMeasureInfo instance to be destroyed. * @since 12 */ void OH_ArkUI_CustomSpanMeasureInfo_Dispose(ArkUI_CustomSpanMeasureInfo* info); @@ -3451,6 +3453,7 @@ void OH_ArkUI_CustomSpanMeasureInfo_Dispose(ArkUI_CustomSpanMeasureInfo* info); * * @param info Indicates the pointer to the measurement information of a custom span. * @return Returns the font size. If a parameter error occurs, 0.0f is returned. + *
Possible causes: Parameter verification failed, the parameter should not be nullptr. * @since 12 */ float OH_ArkUI_CustomSpanMeasureInfo_GetFontSize(ArkUI_CustomSpanMeasureInfo* info); @@ -3459,6 +3462,7 @@ float OH_ArkUI_CustomSpanMeasureInfo_GetFontSize(ArkUI_CustomSpanMeasureInfo* in * @brief Creates measurement metrics for this custom span. * * @return Returns a CustomSpanMetrics instance. + *
If the result returns nullptr, there may be out of memory. * @since 12 */ ArkUI_CustomSpanMetrics* OH_ArkUI_CustomSpanMetrics_Create(); @@ -3466,6 +3470,7 @@ ArkUI_CustomSpanMetrics* OH_ArkUI_CustomSpanMetrics_Create(); /** * @brief Disposes of measurement metrics of this custom span. * + * @param info The CustomSpanMetrics instance to be destroyed. * @since 12 */ void OH_ArkUI_CustomSpanMetrics_Dispose(ArkUI_CustomSpanMetrics* metrics); @@ -3474,10 +3479,11 @@ void OH_ArkUI_CustomSpanMetrics_Dispose(ArkUI_CustomSpanMetrics* metrics); * @brief Sets the width for a custom span. * * @param metrics Indicates the pointer to a CustomSpanMetrics instance. - * @param width Indicates the width, in px. + * @param width Indicates the width, in px. The width should be greater than 0. * @return Returns the result code. * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + *
Possible causes: Parameter verification failed, the parameter should not be nullptr. * @since 12 */ int32_t OH_ArkUI_CustomSpanMetrics_SetWidth(ArkUI_CustomSpanMetrics* metrics, float width); @@ -3486,10 +3492,11 @@ int32_t OH_ArkUI_CustomSpanMetrics_SetWidth(ArkUI_CustomSpanMetrics* metrics, fl * @brief Sets the height for a custom span. * * @param metrics Indicates the pointer to a CustomSpanMetrics instance. - * @param width Indicates the height, in px. + * @param width Indicates the height, in px. The width should be greater than 0. * @return Returns the result code. * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + *
Possible causes: Parameter verification failed, the parameter should not be nullptr. * @since 12 */ int32_t OH_ArkUI_CustomSpanMetrics_SetHeight(ArkUI_CustomSpanMetrics* metrics, float height); @@ -3498,6 +3505,7 @@ int32_t OH_ArkUI_CustomSpanMetrics_SetHeight(ArkUI_CustomSpanMetrics* metrics, f * @brief Creates drawing information for this custom span. * * @return Returns a CustomSpanDrawInfo instance. + *
If the result returns nullptr, there may be out of memory. * @since 12 */ ArkUI_CustomSpanDrawInfo* OH_ArkUI_CustomSpanDrawInfo_Create(); @@ -3505,6 +3513,7 @@ ArkUI_CustomSpanDrawInfo* OH_ArkUI_CustomSpanDrawInfo_Create(); /** * @brief Disposes of drawing information for this custom span. * + * @param info The CustomSpanDrawInfo instance to be destroyed. * @since 12 */ void OH_ArkUI_CustomSpanDrawInfo_Dispose(ArkUI_CustomSpanDrawInfo* info); @@ -3514,6 +3523,7 @@ void OH_ArkUI_CustomSpanDrawInfo_Dispose(ArkUI_CustomSpanDrawInfo* info); * * @param info Indicates the pointer to the drawing information of a custom span. * @return Returns the x-axis offset. If a parameter error occurs, 0.0f is returned. + *
Possible causes: Parameter verification failed, the parameter should not be nullptr. * @since 12 */ float OH_ArkUI_CustomSpanDrawInfo_GetXOffset(ArkUI_CustomSpanDrawInfo* info); @@ -3523,6 +3533,7 @@ float OH_ArkUI_CustomSpanDrawInfo_GetXOffset(ArkUI_CustomSpanDrawInfo* info); * * @param info Indicates the pointer to the drawing information of a custom span. * @return Returns the top margin. If a parameter error occurs, 0.0f is returned. + *
Possible causes: Parameter verification failed, the parameter should not be nullptr. * @since 12 */ float OH_ArkUI_CustomSpanDrawInfo_GetLineTop(ArkUI_CustomSpanDrawInfo* info); @@ -3532,6 +3543,7 @@ float OH_ArkUI_CustomSpanDrawInfo_GetLineTop(ArkUI_CustomSpanDrawInfo* info); * * @param info Indicates the pointer to the drawing information of a custom span. * @return Returns the bottom margin. If a parameter error occurs, 0.0f is returned. + *
Possible causes: Parameter verification failed, the parameter should not be nullptr. * @since 12 */ float OH_ArkUI_CustomSpanDrawInfo_GetLineBottom(ArkUI_CustomSpanDrawInfo* info); @@ -3541,6 +3553,7 @@ float OH_ArkUI_CustomSpanDrawInfo_GetLineBottom(ArkUI_CustomSpanDrawInfo* info); * * @param info Indicates the pointer to the drawing information of a custom span. * @return Returns the baseline offset. If a parameter error occurs, 0.0f is returned. + *
Possible causes: Parameter verification failed, the parameter should not be nullptr. * @since 12 */ float OH_ArkUI_CustomSpanDrawInfo_GetBaseline(ArkUI_CustomSpanDrawInfo* info); -- Gitee From 08595094dcc301ac796f406801e23df61f8a8a71 Mon Sep 17 00:00:00 2001 From: y00656910 Date: Sat, 3 Aug 2024 11:20:43 +0800 Subject: [PATCH 016/620] introduce OH_ImageNative_GetTimestamp Signed-off-by: y00656910 Change-Id: I094ab572a3f0f97fa3b9f72aaa1a188610aa6a6b --- multimedia/image_framework/libohimage.ndk.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/multimedia/image_framework/libohimage.ndk.json b/multimedia/image_framework/libohimage.ndk.json index a9eefa5fb..da613fb2a 100644 --- a/multimedia/image_framework/libohimage.ndk.json +++ b/multimedia/image_framework/libohimage.ndk.json @@ -23,6 +23,10 @@ "first_introduced": "12", "name": "OH_ImageNative_GetPixelStride" }, + { + "first_introduced": "12", + "name": "OH_ImageNative_GetTimestamp" + }, { "first_introduced": "12", "name": "OH_ImageNative_Release" -- Gitee From f38fbf0af35d5210c314b686bdec2f1ef1b70a1f Mon Sep 17 00:00:00 2001 From: m30063213 Date: Sat, 3 Aug 2024 11:29:43 +0800 Subject: [PATCH 017/620] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=92=8C=E5=AE=9E=E7=8E=B0=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m30063213 --- network/netmanager/include/net_connection_type.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index c2e25e2b5..d8a70cf6d 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -70,9 +70,9 @@ typedef enum NetConn_NetCap { /** Validated */ NETCONN_NET_CAPABILITY_VALIDATED = 16, /** - * portal - * @since 12 - */ + * Portal + * @since 12 + */ NETCONN_NET_CAPABILITY_PORTAL = 17 } NetConn_NetCap; -- Gitee From 4f17211975f302bc8bd68b81f11f23fde322ca63 Mon Sep 17 00:00:00 2001 From: multimodalinput Date: Fri, 12 Jul 2024 18:19:07 +0800 Subject: [PATCH 018/620] =?UTF-8?q?=E5=A4=9A=E6=A8=A1=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=9B=91=E5=90=AC=E5=92=8C=E6=8B=A6=E6=88=AA?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E9=BC=A0=E6=A0=87=E6=A0=B7=E5=BC=8F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: multimodalinput --- multimodalinput/kits/c/BUILD.gn | 2 + multimodalinput/kits/c/input/oh_axis_type.h | 165 ++++++ .../kits/c/input/oh_input_manager.h | 533 +++++++++++++++++- multimodalinput/kits/c/ohinput.ndk.json | 120 ++++ 4 files changed, 799 insertions(+), 21 deletions(-) create mode 100644 multimodalinput/kits/c/input/oh_axis_type.h diff --git a/multimodalinput/kits/c/BUILD.gn b/multimodalinput/kits/c/BUILD.gn index 60f919ab1..1d53eb37c 100644 --- a/multimodalinput/kits/c/BUILD.gn +++ b/multimodalinput/kits/c/BUILD.gn @@ -18,6 +18,7 @@ import("//foundation/multimodalinput/input/multimodalinput_mini.gni") ohos_ndk_headers("ohinput_header") { dest_dir = "$ndk_headers_out_dir/multimodalinput" sources = [ + "./input/oh_axis_type.h", "./input/oh_input_manager.h", "./input/oh_key_code.h", ] @@ -29,6 +30,7 @@ ohos_ndk_library("libohinput_ndk") { ndk_description_file = "./ohinput.ndk.json" system_capability = "SystemCapability.MultimodalInput.Input.Core" system_capability_headers = [ + "multimodalinput/oh_axis_type.h", "multimodalinput/oh_input_manager.h", "multimodalinput/oh_key_code.h", ] diff --git a/multimodalinput/kits/c/input/oh_axis_type.h b/multimodalinput/kits/c/input/oh_axis_type.h new file mode 100644 index 000000000..7d5fd8cc4 --- /dev/null +++ b/multimodalinput/kits/c/input/oh_axis_type.h @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup input + * @{ + * + * @brief Provides the C interface in the multi-modal input domain. + * + * @since 12 + */ + +/** + * @file oh_axis_type.h + * + * @brief Defines the axis event-specific structure and enumerations. + * @kit InputKit + * @syscap SystemCapability.MultimodalInput.Input.Core + * @library liboh_input.so + * @since 12 + */ + +#ifndef OH_AXIS_TYPE_H +#define OH_AXIS_TYPE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates axis types. + * + * @since 12 + */ +typedef enum InputEvent_AxisType { + /** + * Indicates an unknown axis type. It is generally used as the initial value. + * + * @since 12 + */ + AXIS_TYPE_UNKNOWN, + + /** + * Indicates the vertical scroll axis. When you scroll the mouse wheel or make certain gestures on the touchpad, + * the status of the vertical scroll axis changes. + * + * @since 12 + */ + AXIS_TYPE_SCROLL_VERTICAL, + + /** + * Indicates the horizontal scroll axis. + * When you scroll the mouse wheel or make certain gestures on the touchpad, + * the status of the horizontal scroll axis changes. + * + * @since 12 + */ + AXIS_TYPE_SCROLL_HORIZONTAL, + + /** + * Indicates the pinch axis, which is used to describe a pinch gesture on the touchscreen or touchpad. + * + * @since 12 + */ + AXIS_TYPE_PINCH, + + /** + * Indicates the rotate axis, which is used to describe a rotate gesture on the touchpad. + * + * @since 12 + */ + AXIS_TYPE_ROTATE +} InputEvent_AxisType; + +/** + * @brief Enumerates axis event types. + * + * @since 12 + */ +typedef enum InputEvent_AxisEventType { + /** + * @brief Enumerates two-finger pinch events. The axis value can be AXIS_TYPE_PINCH or AXIS_TYPE_ROTATE. + * + * @since 12 + */ + AXIS_EVENT_TYPE_PINCH = 1, + /** + * @brief Enumerates scroll axis events. + * The axis value can be AXIS_TYPE_SCROLL_VERTICAL or AXIS_TYPE_SCROLL_HORIZONTAL. + * Wherein, the value of AXIS_TYPE_SCROLL_HORIZONTAL is 0 for a mouse wheel event. + * + * @since 12 + */ + AXIS_EVENT_TYPE_SCROLL = 2 +} InputEvent_AxisEventType; + +/** + * @brief Enumerates axis event source types. + * + * @since 12 + */ +typedef enum InputEvent_SourceType { + /** + * Indicates that the input source generates events similar to mouse cursor movement, + * button press and release, and wheel scrolling. + * + * @since 12 + */ + SOURCE_TYPE_MOUSE = 1, + /** + * Indicates that the input source generates a touchscreen multi-touch event. + * + * @since 12 + */ + SOURCE_TYPE_TOUCHSCREEN = 2, + /** + * Indicates that the input source generates a touchpad multi-touch event. + * + * @since 12 + */ + SOURCE_TYPE_TOUCHPAD = 3 +} InputEvent_SourceType; + +/** + * @brief Enumerates axis event actions. + * + * @since 12 + */ +typedef enum InputEvent_AxisAction { + /** + * Start action for the axis input event. + * + * @since 12 + */ + AXIS_ACTION_BEGIN = 5, + /** + * Update action for the axis input event. + * + * @since 12 + */ + AXIS_ACTION_UPDATE = 6, + /** + * End action for the axis input event. + * + * @since 12 + */ + AXIS_ACTION_END = 7, +} InputEvent_AxisAction; +#ifdef __cplusplus +} +#endif +/** @} */ +#endif \ No newline at end of file diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 7506a28f9..5ae7d4df7 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -37,6 +37,7 @@ #include +#include "oh_axis_type.h" #include "oh_key_code.h" #ifdef __cplusplus @@ -48,7 +49,7 @@ extern "C" { * * @since 12 */ -enum Input_KeyStateAction { +typedef enum Input_KeyStateAction { /** Default */ KEY_DEFAULT = -1, /** Pressing of a key */ @@ -59,14 +60,14 @@ enum Input_KeyStateAction { KEY_SWITCH_ON = 2, /** Key switch disabled */ KEY_SWITCH_OFF = 3 -}; +} Input_KeyStateAction; /** * @brief Enumerates key event types. * * @since 12 */ -typedef enum { +typedef enum Input_KeyEventAction { /** Cancellation of a key action. */ KEY_ACTION_CANCEL = 0, /** Pressing of a key. */ @@ -80,7 +81,7 @@ typedef enum { * * @since 12 */ -typedef enum { +typedef enum Input_MouseEventAction { /** Cancel. */ MOUSE_ACTION_CANCEL = 0, /** Moving of the mouse pointer. */ @@ -102,19 +103,19 @@ typedef enum { * * @since 12 */ -enum InputEvent_MouseAxis { +typedef enum InputEvent_MouseAxis { /** Vertical scroll axis */ MOUSE_AXIS_SCROLL_VERTICAL = 0, /** Horizontal scroll axis */ MOUSE_AXIS_SCROLL_HORIZONTAL = 1, -}; +} InputEvent_MouseAxis; /** * @brief Enumerated values of mouse event button. * * @since 12 */ -typedef enum { +typedef enum Input_MouseEventButton { /** Invalid button */ MOUSE_BUTTON_NONE = -1, /** Left button on the mouse. */ @@ -134,7 +135,7 @@ typedef enum { * * @since 12 */ -typedef enum { +typedef enum Input_TouchEventAction { /** Touch cancelled. */ TOUCH_ACTION_CANCEL = 0, /** Touch pressed. */ @@ -150,51 +151,115 @@ typedef enum { * * @since 12 */ -struct Input_KeyState; +typedef struct Input_KeyState Input_KeyState; /** * @brief The key event to be injected. * * @since 12 */ -struct Input_KeyEvent; +typedef struct Input_KeyEvent Input_KeyEvent; /** * @brief The mouse event to be injected. * * @since 12 */ -struct Input_MouseEvent; +typedef struct Input_MouseEvent Input_MouseEvent; /** * @brief The touch event to be injected. * * @since 12 */ -struct Input_TouchEvent; +typedef struct Input_TouchEvent Input_TouchEvent; /** - * @brief Enumerates the error codes. + * @brief Enumerates axis events. * * @since 12 */ -typedef enum { - /** @error Success return code on sucess*/ +typedef struct Input_AxisEvent Input_AxisEvent; + +/** + * @brief Enumerates error codes. + * + * @since 12 + */ +typedef enum Input_Result { + /** @error Success return code on success*/ INPUT_SUCCESS = 0, /** @error Permission verification failed */ INPUT_PERMISSION_DENIED = 201, /** @error Non-system application */ INPUT_NOT_SYSTEM_APPLICATION = 202, /** @error Parameter check failed */ - INPUT_PARAMETER_ERROR = 401 + INPUT_PARAMETER_ERROR = 401, + /** @error Service error */ + INPUT_SERVICE_EXCEPTION = 3800001, + /** @error Interceptor repeatedly created for an application */ + INPUT_REPEAT_INTERCEPTOR = 4200001 } Input_Result; +/** + * @brief Defines a lifecycle callback for keyEvent. If the callback is triggered, keyEvent will be destroyed. + * + * @param keyEvent Key event object. + * @since 12 + */ +typedef void (*Input_KeyEventCallback)(const Input_KeyEvent* keyEvent); + +/** + * @brief Defines a lifecycle callback for mouseEvent. If the callback is triggered, mouseEvent will be destroyed. + * + * @param mouseEvent Mouse event object. + * @since 12 + */ +typedef void (*Input_MouseEventCallback)(const Input_MouseEvent* mouseEvent); + +/** + * @brief Defines a lifecycle callback for touchEvent. If the callback is triggered, touchEvent will be destroyed. + * + * @param touchEvent Touch event object. + * @since 12 + */ +typedef void (*Input_TouchEventCallback)(const Input_TouchEvent* touchEvent); + +/** + * @brief Defines a lifecycle callback for axisEvent. If the callback is triggered, axisEvent will be destroyed. + * + * @param axisEvent Axis event object. + * @since 12 + */ +typedef void (*Input_AxisEventCallback)(const Input_AxisEvent* axisEvent); + +/** + * @brief Defines the structure for the interceptor of event callbacks, + * including mouseCallback, touchCallback, and axisCallback. + * + * @since 12 + */ +typedef struct Input_InterceptorEventCallback { + /** Defines a lifecycle callback for **mouseEvent**. */ + Input_MouseEventCallback mouseCallback; + /** Defines a lifecycle callback for **touchEvent**. */ + Input_TouchEventCallback touchCallback; + /** Defines a lifecycle callback for **axisEvent**. */ + Input_AxisEventCallback axisCallback; +} Input_InterceptorEventCallback; + +/** + * @brief Defines event interceptor options. + * @since 12 + */ +typedef struct Input_InterceptorOptions Input_InterceptorOptions; + /** * @brief Queries the key state. * * @param keyState Key state. * @return OH_Input_GetKeyState function result code. - * {@link INPUT_SUCCESS} get KeyState sucess.\n + * {@link INPUT_SUCCESS} get KeyState success.\n * {@link INPUT_PARAMETER_ERROR} keyCode is invalid.\n * @syscap SystemCapability.MultimodalInput.Input.Core * @since 12 @@ -285,7 +350,7 @@ int32_t OH_Input_GetKeySwitch(const struct Input_KeyState* keyState); * * @param keyEvent - the key event to be injected. * @return OH_Input_InjectKeyEvent function result code. - * {@link INPUT_SUCCESS} inject keyEvent sucess.\n + * {@link INPUT_SUCCESS} inject keyEvent success.\n * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n * {@link INPUT_PARAMETER_ERROR} keyCode is less 0, can not process.\n * @syscap SystemCapability.MultimodalInput.Input.Core @@ -377,7 +442,7 @@ int64_t OH_Input_GetKeyEventActionTime(const struct Input_KeyEvent* keyEvent); * * @param mouseEvent - the mouse event to be injected. * @return OH_Input_InjectMouseEvent function result code. - * {@link INPUT_SUCCESS} inject mouseEvent sucess.\n + * {@link INPUT_SUCCESS} inject mouseEvent success.\n * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n * {@link INPUT_PARAMETER_ERROR} Parameter check failed.\n * @syscap SystemCapability.MultimodalInput.Input.Core @@ -508,7 +573,8 @@ int32_t OH_Input_GetMouseEventAxisType(const struct Input_MouseEvent* mouseEvent * @brief Sets the axis value for a mouse axis event. * * @param mouseEvent Mouse event object. - * @param axisType Axis value. A positive value means scrolling forward, and a negative number means scrolling backward. + * @param axisType Axis value. A positive value means scrolling forward, + * and a negative number means scrolling backward. * @syscap SystemCapability.MultimodalInput.Input.Core * @since 12 */ @@ -549,7 +615,7 @@ int64_t OH_Input_GetMouseEventActionTime(const struct Input_MouseEvent* mouseEve * * @param touchEvent - the touch event to be injected. * @return OH_Input_InjectTouchEvent function result code. - * {@link INPUT_SUCCESS} inject touchEvent sucess.\n + * {@link INPUT_SUCCESS} inject touchEvent success.\n * {@link INPUT_PARAMETER_ERROR} Parameter check failed.\n * @syscap SystemCapability.MultimodalInput.Input.Core * @since 12 @@ -683,6 +749,431 @@ int64_t OH_Input_GetTouchEventActionTime(const struct Input_TouchEvent* touchEve */ void OH_Input_CancelInjection(); +/** + * @brief Creates an axis event object. + * + * @return If the operation is successful, a {@Link Input_AxisEvent} object is returned. + * If the operation fails, null is returned. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_AxisEvent* OH_Input_CreateAxisEvent(void); + +/** + * @brief Destroys an axis event object. + * + * @param axisEvent Pointer to the axis event object. + * @return OH_Input_DestroyAxisEvent function result code. + * {@link INPUT_SUCCESS} Destroys axisEvent success.\n + * {@link INPUT_PARAMETER_ERROR}The axisEvent is NULL or the *axisEvent is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_DestroyAxisEvent(Input_AxisEvent** axisEvent); + +/** + * @brief Sets the axis event action. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param action Axis event action. The values are defined in {@link InputEvent_AxisAction}. + * @return OH_Input_SetAxisEventAction function result code. + * {@link INPUT_SUCCESS} Sets the axis event action success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_SetAxisEventAction(Input_AxisEvent* axisEvent, InputEvent_AxisAction action); + +/** + * @brief Obtains the axis event action. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param action Axis event action. The values are defined in {@link InputEvent_AxisAction}. + * @return OH_Input_GetAxisEventAction function result code. + * {@link INPUT_SUCCESS} Obtains the axis event action success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL or the action is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_GetAxisEventAction(const Input_AxisEvent* axisEvent, InputEvent_AxisAction *action); + +/** + * @brief Sets the X coordinate of an axis event. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param displayX X coordinate of the axis event. + * @return OH_Input_SetAxisEventDisplayX function result code. + * {@link INPUT_SUCCESS} Sets the X coordinate of the axis event success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_SetAxisEventDisplayX(Input_AxisEvent* axisEvent, float displayX); + +/** + * @brief Obtains the X coordinate of an axis event. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param displayX X coordinate of the axis event. + * @return OH_Input_GetAxisEventDisplayX function result code. + * {@link INPUT_SUCCESS} Obtains the X coordinate of the axis event success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL or the displayX is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_GetAxisEventDisplayX(const Input_AxisEvent* axisEvent, float* displayX); + +/** + * @brief Sets the Y coordinate of an axis event. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param displayY Y coordinate of the axis event. + * @return OH_Input_SetAxisEventDisplayY function result code. + * {@link INPUT_SUCCESS} Sets the Y coordinate of the axis event success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_SetAxisEventDisplayY(Input_AxisEvent* axisEvent, float displayY); + +/** + * @brief Obtains the Y coordinate of an axis event. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param displayY Y coordinate of the axis event. + * @return OH_Input_GetAxisEventDisplayY function result code. + * {@link INPUT_SUCCESS} Obtains the Y coordinate of the axis event success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL or the displayY is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_GetAxisEventDisplayY(const Input_AxisEvent* axisEvent, float* displayY); + +/** + * @brief Sets the axis value of the axis type specified by the axis event. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param axisType Axis type. The values are defined in {@link InputEvent_AxisType}. + * @param axisValue Axis value. + * @return OH_Input_SetAxisEventAxisValue function result code. + * {@link INPUT_SUCCESS} Sets the axis value of the axis event success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_SetAxisEventAxisValue(Input_AxisEvent* axisEvent, + InputEvent_AxisType axisType, double axisValue); + +/** + * @brief Obtains the axis value for the specified axis type of the axis event. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param axisType Axis type. The values are defined in {@link InputEvent_AxisType}. + * @param axisValue Axis value. + * @return OH_Input_GetAxisEventAxisValue function result code. + * {@link INPUT_SUCCESS} Obtains the axis value of the axis event success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL or the axisValue is NULL, + * or the axisType not found in the axisEvent.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_GetAxisEventAxisValue(const Input_AxisEvent* axisEvent, + InputEvent_AxisType axisType, double* axisValue); + +/** + * @brief Sets the time when an axis event occurs. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param actionTime Time when an axis event occurs. + * @return OH_Input_SetAxisEventActionTime function result code. + * {@link INPUT_SUCCESS} Sets the time when an axis event occurs success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_SetAxisEventActionTime(Input_AxisEvent* axisEvent, int64_t actionTime); + +/** + * @brief Obtains the time when an axis event occurs. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param actionTime Time when an axis event occurs. + * @return OH_Input_GetAxisEventActionTime function result code. + * {@link INPUT_SUCCESS} Obtains the time when an axis event occurs success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL or the actionTime is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_GetAxisEventActionTime(const Input_AxisEvent* axisEvent, int64_t* actionTime); + +/** + * @brief Sets the axis event type. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param axisEventType Axis event type. The values are defined in {@link InputEvent_AxisEventType}. + * @return OH_Input_SetAxisEventType function result code. + * {@link INPUT_SUCCESS} Sets the axis event type success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_SetAxisEventType(Input_AxisEvent* axisEvent, InputEvent_AxisEventType axisEventType); + +/** + * @brief Obtains the axis event type. + * + * @param axisEvent Axis event object. + * @param axisEventType Axis event type. The values are defined in {@link InputEvent_AxisEventType}. + * @return OH_Input_GetAxisEventType function result code. + * {@link INPUT_SUCCESS} Obtains the axis event type success.\n + * {@Link INPUT_PARAMETER_ERROR} The axisEvent is NULL or the axisEventType is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_GetAxisEventType(const Input_AxisEvent* axisEvent, InputEvent_AxisEventType* axisEventType); + +/** + * @brief Sets the axis event source type. + * + * @param axisEvent Axis event object. + * @param sourceType Axis event source type. The values are defined in {@link InputEvent_SourceType}. + * @return OH_Input_SetAxisEventSourceType function result code. + * {@link INPUT_SUCCESS} Sets the axis event source type success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_SetAxisEventSourceType(Input_AxisEvent* axisEvent, InputEvent_SourceType sourceType); + +/** + * @brief Obtains the axis event source type. + * + * @param axisEvent Axis event object. + * @param axisEventType Axis event source type. The values are defined in {@link InputEvent_SourceType}. + * @return OH_Input_GetAxisEventSourceType function result code. + * {@link INPUT_SUCCESS} Obtains the axis event source type success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL or the sourceType is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_GetAxisEventSourceType(const Input_AxisEvent* axisEvent, InputEvent_SourceType* sourceType); + +/** + * @brief Adds a listener of key events. + * + * @permission ohos.permission.INPUT_MONITORING + * @param callback - Callback used to receive key events. + * @return OH_Input_AddKeyEventMonitor function result code. + * {@link INPUT_SUCCESS} Adds a listener of key events success.\n + * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n + * {@link INPUT_PARAMETER_ERROR} The callback is NULL.\n + * {@link INPUT_SERVICE_EXCEPTION} Failed to add the monitor because the service is exception.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_AddKeyEventMonitor(Input_KeyEventCallback callback); + +/** + * @brief Adds a listener for mouse events, including mouse click and movement events, + * but not scroll wheel events. Scroll wheel events are axis events. + * + * @permission ohos.permission.INPUT_MONITORING + * @param callback - Callback used to receive mouse events. + * @return OH_Input_AddMouseEventMonitor function result code. + * {@link INPUT_SUCCESS} Adds a listener of mouse events success.\n + * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n + * {@link INPUT_PARAMETER_ERROR} The callback is NULL.\n + * {@link INPUT_SERVICE_EXCEPTION} Failed to add the monitor because the service is exception.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_AddMouseEventMonitor(Input_MouseEventCallback callback); + +/** + * @brief Add a listener for touch events. + * + * @permission ohos.permission.INPUT_MONITORING + * @param callback - Callback used to receive touch events. + * @return OH_Input_AddTouchEventMonitor function result code. + * {@link INPUT_SUCCESS} Adds a listener of touch events success.\n + * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n + * {@link INPUT_PARAMETER_ERROR} The callback is NULL.\n + * {@link INPUT_SERVICE_EXCEPTION} Failed to add the monitor because the service is exception.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_AddTouchEventMonitor(Input_TouchEventCallback callback); + +/** + * @brief Adds a listener for all types of axis events. + * The axis event types are defined in {@Link InputEvent_AxisEventType}. + * + * @permission ohos.permission.INPUT_MONITORING + * @param callback - Callback used to receive axis events. + * @return OH_Input_AddAxisEventMonitorForAll function result code. + * {@link INPUT_SUCCESS} Adds a listener for all types of axis events success.\n + * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n + * {@link INPUT_PARAMETER_ERROR} The callback is NULL.\n + * {@link INPUT_SERVICE_EXCEPTION} Failed to add the monitor because the service is exception.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_AddAxisEventMonitorForAll(Input_AxisEventCallback callback); + +/** + * @brief Adds a listener for the specified type of axis events. + * + * @permission ohos.permission.INPUT_MONITORING + * @param axisEventType - Axis event type. The values are defined in {@Link InputEvent_AxisEventType}. + * @param callback - Callback used to receive the specified type of axis events. + * @return OH_Input_AddAxisEventMonitor function result code. + * {@link INPUT_SUCCESS} Adds a listener for the specified types of axis events success.\n + * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n + * {@link INPUT_PARAMETER_ERROR} The callback is NULL.\n + * {@link INPUT_SERVICE_EXCEPTION} Failed to add the monitor because the service is exception.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_AddAxisEventMonitor(InputEvent_AxisEventType axisEventType, Input_AxisEventCallback callback); + +/** + * @brief Removes a key event listener. + * + * @permission ohos.permission.INPUT_MONITORING + * @param callback - Callback for the key event listener. + * @return OH_Input_RemoveKeyEventMonitor function result code. + * {@link INPUT_SUCCESS} Removes a key event listener success.\n + * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n + * {@link INPUT_PARAMETER_ERROR} The callback is NULL or has not been added.\n + * {@link INPUT_SERVICE_EXCEPTION} Fail to remove the monitor because the service is exception.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_RemoveKeyEventMonitor(Input_KeyEventCallback callback); + +/** + * @brief Removes a mouse event listener. + * + * @permission ohos.permission.INPUT_MONITORING + * @param callback - Callback for the mouse event listener. + * @return OH_Input_RemoveMouseEventMonitor function result code. + * {@link INPUT_SUCCESS} Removes a mouse event listener success.\n + * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n + * {@link INPUT_PARAMETER_ERROR} The callback is NULL or has not been added.\n + * {@link INPUT_SERVICE_EXCEPTION} Fail to remove the monitor because the service is exception.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_RemoveMouseEventMonitor(Input_MouseEventCallback callback); + +/** + * @brief Removes a touch event listener. + * + * @permission ohos.permission.INPUT_MONITORING + * @param callback - Callback for the touch event listener. + * @return OH_Input_RemoveTouchEventMonitor function result code. + * {@link INPUT_SUCCESS} Removes a touch event listener success.\n + * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n + * {@link INPUT_PARAMETER_ERROR} The callback is NULL or has not been added.\n + * {@link INPUT_SERVICE_EXCEPTION} Fail to remove the monitor because the service is exception.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_RemoveTouchEventMonitor(Input_TouchEventCallback callback); + +/** + * @brief Removes the listener for all types of axis events. + * + * @permission ohos.permission.INPUT_MONITORING + * @param callback - Callback for the listener used to listen for all types of axis events. + * @return OH_Input_RemoveAxisEventMonitorForAll function result code. + * {@link INPUT_SUCCESS} Removes the listener for all types of axis events success.\n + * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n + * {@link INPUT_PARAMETER_ERROR} The callback is NULL or has not been added.\n + * {@link INPUT_SERVICE_EXCEPTION} Fail to remove the monitor because the service is exception.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_RemoveAxisEventMonitorForAll(Input_AxisEventCallback callback); + +/** + * @brief Removes the listener for the specified type of axis events. + * + * @permission ohos.permission.INPUT_MONITORING + * @param axisEventType - Axis event type. The axis event type is defined in {@Link InputEvent_AxisEventType}. + * @param callback - Callback for the listener used to listen for the specified type of axis events. + * @return OH_Input_RemoveAxisEventMonitor function result code. + * {@link INPUT_SUCCESS} Removes the listener for the specified type of axis events success.\n + * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n + * {@link INPUT_PARAMETER_ERROR} The callback is NULL or has not been added.\n + * {@link INPUT_SERVICE_EXCEPTION} Fail to remove the monitor because the service is exception.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_RemoveAxisEventMonitor(InputEvent_AxisEventType axisEventType, Input_AxisEventCallback callback); + +/** + * @brief Adds a key event interceptor. If multiple interceptors are added, only the first one takes effect. + * + * @permission ohos.permission.INTERCEPT_INPUT_EVENT + * @param callback - Callback used to receive key events. + * @param option - Options for event interception. If **null** is passed, the default value is used. + * @return OH_Input_AddKeyEventInterceptor function result code. + * {@link INPUT_SUCCESS} Adds a key event interceptor success.\n + * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n + * {@link INPUT_PARAMETER_ERROR} The callback is NULL.\n + * {@link INPUT_REPEAT_INTERCEPTOR} Interceptor repeatedly created for an application.\n + * {@link INPUT_SERVICE_EXCEPTION} Failed to add the interceptor because the service is exception.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_AddKeyEventInterceptor(Input_KeyEventCallback callback, Input_InterceptorOptions *option); + +/** + * @brief Adds an interceptor for input events, including mouse, touch, and axis events. + * If multiple interceptors are added, only the first one takes effect. + * + * @permission ohos.permission.INTERCEPT_INPUT_EVENT + * @param callback - Pointer to the structure of the callback for the input event interceptor. + * For details, see {@Link Input_InterceptorEventCallback}. + * @param option - Options for event interception. If **null** is passed, the default value is used. + * @return OH_Input_AddInputEventInterceptor function result code. + * {@link INPUT_SUCCESS} Adds an interceptor for input events success.\n + * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n + * {@link INPUT_PARAMETER_ERROR} The callback is NULL.\n + * {@link INPUT_REPEAT_INTERCEPTOR} Interceptor repeatedly created for an application.\n + * {@link INPUT_SERVICE_EXCEPTION} Failed to add the interceptor because the service is exception.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_AddInputEventInterceptor(Input_InterceptorEventCallback *callback, + Input_InterceptorOptions *option); + +/** + * @brief Removes a key event interceptor. + * + * @permission ohos.permission.INTERCEPT_INPUT_EVENT + * @return OH_Input_RemoveKeyEventInterceptor function result code. + * {@link INPUT_SUCCESS}Removes a key event interceptor success.\n + * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n + * {@link INPUT_SERVICE_EXCEPTION} Failed to remove the interceptor because the service is exception.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_RemoveKeyEventInterceptor(); + +/** + * @brief Removes an interceptor for input events, including mouse, touch, and axis events. + * + * @permission ohos.permission.INTERCEPT_INPUT_EVENT + * @return OH_Input_RemoveInputEventInterceptor function result code. + * {@link INPUT_SUCCESS} Removes an interceptor for input events success.\n + * {@link INPUT_PERMISSION_DENIED} Permission verification failed.\n + * {@link INPUT_SERVICE_EXCEPTION} Failed to remove the interceptor because the service is exception.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 12 + */ +Input_Result OH_Input_RemoveInputEventInterceptor(); #ifdef __cplusplus } #endif diff --git a/multimodalinput/kits/c/ohinput.ndk.json b/multimodalinput/kits/c/ohinput.ndk.json index cc28eac47..cfbe993ae 100644 --- a/multimodalinput/kits/c/ohinput.ndk.json +++ b/multimodalinput/kits/c/ohinput.ndk.json @@ -194,5 +194,125 @@ { "first_introduced": "12", "name": "OH_Input_CancelInjection" + }, + { + "first_introduced": "12", + "name": "OH_Input_CreateAxisEvent" + }, + { + "first_introduced": "12", + "name": "OH_Input_DestroyAxisEvent" + }, + { + "first_introduced": "12", + "name": "OH_Input_SetAxisEventAction" + }, + { + "first_introduced": "12", + "name": "OH_Input_GetAxisEventAction" + }, + { + "first_introduced": "12", + "name": "OH_Input_SetAxisEventDisplayX" + }, + { + "first_introduced": "12", + "name": "OH_Input_GetAxisEventDisplayX" + }, + { + "first_introduced": "12", + "name": "OH_Input_SetAxisEventDisplayY" + }, + { + "first_introduced": "12", + "name": "OH_Input_GetAxisEventDisplayY" + }, + { + "first_introduced": "12", + "name": "OH_Input_SetAxisEventAxisValue" + }, + { + "first_introduced": "12", + "name": "OH_Input_GetAxisEventAxisValue" + }, + { + "first_introduced": "12", + "name": "OH_Input_SetAxisEventActionTime" + }, + { + "first_introduced": "12", + "name": "OH_Input_GetAxisEventActionTime" + }, + { + "first_introduced": "12", + "name": "OH_Input_SetAxisEventType" + }, + { + "first_introduced": "12", + "name": "OH_Input_GetAxisEventType" + }, + { + "first_introduced": "12", + "name": "OH_Input_SetAxisEventSourceType" + }, + { + "first_introduced": "12", + "name": "OH_Input_GetAxisEventSourceType" + }, + { + "first_introduced": "12", + "name": "OH_Input_AddKeyEventMonitor" + }, + { + "first_introduced": "12", + "name": "OH_Input_AddMouseEventMonitor" + }, + { + "first_introduced": "12", + "name": "OH_Input_AddTouchEventMonitor" + }, + { + "first_introduced": "12", + "name": "OH_Input_AddAxisEventMonitor" + }, + { + "first_introduced": "12", + "name": "OH_Input_AddAxisEventMonitorForAll" + }, + { + "first_introduced": "12", + "name": "OH_Input_RemoveKeyEventMonitor" + }, + { + "first_introduced": "12", + "name": "OH_Input_RemoveMouseEventMonitor" + }, + { + "first_introduced": "12", + "name": "OH_Input_RemoveTouchEventMonitor" + }, + { + "first_introduced": "12", + "name": "OH_Input_RemoveAxisEventMonitor" + }, + { + "first_introduced": "12", + "name": "OH_Input_RemoveAxisEventMonitorForAll" + }, + { + "first_introduced": "12", + "name": "OH_Input_AddKeyEventInterceptor" + }, + { + "first_introduced": "12", + "name": "OH_Input_AddInputEventInterceptor" + }, + { + "first_introduced": "12", + "name": "OH_Input_RemoveKeyEventInterceptor" + }, + { + "first_introduced": "12", + "name": "OH_Input_RemoveInputEventInterceptor" } ] \ No newline at end of file -- Gitee From f85f7e871b8abbf34d62562837e5d8a572767fb1 Mon Sep 17 00:00:00 2001 From: m30063213 Date: Sat, 3 Aug 2024 17:00:54 +0800 Subject: [PATCH 019/620] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=92=8C=E5=AE=9E=E7=8E=B0=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m30063213 --- network/netmanager/include/net_connection_type.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index d8a70cf6d..32a8118c8 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -70,9 +70,9 @@ typedef enum NetConn_NetCap { /** Validated */ NETCONN_NET_CAPABILITY_VALIDATED = 16, /** - * Portal - * @since 12 - */ + * Portal + * @since 12 + */ NETCONN_NET_CAPABILITY_PORTAL = 17 } NetConn_NetCap; -- Gitee From 9a1b6748563a2cc6c36b4e580df260ba54f2abf6 Mon Sep 17 00:00:00 2001 From: caochuan Date: Tue, 6 Aug 2024 09:52:49 +0800 Subject: [PATCH 020/620] Add ndk API for Picture Issue: https://gitee.com/openharmony/interface_sdk_c/issues/IACICD?from=project-issue Signed-off-by: caochuan --- multimedia/image_effect/image_effect.h | 28 + .../image_effect/libimage_effect.ndk.json | 8 + multimedia/image_framework/BUILD.gn | 37 +- .../include/image/image_common.h | 133 +++++ .../include/image/image_packer_native.h | 34 ++ .../include/image/image_source_native.h | 85 +++ .../include/image/picture_native.h | 490 ++++++++++++++++++ .../include/image/pixelmap_native.h | 8 +- .../image_framework/libimage_common.ndk.json | 22 + .../image_framework/libimage_packer.ndk.json | 8 + .../image_framework/libimage_source.ndk.json | 20 + .../image_framework/libpicture.ndk.json | 114 ++++ 12 files changed, 979 insertions(+), 8 deletions(-) create mode 100644 multimedia/image_framework/include/image/picture_native.h create mode 100644 multimedia/image_framework/libimage_common.ndk.json create mode 100644 multimedia/image_framework/libpicture.ndk.json diff --git a/multimedia/image_effect/image_effect.h b/multimedia/image_effect/image_effect.h index 921d8a5b0..b1bb66de6 100644 --- a/multimedia/image_effect/image_effect.h +++ b/multimedia/image_effect/image_effect.h @@ -40,6 +40,7 @@ #include "image_effect_filter.h" #include "native_buffer/native_buffer.h" #include "native_window/external_window.h" +#include "multimedia/image_framework/image/picture_native.h" #ifdef __cplusplus extern "C" { @@ -315,6 +316,33 @@ ImageEffect_ErrorCode OH_ImageEffect_SetInputUri(OH_ImageEffect *imageEffect, co */ ImageEffect_ErrorCode OH_ImageEffect_SetOutputUri(OH_ImageEffect *imageEffect, const char *uri); +/** + * @brief Set input picture that contains the image information. It should be noted that the input picture will be + * directly rendered and modified if the output is not set + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param picture Indicates the OH_PictureNative that contains the image information + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * {@link EFFECT_ERROR_PARAM_INVALID}, the input parameter is a null pointer. + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_SetInputPicture(OH_ImageEffect *imageEffect, OH_PictureNative *picture); + +/** + * @brief Set output picture that contains the image information + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @param imageEffect Encapsulate OH_ImageEffect structure instance pointer + * @param picture Indicates the OH_PictureNative that contains the image information + * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to + * {@link ImageEffect_ErrorCode} + * {@link EFFECT_ERROR_PARAM_INVALID}, the input parameter is a null pointer. + * @since 12 + */ +ImageEffect_ErrorCode OH_ImageEffect_SetOutputPicture(OH_ImageEffect *imageEffect, OH_PictureNative *picture); + /** * @brief Render the filter effects that can be a single filter or a chain of filters * diff --git a/multimedia/image_effect/libimage_effect.ndk.json b/multimedia/image_effect/libimage_effect.ndk.json index 6b3c6abab..99226c04a 100644 --- a/multimedia/image_effect/libimage_effect.ndk.json +++ b/multimedia/image_effect/libimage_effect.ndk.json @@ -203,6 +203,14 @@ "first_introduced": "12", "name": "OH_ImageEffect_SetOutputUri" }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_SetInputPicture" + }, + { + "first_introduced": "12", + "name": "OH_ImageEffect_SetOutputPicture" + }, { "first_introduced": "12", "name": "OH_ImageEffect_Start" diff --git a/multimedia/image_framework/BUILD.gn b/multimedia/image_framework/BUILD.gn index be2610e97..9b5e9895a 100644 --- a/multimedia/image_framework/BUILD.gn +++ b/multimedia/image_framework/BUILD.gn @@ -44,6 +44,38 @@ ohos_ndk_headers("libpixelmap_header") { sources = [ "./include/image/pixelmap_native.h" ] } +ohos_ndk_library("libpicture") { + ndk_description_file = "./libpicture.ndk.json" + output_name = "picture" + output_extension = "so" + min_compact_version = "12" + system_capability = "SystemCapability.Multimedia.Image.Core" + system_capability_headers = [ + "multimedia/image_framework/image/picture_native.h", + "multimedia/image_framework/image/image_common.h", + ] +} + +ohos_ndk_headers("libpicture_header") { + dest_dir = "$ndk_headers_out_dir/multimedia/image_framework/image" + sources = [ "./include/image/picture_native.h" ] +} + +ohos_ndk_library("libimage_common") { + ndk_description_file = "./libimage_common.ndk.json" + output_name = "image_common" + output_extension = "so" + min_compact_version = "12" + system_capability = "SystemCapability.Multimedia.Image.Core" + system_capability_headers = + [ "multimedia/image_framework/image/image_common.h" ] +} + +ohos_ndk_headers("libimage_common_header") { + dest_dir = "$ndk_headers_out_dir/multimedia/image_framework/image" + sources = [ "./include/image/image_common.h" ] +} + ohos_ndk_library("libimage_ndk") { ndk_description_file = "./libimage_ndk.ndk.json" min_compact_version = "1" @@ -119,10 +151,7 @@ ohos_ndk_library("libohimage") { ohos_ndk_headers("ohimage_header") { dest_dir = "$ndk_headers_out_dir/multimedia/image_framework/image" - sources = [ - "./include/image/image_common.h", - "./include/image/image_native.h", - ] + sources = [ "./include/image/image_native.h" ] } ohos_ndk_library("libimage_receiver") { diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index 6e50d7764..f44cf9b9a 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -95,6 +95,20 @@ struct Image_String { size_t size = 0; }; +/** + * @brief Define a PictureMetadata struct type, used for picture metadata. + * + * @since 12 + */ +struct OH_PictureMetadata; + +/** + * @brief Define a PictureMetadata struct type, used for picture metadata. + * + * @since 12 + */ +typedef struct OH_PictureMetadata OH_PictureMetadata; + /** * @brief Defines the property string (in key-value format) of the image source. * @@ -147,6 +161,89 @@ typedef enum { IMAGE_ENCODE_FAILED = 7800301, } Image_ErrorCode; +/** + * @brief Define the metadata type. + * + * @since 12 + */ +typedef enum { + /* + * EXIF metadata. + */ + EXIF_METADATA = 1, + /* + * Fragment metadata. + */ + FRAGMENT_METADATA = 2, +} Image_MetadataType; + +/** + * @brief Creates a PictureMetadata object. + * + * @param metadataType The type of metadata. + * @param metadata The PictureMetadata pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} metadata is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PictureMetadata_Create(Image_MetadataType metadataType, OH_PictureMetadata **metadata); + +/** + * @brief Obtains the property of picture metadata. + * + * @param metadata The PictureMetadata pointer will be operated. + * @param key The property's key. + * @param value The property's value. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} metadata is nullptr, or key is nullptr, or value is nullptr. + * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type, or the metadata type does not match the + * auxiliary picture type. + * @since 12 + */ +Image_ErrorCode OH_PictureMetadata_GetProperty(OH_PictureMetadata *metadata, Image_String *key, Image_String *value); + +/** + * @brief Set picture metadata property. + * + * @param metadata The PictureMetadata pointer will be operated. + * @param key The property's key. + * @param value The property's value. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} metadata is nullptr, or key is nullptr, or value is nullptr. + * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type, or the metadata type does not match the + * auxiliary picture type. + * @since 12 + */ +Image_ErrorCode OH_PictureMetadata_SetProperty(OH_PictureMetadata *metadata, Image_String *key, Image_String *value); + +/** + * @brief Releases this PictureMetadata object. + * + * @param metadata The PictureMetadata pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} metadata is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PictureMetadata_Release(OH_PictureMetadata *metadata); + +/** + * @brief Obtains a clone of metadata. + * + * @param oldMetadata The PictureMetadata pointer will be operated. + * @param newMetadata The PictureMetadata pointer will be cloned. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} metadata is nullptr. + * {@link IMAGE_ALLOC_FAILED} memory alloc failed. + * {@link IMAGE_COPY_FAILED} memory copy failed. + * @since 12 + */ +Image_ErrorCode OH_PictureMetadata_Clone(OH_PictureMetadata *oldMetadata, OH_PictureMetadata **newMetadata); + /** * @brief Defines the bmp mime type. * @@ -1333,6 +1430,42 @@ static const char *OHOS_IMAGE_PROPERTY_WIND_SNAPSHOT_MODE = "HwMnoteWindSnapshot * @since 12 */ static const char *OHOS_IMAGE_PROPERTY_GIF_LOOP_COUNT = "GIFLoopCount"; + +/** + * @brief X in original + * It is used in {@link OH_ImageSource_GetImageProperty}. + * The top left corner of the fragment image is at the X-coordinate of the original image + * + * @since 12 + */ +static const char *OHOS_IMAGE_PROPERTY_X_IN_ORIGINAL = "XInOriginal"; + +/** + * @brief Y in original + * It is used in {@link OH_ImageSource_GetImageProperty}. + * The top left corner of the fragment image is at the Y-coordinate of the original image + * + * @since 12 + */ +static const char *OHOS_IMAGE_PROPERTY_Y_IN_ORIGINAL = "YInOriginal"; + +/** + * @brief Fragment map width + * It is used in {@link OH_ImageSource_GetImageProperty}. + * The width of the fragment image + * + * @since 12 + */ +static const char *OHOS_IMAGE_PROPERTY_FRAGMENT_WIDTH = "FragmentImageWidth"; + +/** + * @brief Fragment map height + * It is used in {@link OH_ImageSource_GetImageProperty}. + * The height of the fragment image + * + * @since 12 + */ +static const char *OHOS_IMAGE_PROPERTY_FRAGMENT_HEIGHT = "FragmentImageHeight"; #ifdef __cplusplus }; #endif diff --git a/multimedia/image_framework/include/image/image_packer_native.h b/multimedia/image_framework/include/image/image_packer_native.h index 6a5a4e9b5..bef398006 100644 --- a/multimedia/image_framework/include/image/image_packer_native.h +++ b/multimedia/image_framework/include/image/image_packer_native.h @@ -219,6 +219,24 @@ Image_ErrorCode OH_ImagePackerNative_PackToDataFromImageSource(OH_ImagePackerNat Image_ErrorCode OH_ImagePackerNative_PackToDataFromPixelmap(OH_ImagePackerNative *imagePacker, OH_PackingOptions *options, OH_PixelmapNative *pixelmap, uint8_t *outData, size_t *size); +/** + * @brief Encoding a Picture into the data with required format. + * + * @param imagePacker The imagePacker to use for packing. + * @param options Indicates the encoding {@link OH_PackingOptions}. + * @param picture The picture to be packed. + * @param outData The output data buffer to store the packed image. + * @param size A pointer to the size of the output data buffer. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} imagePacker is nullptr, or picture is nullptr, or outData is nullptr, + * or size is invalid. + * {@link IMAGE_ENCODE_FAILED} encode failed. + * @since 12 + */ +Image_ErrorCode OH_ImagePackerNative_PackToDataFromPicture(OH_ImagePackerNative *imagePacker, + OH_PackingOptions *options, OH_PictureNative *picture, uint8_t *outData, size_t *size); + /** * @brief Encoding an ImageSource into the a file with fd with required format. * @@ -245,6 +263,22 @@ Image_ErrorCode OH_ImagePackerNative_PackToFileFromImageSource(OH_ImagePackerNat Image_ErrorCode OH_ImagePackerNative_PackToFileFromPixelmap(OH_ImagePackerNative *imagePacker, OH_PackingOptions *options, OH_PixelmapNative *pixelmap, int32_t fd); +/** + * @brief Encoding a Picture into the a file with fd with required format. + * + * @param imagePacker The imagePacker to use for packing. + * @param options Indicates the encoding {@link OH_PackingOptions}. + * @param picture The picture to be packed. + * @param fd Indicates a writable file descriptor. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} imagePacker is nullptr, or picture is nullptr, or fd is invalid. + * {@link IMAGE_ENCODE_FAILED} encode failed. + * @since 12 + */ +Image_ErrorCode OH_ImagePackerNative_PackToFileFromPicture(OH_ImagePackerNative *imagePacker, + OH_PackingOptions *options, OH_PictureNative *picture, int32_t fd); + /** * @brief Releases an imagePacker object. * diff --git a/multimedia/image_framework/include/image/image_source_native.h b/multimedia/image_framework/include/image/image_source_native.h index 72cf4dae2..803fe4928 100644 --- a/multimedia/image_framework/include/image/image_source_native.h +++ b/multimedia/image_framework/include/image/image_source_native.h @@ -38,6 +38,7 @@ #include "image_common.h" #include "pixelmap_native.h" +#include "picture_native.h" #include "rawfile/raw_file.h" #ifdef __cplusplus @@ -61,6 +62,22 @@ typedef struct OH_ImageSourceNative OH_ImageSourceNative; struct OH_ImageSource_Info; typedef struct OH_ImageSource_Info OH_ImageSource_Info; +/** + * @brief Defines decoding options for picture + * {@link OH_DecodingOptionsForPicture_Create}. + * + * @since 12 + */ +struct OH_DecodingOptionsForPicture; + +/** + * @brief Defines decoding options for picture + * {@link OH_DecodingOptionsForPicture_Create}. + * + * @since 12 + */ +typedef struct OH_DecodingOptionsForPicture OH_DecodingOptionsForPicture; + /** * @brief Enumerates decoding dynamic range.. * @@ -360,6 +377,23 @@ Image_ErrorCode OH_ImageSourceNative_CreatePixelmap(OH_ImageSourceNative *source Image_ErrorCode OH_ImageSourceNative_CreatePixelmapList(OH_ImageSourceNative *source, OH_DecodingOptions *options, OH_PixelmapNative *resVecPixMap[], size_t size); +/** + * @brief Create Picture pointer from ImageSource + * based on the specified {@link OH_DecodingOptionsForPicture} struct. + * + * @param source Indicates a void pointer(from ImageSource pointer convert). + * @param options Indicates a pointer to the options for decoding the image source. + * For details, see {@link OH_DecodingOptionsForPicture}. + * @param picture Indicates a void pointer to the Picture object obtained at the C++ native layer. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} source is nullptr, or picture is nullptr. + * {@link IMAGE_DECODE_FAILED} decode failed. + * @since 12 + */ +Image_ErrorCode OH_ImageSourceNative_CreatePicture(OH_ImageSourceNative *source, OH_DecodingOptionsForPicture *options, + OH_PictureNative **picture); + /** * @brief Obtains the delay time list from some ImageSource objects (such as GIF image sources). * @@ -429,6 +463,57 @@ Image_ErrorCode OH_ImageSourceNative_GetFrameCount(OH_ImageSourceNative *source, */ Image_ErrorCode OH_ImageSourceNative_Release(OH_ImageSourceNative *source); +/** + * @brief Create a pointer for OH_DecodingOptionsForPicture struct. + * + * @param options The OH_DecodingOptionsForPicture pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options is nullptr. + * @since 12 + */ +Image_ErrorCode OH_DecodingOptionsForPicture_Create(OH_DecodingOptionsForPicture **options); + +/** + * @brief Obtains the desired auxiliary pictures of decoding options. + * + * @param options The OH_DecodingOptionsForPicture pointer will be operated. + * @param desiredAuxiliaryPictures The desired auxiliary pictures in DecodingOptionsForPicture. + * @param length The length of desired auxiliary pictures. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options is nullptr, desiredAuxiliaryPictures is nullptr, + * or length is invalid. + * @since 12 + */ +Image_ErrorCode OH_DecodingOptionsForPicture_GetDesiredAuxiliaryPictures(OH_DecodingOptionsForPicture *options, + Image_AuxiliaryPictureType **desiredAuxiliaryPictures, size_t *length); + +/** + * @brief Set decoding options desired auxiliary pictures. + * + * @param options The OH_DecodingOptionsForPicture pointer will be operated. + * @param desiredAuxiliaryPictures The desired auxiliary pictures will be set. + * @param length The length of desired auxiliary pictures. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options is nullptr, desiredAuxiliaryPictures is nullptr, + * or length is invalid. + * @since 12 + */ +Image_ErrorCode OH_DecodingOptionsForPicture_SetDesiredAuxiliaryPictures(OH_DecodingOptionsForPicture *options, + Image_AuxiliaryPictureType *desiredAuxiliaryPictures, size_t length); + +/** + * @brief Releases an DecodingOptionsForPicture object. + * + * @param options Indicates a DecodingOptionsForPicture pointer. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options is nullptr. + * @since 12 + */ +Image_ErrorCode OH_DecodingOptionsForPicture_Release(OH_DecodingOptionsForPicture *options); #ifdef __cplusplus }; #endif diff --git a/multimedia/image_framework/include/image/picture_native.h b/multimedia/image_framework/include/image/picture_native.h new file mode 100644 index 000000000..36b012402 --- /dev/null +++ b/multimedia/image_framework/include/image/picture_native.h @@ -0,0 +1,490 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup image + * @{ + * + * @brief Provides APIs for obtaining picture data and information. + * + * @Syscap SystemCapability.Multimedia.Image.Core + * @since 12 + */ + +/** + * @file picture_native.h + * + * @brief Declares the APIs that can access a picture. + * + * @library libpicture.so + * @Syscap SystemCapability.Multimedia.Image.Core + * @since 12 + */ +#ifndef INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PICTURE_NATIVE_H_ +#define INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PICTURE_NATIVE_H_ +#include "image_common.h" +#include "pixelmap_native.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Define a Picture struct type, used for picture pointer controls. + * + * @since 12 + */ +struct OH_PictureNative; + +/** + * @brief Define a Picture struct type, used for picture pointer controls. + * + * @since 12 + */ +typedef struct OH_PictureNative OH_PictureNative; + +/** + * @brief Define a AuxiliaryPicture struct type, used for auxiliary + * picture pointer controls. + * + * @since 12 + */ +struct OH_AuxiliaryPictureNative; + +/** + * @brief Define a AuxiliaryPicture struct type, used for auxiliary + * picture pointer controls. + * + * @since 12 + */ +typedef struct OH_AuxiliaryPictureNative OH_AuxiliaryPictureNative; + +/** + * @brief Define a AuxiliaryPictureInfo struct type, used for auxiliary + * picture info controls. + * + * @since 12 + */ +struct OH_AuxiliaryPictureInfo; + +/** + * @brief Define a AuxiliaryPictureInfo struct type, used for auxiliary + * picture info controls. + * + * @since 12 + */ +typedef struct OH_AuxiliaryPictureInfo OH_AuxiliaryPictureInfo; + +/** + * @brief Define a auxiliary picture type. + * + * @since 12 + */ +typedef enum { + /* + * Gainmap + */ + AUXILIARY_PICTURE_TYPE_GAINMAP = 1, + /* + * Depth map + */ + AUXILIARY_PICTURE_TYPE_DEPTH_MAP = 2, + /* + * Unrefocus map + */ + AUXILIARY_PICTURE_TYPE_UNREFOCUS_MAP = 3, + /* + * Linear map + */ + AUXILIARY_PICTURE_TYPE_LINEAR_MAP = 4, + /* + * Fragment map + */ + AUXILIARY_PICTURE_TYPE_FRAGMENT_MAP = 5, +} Image_AuxiliaryPictureType; + +/** + * @brief Create a Picture object. + * + * @param mainPixelmap The pixel map of the main image. + * @param picture Picture pointer for created. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} mainPixelmap is nullptr, or picture is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_CreatePicture(OH_PixelmapNative *mainPixelmap, OH_PictureNative **picture); + +/** + * @brief Obtains the pixel map of the main image. + * + * @param picture The Picture pointer will be operated. + * @param mainPixelmap Main pixel map pointer for obtained. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or mainPixelmap is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_GetMainPixelmap(OH_PictureNative *picture, OH_PixelmapNative **mainPixelmap); + +/** + * @brief Obtains the hdr pixel map. + * + * @param picture The Picture pointer will be operated. + * @param hdrPixelmap Hdr pixel map pointer for obtained. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or hdrPixelmap is nullptr. + * {@link IMAGE_UNSUPPORTED_OPERATION} Unsupported operation, e.g. the picture does not has a gainmap + * @since 12 + */ +Image_ErrorCode OH_PictureNative_GetHdrComposedPixelmap(OH_PictureNative *picture, OH_PixelmapNative **hdrPixelmap); + +/** + * @brief Obtains the gainmap pixel map. + * + * @param picture The Picture pointer will be operated. + * @param gainmapPixelmap Gainmap pointer for obtained. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or gainmapPixelmap is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_GetGainmapPixelmap(OH_PictureNative *picture, OH_PixelmapNative **gainmapPixelmap); + +/** + * @brief Set auxiliary picture. + * + * @param picture The Picture pointer will be operated. + * @param type The type of auxiliary picture. + * @param auxiliaryPicture AuxiliaryPicture object. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or auxiliaryPicture is nullptr, or the type is invalid. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_SetAuxiliaryPicture(OH_PictureNative *picture, Image_AuxiliaryPictureType type, + OH_AuxiliaryPictureNative *auxiliaryPicture); + +/** + * @brief Obtains the auxiliary picture based on type. + * + * @param picture The Picture pointer will be operated. + * @param type The type of auxiliary picture. + * @param auxiliaryPicture AuxiliaryPicture pointer for obtained. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or auxiliaryPicture is nullptr, or the type is invalid. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_GetAuxiliaryPicture(OH_PictureNative *picture, Image_AuxiliaryPictureType type, + OH_AuxiliaryPictureNative **auxiliaryPicture); + +/** + * @brief Obtains the metadata of main picture. + * + * @param picture The Picture pointer will be operated. + * @param metadataType The type of metadata. + * @param metadata The metadata of main picture. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or metadata is nullptr. + * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_GetMetadata(OH_PictureNative *picture, Image_MetadataType metadataType, + OH_PictureMetadata **metadata); + +/** + * @brief Set main picture metadata. + * + * @param picture The Picture pointer will be operated. + * @param metadataType The type of metadata. + * @param metadata The metadata will be set. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or metadata is nullptr. + * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_SetMetadata(OH_PictureNative *picture, Image_MetadataType metadataType, + OH_PictureMetadata *metadata); + +/** + * @brief Releases this Picture object. + * + * @param picture The Picture pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PictureNative_Release(OH_PictureNative *picture); + +/** + * @brief Create a AuxiliaryPicture object. + * + * @param data The image data buffer. + * @param dataLength The length of data. + * @param size The size of auxiliary picture. + * @param type The type of auxiliary picture. + * @param auxiliaryPicture AuxiliaryPicture pointer for created. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} data is nullptr, or dataLength is invalid, or size is nullptr, or the type + * is invalid, or auxiliaryPicture is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_Create(uint8_t *data, size_t dataLength, Image_Size *size, + Image_AuxiliaryPictureType type, OH_AuxiliaryPictureNative **auxiliaryPicture); + +/** + * @brief Write pixels to auxiliary picture. + * + * @param auxiliaryPicture The AuxiliaryPicture pointer will be operated. + * @param source The pixels will be written. + * @param bufferSize The size of pixels. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or source is nullptr, or the bufferSize is invalid. + * {@link IMAGE_ALLOC_FAILED} memory alloc failed. + * {@link IMAGE_COPY_FAILED} memory copy failed. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_WritePixels(OH_AuxiliaryPictureNative *auxiliaryPicture, uint8_t *source, + size_t bufferSize); + +/** + * @brief Read pixels from auxiliary picture. + * + * @param auxiliaryPicture The AuxiliaryPicture pointer will be operated. + * @param destination The pixels will be read. + * @param bufferSize The size of pixels for reading. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or destination is nullptr, + * or the bufferSize is invalid. + * {@link IMAGE_ALLOC_FAILED} memory alloc failed. + * {@link IMAGE_COPY_FAILED} memory copy failed. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_ReadPixels(OH_AuxiliaryPictureNative *auxiliaryPicture, uint8_t *destination, + size_t *bufferSize); + +/** + * @brief Obtains the type of auxiliary picture. + * + * @param auxiliaryPicture The AuxiliaryPicture pointer will be operated. + * @param type The type of auxiliary picture. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or type is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_GetType(OH_AuxiliaryPictureNative *auxiliaryPicture, + Image_AuxiliaryPictureType *type); + +/** + * @brief Obtains the info of auxiliary picture. + * + * @param auxiliaryPicture The AuxiliaryPicture pointer will be operated. + * @param info The info of auxiliary picture. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or info is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_GetInfo(OH_AuxiliaryPictureNative *auxiliaryPicture, + OH_AuxiliaryPictureInfo **info); + +/** + * @brief Set auxiliary picture info. + * + * @param auxiliaryPicture The AuxiliaryPicture pointer will be operated. + * @param info The info will be set. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or info is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_SetInfo(OH_AuxiliaryPictureNative *auxiliaryPicture, + OH_AuxiliaryPictureInfo *info); + +/** + * @brief Obtains the metadata of auxiliary picture. + * + * @param auxiliaryPicture The AuxiliaryPicture pointer will be operated. + * @param metadataType The type of metadata. + * @param metadata The metadata of auxiliary picture. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or metadata is nullptr. + * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type, or the metadata type does not match the + * auxiliary picture type. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_GetMetadata(OH_AuxiliaryPictureNative *auxiliaryPicture, + Image_MetadataType metadataType, OH_PictureMetadata **metadata); + +/** + * @brief Set auxiliary picture metadata. + * + * @param auxiliaryPicture The AuxiliaryPicture pointer will be operated. + * @param metadataType The type of metadata. + * @param metadata The metadata will be set. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or metadata is nullptr. + * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type, or the metadata type does not match the + * auxiliary picture type. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_SetMetadata(OH_AuxiliaryPictureNative *auxiliaryPicture, + Image_MetadataType metadataType, OH_PictureMetadata *metadata); + +/** + * @brief Releases this AuxiliaryPicture object. + * + * @param picture The Picture pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} picture is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureNative_Release(OH_AuxiliaryPictureNative *picture); + +/** + * @brief Create a AuxiliaryPictureInfo object. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_Create(OH_AuxiliaryPictureInfo **info); + +/** + * @brief Obtains the type of auxiliary picture info. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param type The type of auxiliary picture info. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr, or type is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_GetType(OH_AuxiliaryPictureInfo *info, Image_AuxiliaryPictureType *type); + +/** + * @brief Set auxiliary picture info type. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param type The type will be set. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr, or type is invalid. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_SetType(OH_AuxiliaryPictureInfo *info, Image_AuxiliaryPictureType type); + +/** + * @brief Obtains the size of auxiliary picture info. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param size The size of auxiliary picture info. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr, or size is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_GetSize(OH_AuxiliaryPictureInfo *info, Image_Size *size); + +/** + * @brief Set auxiliary picture info size. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param size The size will be set. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr, or size is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_SetSize(OH_AuxiliaryPictureInfo *info, Image_Size *size); + +/** + * @brief Obtains the rowStride of auxiliary picture info. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param rowStride The rowStride of auxiliary picture info. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr, or rowStride is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_GetRowStride(OH_AuxiliaryPictureInfo *info, uint32_t *rowStride); + +/** + * @brief Set auxiliary picture info rowStride. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param rowStride The rowStride will be set. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr, or rowStride is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_SetRowStride(OH_AuxiliaryPictureInfo *info, uint32_t rowStride); + +/** + * @brief Obtains the pixelFormat of auxiliary picture info. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param pixelFormat The pixelFormat will be get. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr, or pixelFormat is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_GetPixelFormat(OH_AuxiliaryPictureInfo *info, PIXEL_FORMAT *pixelFormat); + +/** + * @brief Set auxiliary picture info pixelFormat. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @param pixelFormat The pixelFormat will be set. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_SetPixelFormat(OH_AuxiliaryPictureInfo *info, PIXEL_FORMAT pixelFormat); + +/** + * @brief Releases this AuxiliaryPictureInfo object. + * + * @param info The AuxiliaryPictureInfo pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} info is nullptr. + * @since 12 + */ +Image_ErrorCode OH_AuxiliaryPictureInfo_Release(OH_AuxiliaryPictureInfo *info); + +#ifdef __cplusplus +}; +#endif +/** @} */ +#endif //INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PICTURE_NATIVE_H_ \ No newline at end of file diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 5f8be7c78..875bafe5b 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -171,19 +171,19 @@ typedef enum { /** * No metadata. */ - NONE = 0, + HDR_METADATA_TYPE_NONE = 0, /** * Indicates that metadata will be used for the base image. */ - BASE = 1, + HDR_METADATA_TYPE_BASE = 1, /** * Indicates that metadata will be used for the gainmap image. */ - GAINMAP = 2, + HDR_METADATA_TYPE_GAINMAP = 2, /** * Indicates that metadata will be used for the alternate image. */ - ALTERNATE = 3, + HDR_METADATA_TYPE_ALTERNATE = 3, } OH_Pixelmap_HdrMetadataType; /** diff --git a/multimedia/image_framework/libimage_common.ndk.json b/multimedia/image_framework/libimage_common.ndk.json new file mode 100644 index 000000000..9faa63b59 --- /dev/null +++ b/multimedia/image_framework/libimage_common.ndk.json @@ -0,0 +1,22 @@ +[ + { + "first_introduced": "12", + "name": "OH_PictureMetadata_Create" + }, + { + "first_introduced": "12", + "name": "OH_PictureMetadata_GetProperty" + }, + { + "first_introduced": "12", + "name": "OH_PictureMetadata_SetProperty" + }, + { + "first_introduced": "12", + "name": "OH_PictureMetadata_Release" + }, + { + "first_introduced": "12", + "name": "OH_PictureMetadata_Clone" + } +] \ No newline at end of file diff --git a/multimedia/image_framework/libimage_packer.ndk.json b/multimedia/image_framework/libimage_packer.ndk.json index 0b5efcecf..3488cb646 100644 --- a/multimedia/image_framework/libimage_packer.ndk.json +++ b/multimedia/image_framework/libimage_packer.ndk.json @@ -51,6 +51,10 @@ "first_introduced": "12", "name": "OH_ImagePackerNative_PackToDataFromPixelmap" }, + { + "first_introduced": "12", + "name": "OH_ImagePackerNative_PackToDataFromPicture" + }, { "first_introduced": "12", "name": "OH_ImagePackerNative_PackToFileFromImageSource" @@ -59,6 +63,10 @@ "first_introduced": "12", "name": "OH_ImagePackerNative_PackToFileFromPixelmap" }, + { + "first_introduced": "12", + "name": "OH_ImagePackerNative_PackToFileFromPicture" + }, { "first_introduced": "12", "name": "OH_ImagePackerNative_Release" diff --git a/multimedia/image_framework/libimage_source.ndk.json b/multimedia/image_framework/libimage_source.ndk.json index 562ec53ca..133bba8ec 100644 --- a/multimedia/image_framework/libimage_source.ndk.json +++ b/multimedia/image_framework/libimage_source.ndk.json @@ -99,6 +99,10 @@ "first_introduced": "12", "name": "OH_ImageSourceNative_CreatePixelmapList" }, + { + "first_introduced": "12", + "name": "OH_ImageSourceNative_CreatePicture" + }, { "first_introduced": "12", "name": "OH_ImageSourceNative_GetDelayTimeList" @@ -122,5 +126,21 @@ { "first_introduced": "12", "name": "OH_ImageSourceNative_Release" + }, + { + "first_introduced": "12", + "name": "OH_DecodingOptionsForPicture_Create" + }, + { + "first_introduced": "12", + "name": "OH_DecodingOptionsForPicture_GetDesiredAuxiliaryPictures" + }, + { + "first_introduced": "12", + "name": "OH_DecodingOptionsForPicture_SetDesiredAuxiliaryPictures" + }, + { + "first_introduced": "12", + "name": "OH_DecodingOptionsForPicture_Release" } ] \ No newline at end of file diff --git a/multimedia/image_framework/libpicture.ndk.json b/multimedia/image_framework/libpicture.ndk.json new file mode 100644 index 000000000..d74f9c0f2 --- /dev/null +++ b/multimedia/image_framework/libpicture.ndk.json @@ -0,0 +1,114 @@ +[ + { + "first_introduced": "12", + "name": "OH_PictureNative_CreatePicture" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_GetMainPixelmap" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_GetHdrComposedPixelmap" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_GetGainmapPixelmap" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_SetAuxiliaryPicture" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_GetAuxiliaryPicture" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_GetMetadata" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_SetMetadata" + }, + { + "first_introduced": "12", + "name": "OH_PictureNative_Release" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_Create" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_WritePixels" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_ReadPixels" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_GetType" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_GetInfo" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_SetInfo" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_GetMetadata" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_SetMetadata" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureNative_Release" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_Create" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_GetType" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_SetType" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_GetSize" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_SetSize" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_GetRowStride" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_SetRowStride" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_GetPixelFormat" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_SetPixelFormat" + }, + { + "first_introduced": "12", + "name": "OH_AuxiliaryPictureInfo_Release" + } + ] \ No newline at end of file -- Gitee From 72c2a2fe080314b9cc7753542415bdd9c238e1bb Mon Sep 17 00:00:00 2001 From: zhouchaobo Date: Thu, 1 Aug 2024 17:17:07 +0800 Subject: [PATCH 021/620] nested scroll c-api Signed-off-by: zhouchaobo Change-Id: I11c1bc24d0a46992d0d331fb4d897ab192077f66 --- arkui/ace_engine/native/libace.ndk.json | 64 ++++++ arkui/ace_engine/native/native_gesture.h | 259 +++++++++++++++++++++++ arkui/ace_engine/native/native_type.h | 4 + 3 files changed, 327 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 4514347ae..84518c68a 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -247,6 +247,70 @@ "first_introduced": "12", "name": "OH_ArkUI_GestureInterruptInfo_GetSystemRecognizerType" }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GetResponseRecognizersFromInterruptInfo" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_SetGestureRecognizerEnabled" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GetGestureRecognizerEnabled" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GetGestureRecognizerState" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GetGestureEventTargetInfo" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GestureEventTargetInfo_IsScrollBegin" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GestureEventTargetInfo_IsScrollEnd" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GetPanGestureDirectionMask" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_IsBuiltInGesture" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GetGestureTag" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GetGestureBindNodeId" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_IsGestureRecognizerValid" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_ParallelInnerGestureEvent_GetUserData" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_ParallelInnerGestureEvent_GetCurrentRecognizer" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_ParallelInnerGestureEvent_GetConflictRecognizers" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_SetArkUIGestureRecognizerDisposeNotify" + }, { "first_introduced": "12", "name": "OH_NativeXComponent_SetNeedSoftKeyboard" diff --git a/arkui/ace_engine/native/native_gesture.h b/arkui/ace_engine/native/native_gesture.h index 35dac3924..a3df84401 100644 --- a/arkui/ace_engine/native/native_gesture.h +++ b/arkui/ace_engine/native/native_gesture.h @@ -223,6 +223,65 @@ typedef enum { GESTURE_INTERRUPT_RESULT_REJECT, } ArkUI_GestureInterruptResult; +/** + * @brief Enumerates the gesture recognizer states. + * + * @since 12 + */ +typedef enum { + /** Ready. */ + ARKUI_GESTURE_RECOGNIZER_STATE_READY = 0, + + /** Detecting. */ + ARKUI_GESTURE_RECOGNIZER_STATE_DETECTING = 1, + + /** Pending. */ + ARKUI_GESTURE_RECOGNIZER_STATE_PENDING = 2, + + /** Blocked. */ + ARKUI_GESTURE_RECOGNIZER_STATE_BLOCKED = 3, + + /** Successful. */ + ARKUI_GESTURE_RECOGNIZER_STATE_SUCCESSFUL = 4, + + /** Failed. */ + ARKUI_GESTURE_RECOGNIZER_STATE_FAILED = 5, +} ArkUI_GestureRecognizerState; + +/** + * @brief Defines the gesture recognizer handle. + * + * @since 12 + */ +typedef ArkUI_GestureRecognizer* ArkUI_GestureRecognizerHandle; + +/** + * @brief Defines the gesture recognizer handle array. + * + * @since 12 + */ +typedef ArkUI_GestureRecognizerHandle* ArkUI_GestureRecognizerHandleArray; + +/** + * @brief Defines a GestureEventTargetInfo object that provides information about a gesture event target. + * + * @since 12 + */ +typedef struct ArkUI_GestureEventTargetInfo ArkUI_GestureEventTargetInfo; + +/** + * @brief Defines a parallel internal gesture event. + * + * @since 12 + */ +typedef struct ArkUI_ParallelInnerGestureEvent ArkUI_ParallelInnerGestureEvent; + +/** + * @brief Defines a callback function for notifying gesture recognizer destruction. + * @since 12 + */ +typedef void (*ArkUI_GestureRecognizerDisposeNotifyCallback)(ArkUI_GestureRecognizer* recognizer, void* userData); + /** * @brief Checks whether a gesture is a built-in gesture of the component. * @@ -408,6 +467,191 @@ float OH_ArkUI_PinchGesture_GetCenterY(const ArkUI_GestureEvent* event); * @since 12 */ ArkUI_NodeHandle OH_ArkUI_GestureEvent_GetNode(const ArkUI_GestureEvent* event); + +/** +* @brief Obtains information about a gesture response chain. +* +* @param event Indicates the pointer to the gesture interruption information. +* @param responseChain Indicates the pointer to an array of gesture recognizers on the response chain. +* @param count Indicates the pointer to the number of gesture recognizers on the response chain. +* @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. +* @since 12 +*/ +int32_t OH_ArkUI_GetResponseRecognizersFromInterruptInfo(const ArkUI_GestureInterruptInfo* event, + ArkUI_GestureRecognizerHandleArray* responseChain, int32_t* count); + +/** +* @brief Sets the enabled state of a gesture recognizer. +* +* @param recognizer Indicates the pointer to a gesture recognizer. +* @param enabled Indicates the enabled state. +* @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. +* @since 12 +*/ +int32_t OH_ArkUI_SetGestureRecognizerEnabled(ArkUI_GestureRecognizer* recognizer, bool enabled); + +/** +* @brief Obtains the enabled state of a gesture recognizer. +* +* @param recognizer Indicates the pointer to a gesture recognizer. +* @return Returns true if the gesture recognizer is enabled. +* Returns false if the gesture recognizer is disabled. +* @since 12 +*/ +bool OH_ArkUI_GetGestureRecognizerEnabled(ArkUI_GestureRecognizer* recognizer); + +/** +* @brief Obtains the state of a gesture recognizer. +* +* @param recognizer Indicates the pointer to a gesture recognizer. +* @param state Indicates the pointer to the state of the gesture recognizer. +* @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. +* @since 12 +*/ +int32_t OH_ArkUI_GetGestureRecognizerState(ArkUI_GestureRecognizer* recognizer, ArkUI_GestureRecognizerState* state); + +/** +* @brief Obtains the information about a gesture event target. +* +* @param recognizer Indicates the pointer to a gesture recognizer. +* @param info Indicates the information about a gesture event target. +* @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. +* @since 12 +*/ +int32_t OH_ArkUI_GetGestureEventTargetInfo(ArkUI_GestureRecognizer* recognizer, ArkUI_GestureEventTargetInfo** info); + +/** +* @brief Obtains whether this scroll container is scrolled to the top. +* +* @param info Indicates the information about a gesture event target. +* @param ret Indicates whether the scroll container is scrolled to the top. +* @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. +* Returns {@link ARKUI_ERROR_CODE_NON_SCROLLABLE_CONTAINER} if the component is not a scroll container. +* @since 12 +*/ +int32_t OH_ArkUI_GestureEventTargetInfo_IsScrollBegin(ArkUI_GestureEventTargetInfo* info, bool* ret); + +/** +* @brief Obtains whether this scroll container is scrolled to the bottom. +* +* @param info Indicates the information about a gesture event target. +* @param ret Indicates whether the scroll container is scrolled to the bottom. +* @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. +* Returns {@link ARKUI_ERROR_CODE_NON_SCROLLABLE_CONTAINER} if the component is not a scroll container. +* @since 12 +*/ +int32_t OH_ArkUI_GestureEventTargetInfo_IsScrollEnd(ArkUI_GestureEventTargetInfo* info, bool* ret); + +/** +* @brief Obtains the direction of a pan gesture. +* +* @param recognizer Indicates the pointer to a gesture recognizer. +* @param directionMask Indicates the pan direction. +* @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. +* @since 12 +*/ +int32_t OH_ArkUI_GetPanGestureDirectionMask(ArkUI_GestureRecognizer* recognizer, + ArkUI_GestureDirectionMask* directionMask); + +/** +* @brief Obtains whether a gesture is a built-in gesture. +* +* @param recognizer Indicates the pointer to a gesture recognizer. +* @return Returns true if the gesture is a built-in gesture; returns false otherwise. +* @since 12 +*/ +bool OH_ArkUI_IsBuiltInGesture(ArkUI_GestureRecognizer* recognizer); + +/** +* @brief Obtains the tag of a gesture recognizer. +* +* @param recognizer Indicates the pointer to a gesture recognizer. +* @param buffer Indicates the buffer. +* @param bufferSize Indicates the buffer size. +* @param result Indicates the length of the string to be written to the buffer. +* @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. +* Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH} if the buffer is not large enough. +* @since 12 +*/ +int32_t OH_ArkUI_GetGestureTag(ArkUI_GestureRecognizer* recognizer, char* buffer, int32_t bufferSize, int32_t* result); + +/** +* @brief Obtains the ID of the component linked to a gesture recognizer. +* +* @param recognizer Indicates the pointer to a gesture recognizer. +* @param nodeId Indicates the component ID. +* @param size Indicates the buffer size. +* @param result Indicates the length of the string to be written to the buffer. +* @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. +* Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH} if the buffer is not large enough. +* @since 12 +*/ +int32_t OH_ArkUI_GetGestureBindNodeId(ArkUI_GestureRecognizer* recognizer, char* nodeId, int32_t size, + int32_t* result); + +/** +* @brief Obtains whether a gesture recognizer is valid. +* +* @param recognizer Indicates the pointer to a gesture recognizer. +* @return Returns true if the gesture recognizer is valid. +* Returns false if the gesture recognizer is invalid. +* @since 12 +*/ +bool OH_ArkUI_IsGestureRecognizerValid(ArkUI_GestureRecognizer* recognizer); + +/** +* @brief Obtains custom data in the parallel internal gesture event. +* +* @param event Indicates the pointer to a parallel internal gesture event. +* @return Returns the pointer to custom data. +* @since 12 +*/ +void* OH_ArkUI_ParallelInnerGestureEvent_GetUserData(ArkUI_ParallelInnerGestureEvent* event); + +/** +* @brief Obtains the current gesture recognizer in a parallel internal gesture event. +* +* @param event Indicates the pointer to a parallel internal gesture event. +* @return Returns the pointer to the current gesture recognizer. +* @since 12 +*/ +ArkUI_GestureRecognizer* OH_ArkUI_ParallelInnerGestureEvent_GetCurrentRecognizer( + ArkUI_ParallelInnerGestureEvent* event); + +/** +* @brief Obtains the conflicting gesture recognizers in a parallel internal gesture event. +* +* @param event Indicates the pointer to a parallel internal gesture event. +* @param array Indicates the pointer to the array of conflicting gesture recognizers. +* @param size Indicates the size of the array of conflicting gesture recognizers. +* @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. +* @since 12 +*/ +int32_t OH_ArkUI_ParallelInnerGestureEvent_GetConflictRecognizers(ArkUI_ParallelInnerGestureEvent* event, + ArkUI_GestureRecognizerHandleArray* array, int32_t* size); + +/** +* @brief Sets a callback function for notifying gesture recognizer destruction. +* +* @param recognizer Indicates the pointer to a gesture recognizer. +* @param callback Indicates the callback function for notifying gesture recognizer destruction. +* @param userData Indicates the custom data. +* @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. +*/ +int32_t OH_ArkUI_SetArkUIGestureRecognizerDisposeNotify(ArkUI_GestureRecognizer* recognizer, + ArkUI_GestureRecognizerDisposeNotifyCallback callback, void* userData); + /** * @brief Defines the gesture APIs. * @@ -625,6 +869,21 @@ typedef struct { * @return Returns the gesture type. */ ArkUI_GestureRecognizerType (*getGestureType)(ArkUI_GestureRecognizer* recognizer); + + /** + * @brief Sets the callback function for a parallel internal gesture event. + * + * @param node Indicates the ArkUI node for which the callback of a parallel internal gesture event is to be set. + * @param userData Indicates the custom data. + * @param parallelInnerGesture Indicates the parallel internal gesture event. event returns the data of the + * parallel internal gesture event; parallelInnerGesture returns the pointer to the gesture recognizer + * that requires parallel recognition. + * @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + */ + int32_t (*setInnerGestureParallelTo)( + ArkUI_NodeHandle node, void* userData, ArkUI_GestureRecognizer* (*parallelInnerGesture)( + ArkUI_ParallelInnerGestureEvent* event)); } ArkUI_NativeGestureAPI_1; #ifdef __cplusplus diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index f238b1d6f..027726845 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -1895,6 +1895,10 @@ typedef enum { ARKUI_ERROR_CODE_GET_INFO_FAILED = 106201, /** The buffer size is not large enough. */ ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR = 106202, + /** The component is not a scroll container. */ + ARKUI_ERROR_CODE_NON_SCROLLABLE_CONTAINER = 180001, + /** The buffer is not large enough. */ + ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH = 180002, } ArkUI_ErrorCode; /** -- Gitee From efe13930c7f399109a6fe4aa5885c6fe3de145af Mon Sep 17 00:00:00 2001 From: wanglili12 Date: Tue, 6 Aug 2024 10:23:57 +0800 Subject: [PATCH 022/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9NODE=5FCLIP=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanglili12 Change-Id: Ie666ac9b20638c0be450f8605debeaccab4eacc1 --- arkui/ace_engine/native/native_node.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 2f9a9588d..2e82b4138 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -496,15 +496,16 @@ typedef enum { */ NODE_VISIBILITY, /** - * @brief Defines the clip attribute, which can be set, reset, and obtained as required through APIs. + * @brief Defines the clipping and masking attribute, which can be set, reset, and obtained as required through + * APIs. * * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n * .value[0].i32: whether to clip the component based on the parent container bounds. - * The value 0 means to clip the component, and 1 means the opposite. \n + * The value 1 means to clip the component, and 0 means the opposite. \n * \n * Format of the return value {@link ArkUI_AttributeItem}:\n * .value[0].i32: whether to clip the component based on the parent container bounds. - * The value 0 means to clip the component, and 1 means the opposite. \n + * The value 1 means to clip the component, and 0 means the opposite. \n * */ NODE_CLIP, -- Gitee From acf56aefd7075a7e11c1df9a664cb723c3b7a2be Mon Sep 17 00:00:00 2001 From: qihaonan Date: Tue, 6 Aug 2024 07:13:12 +0000 Subject: [PATCH 023/620] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=E6=96=B0=E5=A2=9E=E5=88=86=E5=B1=82=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E5=9D=87=E5=8C=80=E5=88=86=E5=B1=82=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qihaonan --- multimedia/av_codec/native_avcodec_base.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index c5e35031c..cdaeeed55 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1198,6 +1198,9 @@ typedef enum OH_TemporalGopReferenceMode { ADJACENT_REFERENCE = 0, /** Refer to latest long-term reference frame. */ JUMP_REFERENCE = 1, + /** Uniformly scaled reference structure, which has even distribution of video frames after drop the highest + * enhance layer. The temporal group of pictures must be power of 2. */ + UNIFORMLY_SCALED_REFERENCE = 2, } OH_TemporalGopReferenceMode; #ifdef __cplusplus -- Gitee From 2224725499b3afecd071adcadd16814dc56c2694 Mon Sep 17 00:00:00 2001 From: zhangwuf Date: Mon, 5 Aug 2024 16:13:32 +0800 Subject: [PATCH 024/620] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E6=95=B0=E6=8D=AE=E4=B8=89=E6=96=B9=E5=BA=93?= =?UTF-8?q?=E3=80=81=E5=BC=80=E6=BA=90/=E9=97=AD=E6=BA=90=E5=88=86?= =?UTF-8?q?=E6=88=90=E4=B8=A4=E5=88=97=EF=BC=8Cdiff=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E5=90=8C=E7=90=86=EF=BC=9B=E5=85=B6=E6=AC=A1diff=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=BB=93=E6=9E=9Capi=E7=B1=BB=E5=9E=8B=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E8=8A=82=E7=82=B9=E7=B1=BB=E5=9E=8B=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=9F=E6=88=90=E8=AF=AD=E6=B3=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E6=96=87=E4=BB=B6=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangwuf --- .../capi_parser/src/coreImpl/diff/diff.py | 4 +- .../src/coreImpl/diff/diff_file.py | 101 ++++++++++++++---- .../src/coreImpl/diff/diff_processor_node.py | 84 +++++++++++---- .../src/coreImpl/parser/generating_tables.py | 9 +- .../src/coreImpl/parser/parse_include.py | 74 +++++++++++-- .../capi_parser/src/coreImpl/parser/parser.py | 38 +++---- .../capi_parser/src/typedef/diff/diff.py | 65 +++++++++++ .../capi_parser/src/utils/constants.py | 14 +-- 8 files changed, 309 insertions(+), 80 deletions(-) diff --git a/build-tools/capi_parser/src/coreImpl/diff/diff.py b/build-tools/capi_parser/src/coreImpl/diff/diff.py index 43f15d2ca..375f7ab94 100644 --- a/build-tools/capi_parser/src/coreImpl/diff/diff.py +++ b/build-tools/capi_parser/src/coreImpl/diff/diff.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from coreImpl.parser.parser import parser_include_ast +from coreImpl.parser.parser import diff_parser_include_ast from coreImpl.diff.diff_file import start_diff_file @@ -42,5 +42,5 @@ def process_file_diff(old_file, new_file): def get_parser_data(file_path): root_start = file_path.split('sdk_c')[0] root_path = f'{root_start}sdk_c' - parser_data = parser_include_ast(root_path, [file_path]) + parser_data = diff_parser_include_ast(root_path, [file_path]) return parser_data diff --git a/build-tools/capi_parser/src/coreImpl/diff/diff_file.py b/build-tools/capi_parser/src/coreImpl/diff/diff_file.py index 0635db772..2c4c0fb16 100644 --- a/build-tools/capi_parser/src/coreImpl/diff/diff_file.py +++ b/build-tools/capi_parser/src/coreImpl/diff/diff_file.py @@ -19,14 +19,15 @@ import os import stat from collections import OrderedDict import openpyxl as op -from coreImpl.parser.parser import parser_include_ast +from coreImpl.parser.parser import diff_parser_include_ast from coreImpl.diff.diff_processor_node import judgment_entrance, change_data_total -from typedef.diff.diff import OutputJson, ApiChangeData +from typedef.diff.diff import OutputJson, ApiChangeData, IgnoreFileDirectory from bin.write_md import write_md_entrance global_old_dir = '' global_new_dir = '' diff_info_list = [] +syntax_file_list = [] def get_modification_type_dict(): @@ -67,13 +68,15 @@ def get_api_change_obj(api_data): change_data_obj.set_kit_name(element.kit_name) change_data_obj.set_sub_system(element.sub_system) change_data_obj.set_is_api_change(element.is_api_change) - change_data_obj.set_class_name(element.class_name) + change_data_obj.set_current_api_type(element.current_api_type) change_data_obj.set_diff_type(element.operation_diff_type) change_data_obj.set_change_type(element.api_modification_type) change_data_obj.set_old_all_text(element.old_api_full_text) change_data_obj.set_new_all_text(element.new_api_full_text) change_data_obj.set_compatible_total(element.is_compatible) change_data_obj.set_is_system_api(element.is_system_api) + change_data_obj.set_open_close_api(element.open_close_api) + change_data_obj.set_is_third_party_api(element.is_third_party_api) key = 1 else: old_all_text = '{}#&#{}'.format(change_data_obj.old_all_text, element.old_api_full_text) @@ -120,7 +123,7 @@ def collect_node_api_change(api_change_info_list): api_change_info.kit_name, api_change_info.sub_system, api_change_info.is_api_change, - api_change_info.class_name, + api_change_info.current_api_type, api_change_info.diff_type, api_change_info.change_type, api_change_info.compatible, @@ -129,18 +132,42 @@ def collect_node_api_change(api_change_info_list): api_change_info.new_all_text, api_change_info.compatible_total, api_change_info.unique_id, - api_change_info.is_system_api + api_change_info.is_system_api, + api_change_info.open_close_api, + api_change_info.is_third_party_api ] change_data.append(info_data) return change_data +def syntax_file_excel(output_path): + data = [] + if syntax_file_list: + for syntax_dict in syntax_file_list: + info_data = [ + syntax_dict.get('current_file'), + syntax_dict.get('error_message') + ] + data.append(info_data) + + wb = op.Workbook() + ws = wb['Sheet'] + ws.title = '语法错误文件信息' + ws.append(['当前文件', '错误信息']) + for element in data: + d = element[0], element[1] + ws.append(d) + output_path_xlsx = os.path.abspath(os.path.join(output_path, r'syntax_file_error.xlsx')) + wb.save(output_path_xlsx) + + def start_diff_file(old_dir, new_dir, output_path): result_info_list = global_assignment(old_dir, new_dir) total = change_data_total collect_api_change_data = collect_api_change(total) generate_excel(result_info_list, collect_api_change_data, output_path) + syntax_file_excel(output_path) write_md_entrance(result_info_list, output_path) result_json = result_to_json(result_info_list) diff_result_path = r'./diff_result.txt' @@ -179,11 +206,11 @@ def generate_excel(result_info_list, api_change_data, output_path): ws_of_change = wb.create_sheet('api变更次数统计') ws_of_change.append(['api名称', 'kit名称', '归属子系统', '是否是api', 'api类型', '操作标记', '变更类型', '兼容性', '变更次数', '差异项-旧版本', '差异项-新版本', '兼容性列表', '接口全路径', - '是否为系统API']) + '是否为系统API', '开源/闭源API', '是否是三方库api']) for element in change_data_list: change_data = element[0], element[1], element[2], element[3], element[4], element[5],\ element[6], element[7], element[8], element[9], element[10], element[11],\ - element[12], element[13] + element[12], element[13], element[14], element[15] ws_of_change.append(change_data) output_path_xlsx = os.path.abspath(os.path.join(output_path, 'diff.xlsx')) wb.save(output_path_xlsx) @@ -224,6 +251,14 @@ def get_file_ext(file_name): return os.path.splitext(file_name)[1] +def filter_ignore_file(file_path): + ignore_dict = IgnoreFileDirectory.ignore_file_dict + for key in ignore_dict.keys(): + if key in file_path: + return False + return True + + def diff_list(old_file_list, new_file_list, old_dir, new_dir): all_list = set(old_file_list + new_file_list) if len(all_list) == 0: @@ -246,8 +281,8 @@ def diff_list(old_file_list, new_file_list, old_dir, new_dir): def add_new_file(diff_file_path): if os.path.isdir(diff_file_path): add_file(diff_file_path) - else: - result_map = parse_file_result(parser_include_ast(global_new_dir, [diff_file_path], flag=1)) + elif filter_ignore_file(diff_file_path): + result_map = parse_file_result(diff_parser_include_ast(global_new_dir, [diff_file_path], flag=1)) for new_info in result_map.values(): diff_info_list.extend(judgment_entrance(None, new_info)) @@ -255,8 +290,8 @@ def add_new_file(diff_file_path): def del_old_file(diff_file_path): if os.path.isdir(diff_file_path): del_file(diff_file_path) - else: - result_map = parse_file_result(parser_include_ast(global_old_dir, [diff_file_path], flag=0)) + elif filter_ignore_file(diff_file_path): + result_map = parse_file_result(diff_parser_include_ast(global_old_dir, [diff_file_path], flag=0)) for old_info in result_map.values(): diff_info_list.extend(judgment_entrance(old_info, None)) @@ -278,12 +313,14 @@ def get_same_file_diff(target_file, old_file_list, new_file_list, old_dir, new_d def get_file_result_diff(old_target_file, new_target_file): - old_file_result_map = parse_file_result(parser_include_ast(global_old_dir, [old_target_file], flag=0)) - new_file_result_map = parse_file_result(parser_include_ast(global_new_dir, [new_target_file], flag=1)) - merged_dict = OrderedDict(list(old_file_result_map.items()) + list(new_file_result_map.items())) - all_key_list = merged_dict.keys() - for key in all_key_list: - diff_info_list.extend(judgment_entrance(old_file_result_map.get(key), new_file_result_map.get(key))) + if filter_ignore_file(old_target_file): + old_file_result_map = parse_file_result(diff_parser_include_ast(global_old_dir, [old_target_file], flag=0)) + new_file_result_map = parse_file_result(diff_parser_include_ast(global_new_dir, [new_target_file], flag=1)) + if old_file_result_map and new_file_result_map: + merged_dict = OrderedDict(list(old_file_result_map.items()) + list(new_file_result_map.items())) + all_key_list = merged_dict.keys() + for key in all_key_list: + diff_info_list.extend(judgment_entrance(old_file_result_map.get(key), new_file_result_map.get(key))) def del_file(dir_path): @@ -294,8 +331,8 @@ def del_file(dir_path): file_path = os.path.join(dir_path, i) if os.path.isdir(file_path): del_file(file_path) - if get_file_ext(i) == '.h': - result_map = parse_file_result(parser_include_ast(global_old_dir, [file_path], flag=0)) + if get_file_ext(i) == '.h' and filter_ignore_file(file_path): + result_map = parse_file_result(diff_parser_include_ast(global_old_dir, [file_path], flag=0)) for old_info in result_map.values(): diff_info_list.extend(judgment_entrance(old_info, None)) @@ -308,8 +345,8 @@ def add_file(dir_path): file_path = os.path.join(dir_path, i) if os.path.isdir(file_path): add_file(file_path) - if get_file_ext(i) == '.h': - result_map = parse_file_result(parser_include_ast(global_new_dir, [file_path], flag=1)) + if get_file_ext(i) == '.h' and filter_ignore_file(file_path): + result_map = parse_file_result(diff_parser_include_ast(global_new_dir, [file_path], flag=1)) for new_info in result_map.values(): diff_info_list.extend(judgment_entrance(None, new_info)) @@ -322,16 +359,36 @@ def parse_file_result(result, data_type=0): """ result_map = {} for root_node in result: + if root_node['syntax_error'] != 'NA': + error_file_path = os.path.abspath(os.path.join(root_node['gn_path'], root_node['name'])) + error_message_dict = { + 'current_file': error_file_path, + 'error_message': root_node['syntax_error'] + } + syntax_file_list.append(error_message_dict) + result_map.setdefault(f'{root_node["name"]}-{root_node["kind"]}', root_node) if data_type != 1: parse_file_result_by_child(result_map, root_node) - result_map.setdefault(f'{root_node["name"]}-{root_node["kind"]}', root_node) return result_map +def process_empty_name(data_info: dict, result_map): + data_current_file = os.path.split(data_info['location']['location_path'])[1] + if data_info['kind'] == 'ENUM_DECL' and 'members' in data_info and data_current_file in data_info['type']: + for element in data_info['members']: + result_map.setdefault(f'{data_current_file}-{element["name"]}', element) + elif data_info['kind'] == 'ENUM_DECL' and 'members' in data_info and (data_current_file not in data_info['type']): + result_map.setdefault(f'{data_current_file}-{data_info["type"]}', data_info) + elif (data_info['kind'] == 'STRUCT_DECL' or data_info['kind'] == 'UNION_DECL') and \ + (data_current_file not in data_info['type']): + result_map.setdefault(f'{data_current_file}-{data_info["type"]}', data_info) + + def parse_file_result_by_child(result_map, root_node): children_list = root_node['children'] for children in children_list: if children["name"] == '': + process_empty_name(children, result_map) continue result_map.setdefault(f'{children["name"]}-{children["kind"]}', children) del root_node['children'] diff --git a/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py b/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py index a0deb5b43..c4c1b6a3a 100644 --- a/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py +++ b/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py @@ -749,6 +749,27 @@ def process_typedef_child(old_child, new_child, diff_typedef_list): diff_typedef_list.extend(special_data) +def process_anonymous_enum_member(old_info, new_info): + result_obj_list = [] + if old_info and new_info: + if old_info['name'] != new_info['name']: + change_message_obj = DiffInfo(DiffType.ENUM_MEMBER_NAME_CHANGE, old_info['name'], new_info['name']) + result_obj_list.append(wrap_diff_info(old_info, new_info, change_message_obj)) + if old_info['value'] != new_info['value']: + change_message_obj = DiffInfo(DiffType.ENUM_MEMBER_VALUE_CHANGE, old_info['value'], new_info['value']) + result_obj_list.append(wrap_diff_info(old_info, new_info, change_message_obj)) + else: + if old_info: + change_message_obj = DiffInfo(DiffType.ENUM_MEMBER_REDUCE, old_info['node_content']['content'], 'NA') + result_obj_list.append(wrap_diff_info(old_info, new_info, change_message_obj)) + + elif new_info: + change_message_obj = DiffInfo(DiffType.ENUM_MEMBER_ADD, 'NA', new_info['node_content']['content']) + result_obj_list.append(wrap_diff_info(old_info, new_info, change_message_obj)) + + return result_obj_list + + process_data = { Scene.FUNCTION_DECL.value: process_function, Scene.MACRO_DEFINITION.value: process_define, @@ -756,14 +777,38 @@ process_data = { Scene.UNION_DECL.value: process_union, Scene.ENUM_DECL.value: process_enum, Scene.VAR_DECL.value: process_variable_const, - Scene.TYPEDEF_DECL.value: process_typedef + Scene.TYPEDEF_DECL.value: process_typedef, + Scene.ENUM_CONSTANT_DECL.value: process_anonymous_enum_member, } +def get_ch_api_kind(dict_key): + if dict_key == Scene.ENUM_CONSTANT_DECL.value: + key = 'ENUM_DECL' + else: + key = dict_key + api_kind_dict = { + 'FUNCTION_DECL': '函数类型', + 'MACRO_DEFINITION': '宏定义类型', + 'STRUCT_DECL': '结构体类型', + 'UNION_DECL': '联合体类型', + 'ENUM_DECL': '枚举类型', + 'VAR_DECL': '常/变量类型', + 'TYPEDEF_DECL': '重命名类型', + 'TRANSLATION_UNIT': 'NA' + } + return api_kind_dict.get(key) + + def collect_change_data_total(data: dict, diff_info_list): for element in diff_info_list: element.set_api_node_name(data['name']) + if (data['kind'] == Scene.STRUCT_DECL.value or data['kind'] == Scene.UNION_DECL.value) and (not data['name']): + element.set_api_node_name(data['type']) element.set_current_api_unique_id(data['unique_id']) + element.set_open_close_api(data['open_close_api']) + element.set_is_third_party_api(data['is_third_party_api']) + element.set_current_api_type(get_ch_api_kind(data['kind'])) change_data_total.append(diff_info_list) @@ -780,17 +825,18 @@ def process_add_node(add_infor, key_extern, struct_union_enum): return diff_info_list if 'is_extern' in add_infor and add_infor['is_extern']: key_extern = True - diff_type = DiffType.ADD_API - old_api_content = 'NA' - if add_infor['kind'] in struct_union_enum: - new_api_content = add_infor['type'] + if add_infor['kind'] == Scene.ENUM_CONSTANT_DECL.value: + result_obj_list = process_anonymous_enum_member(old_infor, add_infor) + diff_info_list.extend(result_obj_list) else: - new_api_content = add_infor['node_content']['content'] - diff_info_list.append(wrap_diff_info(old_infor, add_infor, DiffInfo(diff_type, - old_api_content, new_api_content))) - if diff_type == DiffType.ADD_API: - set_is_api_change_result(diff_info_list, key_extern) - collect_change_data_total(add_infor, diff_info_list) + if add_infor['kind'] in struct_union_enum: + new_api_content = add_infor['type'] + else: + new_api_content = add_infor['node_content']['content'] + diff_info_list.append(wrap_diff_info(old_infor, add_infor, DiffInfo(DiffType.ADD_API, + 'NA', new_api_content))) + set_is_api_change_result(diff_info_list, key_extern) + collect_change_data_total(add_infor, diff_info_list) return diff_info_list @@ -802,14 +848,16 @@ def process_reduce_node(reduce_infor, key_extern, struct_union_enum): return diff_info_list if 'is_extern' in reduce_infor and reduce_infor['is_extern']: key_extern = True - diff_type = DiffType.REDUCE_API - new_api_content = 'NA' - if reduce_infor['kind'] in struct_union_enum: - old_api_content = reduce_infor['type'] + if reduce_infor['kind'] == Scene.ENUM_CONSTANT_DECL.value: + result_obj_list = process_anonymous_enum_member(reduce_infor, new_infor) + diff_info_list.extend(result_obj_list) else: - old_api_content = reduce_infor['node_content']['content'] - diff_info_list.append(wrap_diff_info(reduce_infor, new_infor, DiffInfo(diff_type, - old_api_content, new_api_content))) + if reduce_infor['kind'] in struct_union_enum: + old_api_content = reduce_infor['type'] + else: + old_api_content = reduce_infor['node_content']['content'] + diff_info_list.append(wrap_diff_info(reduce_infor, new_infor, DiffInfo(DiffType.REDUCE_API, + old_api_content, 'NA'))) set_is_api_change_result(diff_info_list, key_extern) collect_change_data_total(reduce_infor, diff_info_list) diff --git a/build-tools/capi_parser/src/coreImpl/parser/generating_tables.py b/build-tools/capi_parser/src/coreImpl/parser/generating_tables.py index 158d76bb8..e109bfe95 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/generating_tables.py +++ b/build-tools/capi_parser/src/coreImpl/parser/generating_tables.py @@ -85,8 +85,6 @@ def get_result_api(file_data, result_api): if 'children' in file_data: for item1 in file_data["children"]: # 抛开根节点 if (item1["kind"] == 'FUNCTION_DECL' or item1["kind"] == 'VAR_DECL') and item1["is_extern"]: - differ_infor = difference_api(item1) - item1['differ_infor'] = differ_infor item = filter_func(item1) result_api.append(item) @@ -151,7 +149,8 @@ def collated_api_data(api_data: list): api.get('location_path'), api.get('sub_system'), api.get('unique_id'), - api.get('differ_infor') + api.get('open_close_api'), + api.get('is_third_party_api') ] collated_data_total.append(collated_data) return collated_data_total @@ -161,7 +160,7 @@ def generate_excel(array, name, generate_json_unique, original_json_unique): first_line_infor = ['模块名', '类名', '方法名', '函数', '类型', '起始版本', '废弃版本', 'syscap', '错误码', '是否为系统API', '模型限制', '权限', '是否支持跨平台', '是否支持卡片应用', '是否支持高阶API', - '装饰器', 'kit', '文件路径', '子系统', '接口全路径', '开源/闭源/三方库API'] + '装饰器', 'kit', '文件路径', '子系统', '接口全路径', '开源/闭源API', '是否是三方库API'] workbook = openpyxl.Workbook() work_sheet1 = workbook.active work_sheet1.title = '对比结果' @@ -184,7 +183,7 @@ def write_information_to_worksheet(work_sheet, information_data): write_data = data[0], data[1], data[2], data[3], data[4], \ data[5], data[6], data[7], data[8], data[9], \ data[10], data[11], data[12], data[13], data[14], \ - data[15], data[16], data[17], data[18], data[19], data[20] + data[15], data[16], data[17], data[18], data[19], data[20], data[21] work_sheet.append(write_data) diff --git a/build-tools/capi_parser/src/coreImpl/parser/parse_include.py b/build-tools/capi_parser/src/coreImpl/parser/parse_include.py index a067d98af..446ddfc8d 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/parse_include.py +++ b/build-tools/capi_parser/src/coreImpl/parser/parse_include.py @@ -25,7 +25,7 @@ from clang.cindex import CursorKind from clang.cindex import TypeKind from utils.constants import StringConstant from utils.constants import RegularExpressions -from typedef.parser.parser import NodeKind +from typedef.parser.parser import NodeKind, DifferApiInfor, DifferApiRegular line_dist = {} @@ -149,13 +149,26 @@ def processing_def(cursor, data): # 处理宏定义 print('mar_define error, its content is none') if text: text = text.strip() # 删除两边的字符(默认是删除左右空格) - data['text'] = text + data['text'] = text data["type"] = "def_no_type" +def difference_api(api_data: dict): + api_name = api_data['name'] + closed_pattern = DifferApiRegular.CLOSED_SOURCE_API_REGULAR.value + open_pattern = DifferApiRegular.OPEN_SOURCE_API_REGULAR.value + if re.search(closed_pattern, api_name, flags=re.IGNORECASE): + api_data['open_close_api'] = DifferApiInfor.CLOSED_SOURCE_API.value + elif re.search(open_pattern, api_name, flags=re.IGNORECASE): + api_data['open_close_api'] = DifferApiInfor.OPEN_SOURCE_API.value + else: + api_data['is_third_party_api'] = True + + def processing_func(cursor, data): # 处理函数 data["return_type"] = cursor.result_type.spelling # 增加返回类型键值对 judgment_extern(cursor, data) + difference_api(data) def processing_type(cursor, data): # 没有类型的节点处理 @@ -197,6 +210,12 @@ special_node_process = { } +def process_members_class_name(data: dict, parent_cursor): + file_name = os.path.split(data['location']['location_path'])[1] + if (not data['name']) and (file_name not in parent_cursor.type.spelling): + data['class_name'] = '{}-{}'.format(file_name, parent_cursor.type.spelling) + + def get_api_unique_id(cursor, loc, data): unique_id = '' if cursor.kind == CursorKind.MACRO_DEFINITION: @@ -213,7 +232,7 @@ def get_api_unique_id(cursor, loc, data): parent_name_str = '' elif parent_of_cursor.kind.name in struct_union_enum: parent_name_str = parent_of_cursor.type.spelling - data['class_name'] = parent_of_cursor.spelling + process_members_class_name(data, parent_of_cursor) else: parent_name_str = parent_of_cursor.spelling except ValueError: @@ -227,6 +246,20 @@ def get_api_unique_id(cursor, loc, data): return unique_id +def get_node_class_name(data): + struct_union_enum = [NodeKind.STRUCT_DECL.value, NodeKind.UNION_DECL.value, + NodeKind.ENUM_DECL.value] + current_file_name = os.path.split(data["location"]["location_path"])[1] + if data.get('kind') in struct_union_enum and 'class_name' in data: + class_name = '{}-{}'.format(current_file_name, data["name"]) + if (not data["name"]) and (current_file_name not in data["type"]): + class_name = '{}-{}'.format(current_file_name, data["type"]) + else: + class_name = current_file_name + + return class_name + + def processing_special_node(cursor, data, key, gn_path): # 处理需要特殊处理的节点 if key == 0: location_path = cursor.spelling @@ -244,9 +277,12 @@ def processing_special_node(cursor, data, key, gn_path): # 处理需要特殊 relative_path = os.path.relpath(location_path, gn_path) # 获取头文件相对路 loc["location_path"] = relative_path data["location"] = loc + data["class_name"] = get_node_class_name(data) data["unique_id"] = get_api_unique_id(cursor, loc, data) if key == 0: data["unique_id"] = data["name"] + syntax_error_message = diagnostic_callback(cursor.translation_unit.diagnostics, gn_path) + data["syntax_error"] = syntax_error_message if kind_name in special_node_process.keys(): node_process = special_node_process[kind_name] node_process(cursor, data) # 调用对应节点处理函数 @@ -302,11 +338,36 @@ def get_default_node_data(cursor, gn_path): "form": 'NA', "atomic_service": 'NA', "decorator": 'NA', - "unique_id": '' + "unique_id": '', + "syntax_error": 'NA', + "open_close_api": 'NA', + "is_third_party_api": False } return data +def diagnostic_callback(diagnostic, dir_path): + # 获取诊断信息的详细内容 + syntax_error_message = 'NA' + key = 0 + for dig in diagnostic: + file_path = f"{dig.location.file}" + try: + file_path = os.path.relpath(os.path.normpath(file_path), dir_path) + except ValueError: + pass + line = dig.location.line + message = dig.spelling + # 输出诊断信息 + error_message = f"{file_path}:{line}\n错误信息:{message}" + if 0 == key: + syntax_error_message = error_message + key = 1 + else: + syntax_error_message = '{}\n{}'.format(syntax_error_message, error_message) + return syntax_error_message + + def parser_data_assignment(cursor, current_file, gn_path, comment=None, key=0): data = get_default_node_data(cursor, gn_path) get_comment(cursor, data) @@ -323,10 +384,6 @@ def parser_data_assignment(cursor, current_file, gn_path, comment=None, key=0): data["kind"] = cursor.kind.name if cursor.kind.name == CursorKind.MACRO_DEFINITION.name: define_comment(cursor, current_file, data) - struct_union_enum = [NodeKind.STRUCT_DECL.value, NodeKind.UNION_DECL.value, - NodeKind.ENUM_DECL.value] - if data.get('kind') in struct_union_enum and 'class_name' in data: - data['class_name'] = data.get('name') get_syscap_value(data) get_since_value(data) get_kit_value(data) @@ -564,6 +621,7 @@ def api_entrance(share_lib, include_path, gn_path, link_path): # 统计入口 # options赋值为如下,代表宏定义解析数据也要 args = ['-I{}'.format(path) for path in link_path] args.append('-std=c99') + args.append('--target=aarch64-linux-musl') options = clang.cindex.TranslationUnit.PARSE_DETAILED_PROCESSING_RECORD data_total = [] # 列表对象-用于统计 diff --git a/build-tools/capi_parser/src/coreImpl/parser/parser.py b/build-tools/capi_parser/src/coreImpl/parser/parser.py index 5ab20372e..1adac3f2e 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/parser.py +++ b/build-tools/capi_parser/src/coreImpl/parser/parser.py @@ -267,10 +267,8 @@ def find_include(link_include_path): def copy_self_include(link_include_path, self_include_file): for dir_path, dir_name, file_name_list in os.walk(self_include_file): - for element in dir_name: - dir_path_name = os.path.abspath(os.path.join(dir_path, element)) - if 'sysroot_myself' not in dir_path and dir_path_name not in link_include_path: - link_include_path.append(dir_path_name) + if 'sysroot_myself' not in dir_path and 'build-tools' not in dir_path and dir_path not in link_include_path: + link_include_path.append(dir_path) def delete_typedef_child(child): @@ -294,19 +292,11 @@ def parser(directory_path): # 目录路径 return data_total -def parser_include_ast(dire_file_path, include_path: list, flag=-1): # 对于单独的.h解析接口 +def parser_include_ast(dire_file_path, include_path: list): # 对于单独的.h解析接口 correct_include_path = [] link_include_path = [dire_file_path] - # 针对check - if -1 == flag: - copy_std_lib(link_include_path, dire_file_path) - link_include(dire_file_path, StringConstant.FUNK_NAME.value, link_include_path) - # 针对diff - else: - copy_std_lib(link_include_path) - find_include(link_include_path) - if len(link_include_path) <= 2: - copy_self_include(link_include_path, dire_file_path) + copy_std_lib(link_include_path, dire_file_path) + copy_self_include(link_include_path, dire_file_path) for item in include_path: split_path = os.path.splitext(item) if split_path[1] == '.h': # 判断.h结尾 @@ -322,13 +312,25 @@ def parser_include_ast(dire_file_path, include_path: list, flag=-1): # return data +def diff_parser_include_ast(dire_file_path, include_path: list, flag=-1): # 对于单独的.h解析接口 + link_include_path = [dire_file_path] + copy_self_include(link_include_path, dire_file_path) + data = parse_include.get_include_file(include_path, link_include_path, dire_file_path) + + for item in data: + if 'children' in item: + for child in item['children']: + delete_typedef_child(child) + + return data + + def get_dir_file_path(dir_path): file_path_list = [] link_include_path = [] # 装链接头文件路径 for dir_path, dir_names, filenames in os.walk(dir_path): - for dir_name in dir_names: - if 'build-tools' not in dir_path and 'sysroot_myself' not in dir_path: - link_include_path.append(os.path.join(dir_path, dir_name)) + if 'sysroot_myself' not in dir_path and 'build-tools' not in dir_path and dir_path not in link_include_path: + link_include_path.append(dir_path) for file in filenames: if 'build-tools' not in dir_path and 'sysroot_myself' not in dir_path and file.endswith('.h'): file_path_list.append(os.path.join(dir_path, file)) diff --git a/build-tools/capi_parser/src/typedef/diff/diff.py b/build-tools/capi_parser/src/typedef/diff/diff.py index 897c320ba..d9a7b4b3d 100644 --- a/build-tools/capi_parser/src/typedef/diff/diff.py +++ b/build-tools/capi_parser/src/typedef/diff/diff.py @@ -116,6 +116,7 @@ class Scene(enum.Enum): VAR_DECL = 'VAR_DECL' TYPEDEF_DECL = 'TYPEDEF_DECL' TRANSLATION_UNIT = 'TRANSLATION_UNIT' + ENUM_CONSTANT_DECL = 'ENUM_CONSTANT_DECL' class TAGS(enum.Enum): @@ -229,6 +230,7 @@ compatible_list = [ DiffType.ADD_API, DiffType.ADD_DOC, DiffType.ADD_DOC_TAG, + DiffType.ENUM_MEMBER_ADD, DiffType.FUNCTION_PARAM_NAME_CHANGE, DiffType.DOC_TAG_ADDTOGROUP_NA_TO_HAVE, DiffType.DOC_TAG_ADDTOGROUP_HAVE_TO_NA, @@ -386,6 +388,9 @@ class DiffInfo: operation_diff_type: str = '' old_differ_content: str = '' new_differ_content: str = '' + open_close_api: str = '' + is_third_party_api = False + current_api_type: str = '' def __init__(self, diff_type: DiffType, old_differ_content, new_differ_content): self.diff_type = diff_type @@ -540,6 +545,24 @@ class DiffInfo: def get_new_differ_content(self): return self.new_differ_content + def set_open_close_api(self, open_close_api): + self.open_close_api = open_close_api + + def get_open_close_api(self): + return self.open_close_api + + def set_is_third_party_api(self, is_third_party_api): + self.is_third_party_api = is_third_party_api + + def get_is_third_party_api(self): + return self.is_third_party_api + + def set_current_api_type(self, current_api_type): + self.current_api_type = current_api_type + + def get_current_api_type(self): + return self.current_api_type + class OutputJson: api_name: str = '' @@ -595,6 +618,10 @@ class ApiChangeData: compatible_total = False unique_id: str = '' is_system_api = False + open_close_api: str = '' + is_third_party_api = False + api_type: str = '' + current_api_type: str = '' def set_api_name(self, api_name): self.api_name = api_name @@ -679,3 +706,41 @@ class ApiChangeData: def get_is_system_api(self): return self.is_system_api + + def set_open_close_api(self, open_close_api): + self.open_close_api = open_close_api + + def get_open_close_api(self): + return self.open_close_api + + def set_is_third_party_api(self, is_third_party_api): + self.is_third_party_api = is_third_party_api + + def get_is_third_party_api(self): + return self.is_third_party_api + + def set_api_type(self, api_type): + self.api_type = api_type + + def get_api_type(self): + return self.api_type + + def set_current_api_type(self, current_api_type): + self.current_api_type = current_api_type + + def get_current_api_type(self): + return self.current_api_type + + +class IgnoreFileDirectory: + ignore_file_dict = { + 'arm-linux-ohos': '', + 'aarch64-linux-ohos': '', + 'x86_64-linux-ohos': '', + 'i686-linux-ohos': '', + 'tee': '', + 'linux': '' + } + + def get_ignore_file_dict(self): + return self.ignore_file_dict diff --git a/build-tools/capi_parser/src/utils/constants.py b/build-tools/capi_parser/src/utils/constants.py index 9c67d962b..579737ce9 100644 --- a/build-tools/capi_parser/src/utils/constants.py +++ b/build-tools/capi_parser/src/utils/constants.py @@ -24,15 +24,15 @@ class StringConstant(enum.Enum): REPLACE_WAREHOUSE = '\\interface_sdk_c\\interface_sdk_c' # 拉到本地仓路径(去掉磁盘) # 拉到本地仓的三方库绝对路径 INCLUDE_LIB = r'.\third_party\musl\ndk_musl_include' - STD_INCLUDE = r'.\sysroot_myself\std_include_files' - CREATE_LIB_PATH = r'.\sysroot_myself\$is_headers_out_dir' - SELF_INCLUDE = r'.\sysroot_myself\self_include_files' - SELF_INCLUDE_OLD = r'.\sysroot_myself\self_include_files_old' - SELF_INCLUDE_NEW = r'.\sysroot_myself\self_include_files_new' - SYSROOT = r'.\sysroot_myself' + STD_INCLUDE = r'./sysroot_myself/std_include_files' + CREATE_LIB_PATH = r'./sysroot_myself/$is_headers_out_dir' + SELF_INCLUDE = r'./sysroot_myself/self_include_files' + SELF_INCLUDE_OLD = r'./sysroot_myself/self_include_files_old' + SELF_INCLUDE_NEW = r'./sysroot_myself/self_include_files_new' + SYSROOT = r'./sysroot_myself' RESULT_HEAD_NAME = "result_total.xlsx" PARSER_DIRECT_EXCEL_NAME = 'parser_direct_data.xlsx' - FILE_LEVEL_API_DATA = r'.\api_kit_c.json' + FILE_LEVEL_API_DATA = r'./api_kit_c.json' class RegularExpressions(enum.Enum): -- Gitee From d2966159ed3d6e685551ac5e95c708cf8cf47a35 Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Tue, 6 Aug 2024 09:17:02 +0000 Subject: [PATCH 025/620] update multimedia/drm_framework/libnative_drm.ndk.json. Signed-off-by: baoxy92 --- multimedia/drm_framework/libnative_drm.ndk.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/multimedia/drm_framework/libnative_drm.ndk.json b/multimedia/drm_framework/libnative_drm.ndk.json index 0e453e4d5..7e0949b81 100644 --- a/multimedia/drm_framework/libnative_drm.ndk.json +++ b/multimedia/drm_framework/libnative_drm.ndk.json @@ -115,13 +115,17 @@ "first_introduced": "11", "name": "OH_MediaKeySession_Destroy" }, + { + "first_introduced": "11", + "name": "OH_MediaKeySession_SetMediaKeySessionCallback" + }, { "first_introduced": "12", "name": "OH_MediaKeySystem_GetMediaKeySystems" }, { "first_introduced": "12", - "name": "OH_MediaKeySession_SetMediaKeySessionCallback" + "name": "OH_MediaKeySession_SetCallback" }, { "first_introduced": "12", -- Gitee From 322f52030fcb391e40b24a0296b756c80cff7ba3 Mon Sep 17 00:00:00 2001 From: jiangchunli Date: Tue, 6 Aug 2024 09:19:39 +0000 Subject: [PATCH 026/620] Add error code description related to drm. Signed-off-by: jiangchunli --- multimedia/av_codec/native_avcodec_audiocodec.h | 1 + multimedia/av_codec/native_avcodec_videodecoder.h | 3 +++ multimedia/av_codec/native_avdemuxer.h | 1 + multimedia/drm_framework/native_mediakeysystem.h | 4 +--- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_audiocodec.h b/multimedia/av_codec/native_avcodec_audiocodec.h index 4c6831580..8ae03c4bb 100644 --- a/multimedia/av_codec/native_avcodec_audiocodec.h +++ b/multimedia/av_codec/native_avcodec_audiocodec.h @@ -279,6 +279,7 @@ OH_AVErrCode OH_AudioCodec_IsValid(OH_AVCodec *codec, bool *isValid); * {@link AV_ERR_INVALID_VAL} 3 - If the codec instance is nullptr or invalid, * the mediaKeySession is nullptr or invalid. * {@link AV_ERR_INVALID_STATE} 8 - If the codec service is invalid. + * {@link AV_ERR_NO_MEMORY}, failed to request memory. * @since 12 * @version 1.0 */ diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index c52df2c28..012329d4f 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -343,6 +343,8 @@ OH_AVErrCode OH_VideoDecoder_FreeOutputData(OH_AVCodec *codec, uint32_t index); * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. + * {@link AV_ERR_DRM_DECRYPT_FAILED}, the drm-protected video buffer is decrypted failed, + * it is recommended to check the logs. * @since 11 */ OH_AVErrCode OH_VideoDecoder_PushInputBuffer(OH_AVCodec *codec, uint32_t index); @@ -442,6 +444,7 @@ OH_AVErrCode OH_VideoDecoder_IsValid(OH_AVCodec *codec, bool *isValid); * @return {@link AV_ERR_OK} 0 - Success * {@link AV_ERR_OPERATE_NOT_PERMIT} 2 - If the codec service or the media key session * service is in wrong status. + * {@link AV_ERR_NO_MEMORY}, instance has already released or no memory. * {@link AV_ERR_INVALID_VAL} 3 - If the codec instance is nullptr or invalid, * the mediaKeySession is nullptr or invalid. * @since 11 diff --git a/multimedia/av_codec/native_avdemuxer.h b/multimedia/av_codec/native_avdemuxer.h index 7b2117ebc..7db7dec7e 100644 --- a/multimedia/av_codec/native_avdemuxer.h +++ b/multimedia/av_codec/native_avdemuxer.h @@ -210,6 +210,7 @@ OH_AVErrCode OH_AVDemuxer_SetDemuxerMediaKeySystemInfoCallback(OH_AVDemuxer *dem * @param mediaKeySystemInfo Indicates the media key system info which ram space allocated by callee and * released by caller. * @return {@link AV_ERR_OK} 0 - Success + * {@link AV_ERR_OPERATE_NOT_PERMIT} 2 - If the demuxer engine is not inited or init failed. * {@link AV_ERR_INVALID_VAL} 3 - If the demuxer instance is nullptr or invalid * or the mediaKeySystemInfo is nullptr. * @since 11 diff --git a/multimedia/drm_framework/native_mediakeysystem.h b/multimedia/drm_framework/native_mediakeysystem.h index 2a818346b..966948a64 100644 --- a/multimedia/drm_framework/native_mediakeysystem.h +++ b/multimedia/drm_framework/native_mediakeysystem.h @@ -135,8 +135,6 @@ bool OH_MediaKeySystem_IsSupported3(const char *name, const char *mimeType, * @brief Creates a media key system instance from the name. * @param name Secifies which drm system will be created by name. * @param mediaKeySystem Media key system instance. - * @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully, - * return DRM_ERR_MAX_SYSTEM_NUM_REACHED when max num media key system reached. * @return {@link DRM_ERR_OK} 0 - Success.  *         {@link DRM_ERR_INVALID_VAL} 24700503 - Probably caused by: * 1. the name is nullptr or the length of name is zero. @@ -155,6 +153,7 @@ Drm_ErrCode OH_MediaKeySystem_Create(const char *name, MediaKeySystem **mediaKey * @param value Configuration vaule string to be set. * @return {@link DRM_ERR_OK} 0 - Success.  *         {@link DRM_ERR_INVALID_VAL} 24700503 - The parameter passed in is a null pointer or invalid. + *         {@link DRM_ERR_UNKNOWN} 24700506 - Internal error occurred, it is recommended to check the logs. * @since 11 * @version 1.0 */ @@ -358,7 +357,6 @@ Drm_ErrCode OH_MediaKeySystem_GetCertificateStatus(MediaKeySystem *mediaKeySyste */ Drm_ErrCode OH_MediaKeySystem_Destroy(MediaKeySystem *mediaKeySystem); - #ifdef __cplusplus } #endif -- Gitee From 23ece5cff0bfe54e9eedffa7f9c8edf594966ef2 Mon Sep 17 00:00:00 2001 From: duanhan Date: Wed, 7 Aug 2024 10:46:06 +0800 Subject: [PATCH 027/620] libpixelmap json fix Signed-off-by: duanhan --- multimedia/image_framework/libpixelmap.ndk.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index f06f6b186..5a1af8e20 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -149,10 +149,10 @@ }, { "first_introduced": "12", - "name": "OH_PixelmapNative_ConvertPixelmapToNapi" + "name": "OH_PixelmapNative_ConvertPixelmapNativeToNapi" }, { "first_introduced": "12", - "name": "OH_PixelmapNative_ConvertPixelmapFromNapi" + "name": "OH_PixelmapNative_ConvertPixelmapNativeFromNapi" } ] \ No newline at end of file -- Gitee From 45829423785a86c1512ac3cc1bff8a5e723650b2 Mon Sep 17 00:00:00 2001 From: zhengqiyi Date: Wed, 7 Aug 2024 03:18:29 +0000 Subject: [PATCH 028/620] add distance to tapGesture Signed-off-by: zhengqiyi --- arkui/ace_engine/native/native_gesture.h | 25 ++++++++++++++++++++++++ arkui/ace_engine/native/native_node.h | 10 ++++++++++ 2 files changed, 35 insertions(+) diff --git a/arkui/ace_engine/native/native_gesture.h b/arkui/ace_engine/native/native_gesture.h index a3df84401..19e83b1f5 100644 --- a/arkui/ace_engine/native/native_gesture.h +++ b/arkui/ace_engine/native/native_gesture.h @@ -884,6 +884,31 @@ typedef struct { int32_t (*setInnerGestureParallelTo)( ArkUI_NodeHandle node, void* userData, ArkUI_GestureRecognizer* (*parallelInnerGesture)( ArkUI_ParallelInnerGestureEvent* event)); + + /** + * @brief Creates a tap gesture that is subject to distance restrictions. + * + * 1. This API is used to trigger a tap gesture with one, two, or more taps. \n + * 2. If multi-tap is configured, the timeout interval between a lift and the next tap is 300 ms. \n + * 3. If the distance between the last tapped position and the current tapped position exceeds 60 vp, + * gesture recognition fails. \n + * 4. If the value is greater than 1, the tap gesture will fail to be recognized when the number of fingers + * touching the screen within 300 ms of the first finger touch is less than the required number, + * or when the number of fingers lifted from the screen within 300 ms of the first finger's being lifted + * is less than the required number. \n + * 5. When the number of fingers touching the screen exceeds the set value, the gesture can be recognized. \n + * 6. If the finger moves beyond the preset distance limit, gesture recognition fails. \n + * + * @param countNum Indicates the number of consecutive taps. If the value is less than 1 or is not set, the default + * value 1 is used. + * @param fingersNum Indicates the number of fingers required to trigger a tap. The value ranges from 1 to 10. + * If the value is less than 1 or is not set, the default value 1 is used. + * @param distanceThreshold Indicates the allowed moving distance of a finger. + * If the value is less than 0 or is not set, it will be converted to the default value of infinity. + * @return Returns the pointer to the created gesture. + */ + ArkUI_GestureRecognizer* (*createTapGestureWithDistanceThreshold)( + int32_t countNum, int32_t fingersNum, double distanceThreshold); } ArkUI_NativeGestureAPI_1; #ifdef __cplusplus diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 6db4dc539..767af1017 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -1813,6 +1813,16 @@ typedef enum { */ NODE_UNIQUE_ID = 95, + /** + * @brief Defines the moving distance limit for the component-bound tap gesture. + * This attribute can be set as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: allowed moving distance of a finger, in vp. \n + * + */ + NODE_CLICK_DISTANCE = 96, + /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. * -- Gitee From a8ddb7029883b9afa700e8851baeaac5608bdf1d Mon Sep 17 00:00:00 2001 From: root Date: Wed, 7 Aug 2024 14:27:19 +0800 Subject: [PATCH 029/620] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dhitrace.h=20ND?= =?UTF-8?q?K=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: root --- hiviewdfx/hitrace/include/hitrace/trace.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hiviewdfx/hitrace/include/hitrace/trace.h b/hiviewdfx/hitrace/include/hitrace/trace.h index 9142b2637..e771136da 100644 --- a/hiviewdfx/hitrace/include/hitrace/trace.h +++ b/hiviewdfx/hitrace/include/hitrace/trace.h @@ -65,6 +65,7 @@ * @since 10 */ #include +#include #ifdef __cplusplus extern "C" { -- Gitee From d006b3fcdaacc37c255a01b22f04e5ade64f51ec Mon Sep 17 00:00:00 2001 From: liyang Date: Wed, 7 Aug 2024 16:42:45 +0800 Subject: [PATCH 030/620] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B1=81=E5=85=8D?= =?UTF-8?q?=E9=9A=90=E7=A7=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liyang --- .../player_framework/native_avscreen_capture.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index 1264f7882..d30838a29 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -398,6 +398,23 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ContentFilter_AddWindowContent( */ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ResizeCanvas(struct OH_AVScreenCapture *capture, int32_t width, int32_t height); + +/** + * @brief skip some windows' privacy mode of current app during the screen recording + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @param capture Pointer to an OH_AVScreenCapture instance + * @param Pointer to windowID list + * @param length of windowID list + * @return Function result code. + * {@link AV_SCREEN_CAPTURE_ERR_OK} if the execution is successful. + * {@link AV_SCREEN_CAPTURE_ERR_INVALID_VAL} input capture is nullptr or input windowIDs are not belong current + * app. + * {@link AV_SCREEN_CAPTURE_ERR_OPERATE_NOT_PERMIT} opertation not be permitted. + * @since 12 + * @version 1.0 + */ +OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SkipPrivacyMode(struct OH_AVScreenCapture *capture, + int32_t *windowIDs, int32_t windowCount); #ifdef __cplusplus } #endif -- Gitee From c4da520069feab5c56f037e226082dbf6620d955 Mon Sep 17 00:00:00 2001 From: liyang Date: Wed, 7 Aug 2024 16:45:30 +0800 Subject: [PATCH 031/620] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B1=81=E5=85=8D?= =?UTF-8?q?=E9=9A=90=E7=A7=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liyang --- multimedia/player_framework/native_avscreen_capture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index d30838a29..e993b8ef2 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -403,7 +403,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ResizeCanvas(struct OH_AVScreenCa * @brief skip some windows' privacy mode of current app during the screen recording * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance - * @param Pointer to windowID list + * @param Pointer of windowID list * @param length of windowID list * @return Function result code. * {@link AV_SCREEN_CAPTURE_ERR_OK} if the execution is successful. -- Gitee From 055da04aabec5e7038e9b77b6718ac9254f01e96 Mon Sep 17 00:00:00 2001 From: xuzhangchi Date: Wed, 7 Aug 2024 18:05:52 +0800 Subject: [PATCH 032/620] =?UTF-8?q?=E5=BD=95=E5=B1=8F=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=BF=9B=E5=87=BA=E9=9A=90=E7=A7=81=E7=A9=BA?= =?UTF-8?q?=E9=97=B4=E4=BA=8B=E4=BB=B6=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuzhangchi --- multimedia/player_framework/native_avscreen_capture_base.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multimedia/player_framework/native_avscreen_capture_base.h b/multimedia/player_framework/native_avscreen_capture_base.h index 34eb708d4..b9a795eaf 100644 --- a/multimedia/player_framework/native_avscreen_capture_base.h +++ b/multimedia/player_framework/native_avscreen_capture_base.h @@ -446,6 +446,8 @@ typedef enum OH_AVScreenCaptureStateCode { OH_SCREEN_CAPTURE_STATE_ENTER_PRIVATE_SCENE = 8, /* Private window disappeared on current captured screen*/ OH_SCREEN_CAPTURE_STATE_EXIT_PRIVATE_SCENE = 9, + /* ScreenCapture stopped by user switched */ + OH_SCREEN_CAPTURE_STATE_STOPPED_BY_USER_SWITCHED = 10, } OH_AVScreenCaptureStateCode; /** -- Gitee From fe2c8c173eb41aa443d525b60b80ae9dabf5cc58 Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Thu, 8 Aug 2024 10:55:08 +0000 Subject: [PATCH 033/620] update multimedia/drm_framework/common/native_drm_common.h. Signed-off-by: baoxy92 --- multimedia/drm_framework/common/native_drm_common.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/multimedia/drm_framework/common/native_drm_common.h b/multimedia/drm_framework/common/native_drm_common.h index 386f3162e..410a27f20 100644 --- a/multimedia/drm_framework/common/native_drm_common.h +++ b/multimedia/drm_framework/common/native_drm_common.h @@ -486,6 +486,11 @@ typedef struct DRM_MediaKeySystemInfo { DRM_PsshInfo psshInfo[MAX_PSSH_INFO_COUNT]; } DRM_MediaKeySystemInfo; +/** +* @brief Callback for getting media key system information from media source. +* @since 11 +* @version 1.0 +*/ typedef void (*DRM_MediaKeySystemInfoCallback)(DRM_MediaKeySystemInfo *mediaKeySystemInfo); /** -- Gitee From 2c95aa594224208a43cb83a200a84211dcc4a7e9 Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Thu, 8 Aug 2024 10:56:04 +0000 Subject: [PATCH 034/620] update multimedia/av_codec/native_avdemuxer.h. Signed-off-by: baoxy92 --- multimedia/av_codec/native_avdemuxer.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/multimedia/av_codec/native_avdemuxer.h b/multimedia/av_codec/native_avdemuxer.h index 7b2117ebc..cab1e2132 100644 --- a/multimedia/av_codec/native_avdemuxer.h +++ b/multimedia/av_codec/native_avdemuxer.h @@ -47,6 +47,12 @@ typedef struct OH_AVDemuxer OH_AVDemuxer; * @since 11 */ typedef struct DRM_MediaKeySystemInfo DRM_MediaKeySystemInfo; + +/** +* @brief Callback for getting media key system information from media source. +* @since 11 +* @version 1.0 +*/ typedef void (*DRM_MediaKeySystemInfoCallback)(DRM_MediaKeySystemInfo* mediaKeySystemInfo); /** -- Gitee From f2bdbf5bfff713390a61daae748afc57170cc832 Mon Sep 17 00:00:00 2001 From: liyang Date: Thu, 8 Aug 2024 19:15:23 +0800 Subject: [PATCH 035/620] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=9A=90=E7=A7=81?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E8=B1=81=E5=85=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liyang --- .../avscreen_capture/libnative_avscreen_capture.ndk.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json b/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json index 645b3569d..1e53ae7d7 100644 --- a/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json +++ b/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json @@ -94,5 +94,9 @@ { "first_introduced": "12", "name": "OH_AVScreenCapture_ResizeCanvas" + }, + { + "first_introduced": "12", + "name": "OH_AVScreenCapture_SkipPrivacyMode" } ] \ No newline at end of file -- Gitee From f40eb5269c3fdf118a2d6947a35fe5564889233f Mon Sep 17 00:00:00 2001 From: luyangyang <1049603119@qq.com> Date: Thu, 8 Aug 2024 19:45:43 +0800 Subject: [PATCH 036/620] add RDB_SECURITY_AREA_EL5 Signed-off-by: luyangyang <1049603119@qq.com> --- .../relational_store/include/relational_store.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index 471e48649..c40224896 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -93,6 +93,10 @@ typedef enum Rdb_SecurityArea { * @brief Security Area 4. */ RDB_SECURITY_AREA_EL4, + /** + * @brief Security Area 5. + */ + RDB_SECURITY_AREA_EL5, } Rdb_SecurityArea; /** -- Gitee From f38a4ed6bcf6315095e7fe07bf8b773834e33570 Mon Sep 17 00:00:00 2001 From: luyangyang <1049603119@qq.com> Date: Thu, 8 Aug 2024 20:07:54 +0800 Subject: [PATCH 037/620] =?UTF-8?q?=E9=97=A8=E7=A6=81=E4=BF=AE=E5=A4=8D=20?= =?UTF-8?q?Signed-off-by:=20luyangyang=20<1049603119@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- distributeddatamgr/relational_store/include/relational_store.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index c40224896..a48ed22ee 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -93,8 +93,11 @@ typedef enum Rdb_SecurityArea { * @brief Security Area 4. */ RDB_SECURITY_AREA_EL4, + /** * @brief Security Area 5. + * + * @since 12 */ RDB_SECURITY_AREA_EL5, } Rdb_SecurityArea; -- Gitee From 9d8b6c95683546da1577114871d689a2120af9b9 Mon Sep 17 00:00:00 2001 From: Can Xia Date: Fri, 9 Aug 2024 10:14:06 +0800 Subject: [PATCH 038/620] Gif Encode Signed-off-by: Can Xia Change-Id: Iaca87a6dbce54b9e77bec2bb1bd1a71e4b6ad30f Signed-off-by: Can Xia --- .../include/image/image_packer_native.h | 178 ++++++++++++++++++ .../image_framework/libimage_packer.ndk.json | 48 +++++ 2 files changed, 226 insertions(+) diff --git a/multimedia/image_framework/include/image/image_packer_native.h b/multimedia/image_framework/include/image/image_packer_native.h index bef398006..ef2081b02 100644 --- a/multimedia/image_framework/include/image/image_packer_native.h +++ b/multimedia/image_framework/include/image/image_packer_native.h @@ -59,6 +59,20 @@ typedef struct OH_ImagePackerNative OH_ImagePackerNative; struct OH_PackingOptions; typedef struct OH_PackingOptions OH_PackingOptions; +/** + * @brief Defines the image sequence packing options. + * + * @since 12 + */ +struct OH_PackingOptionsForSequence; + +/** + * @brief Defines the image sequence packing options. + * + * @since 12 + */ +typedef struct OH_PackingOptionsForSequence OH_PackingOptionsForSequence; + /** * @brief Enumerates packing dynamic range. * @@ -182,6 +196,134 @@ Image_ErrorCode OH_PackingOptions_SetDesiredDynamicRange(OH_PackingOptions *opti */ Image_ErrorCode OH_PackingOptions_Release(OH_PackingOptions *options); +/** + * @brief Create a pointer for OH_PackingOptionsForSequence struct. + * + * @param options The OH_PackingOptionsForSequence pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PackingOptionsForSequence_Create(OH_PackingOptionsForSequence **options); + +/** + * @brief Set FrameCount number for OH_PackingOptionsForSequence struct. + * + * @param options The OH_PackingOptionsForSequence pointer will be operated. + * @param frameCount The number of image frameCount. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PackingOptionsForSequence_SetFrameCount(OH_PackingOptionsForSequence *options, + uint32_t frameCount); + +/** + * @brief Get FrameCount number for OH_PackingOptionsForSequence struct. + * + * @param options The OH_PackingOptionsForSequence pointer will be operated. + * @param frameCount The number of image frameCount. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options or frameCount is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PackingOptionsForSequence_GetFrameCount(OH_PackingOptionsForSequence *options, + uint32_t *frameCount); + +/** + * @brief Set DelayTimeList number for OH_PackingOptionsForSequence struct. + * + * @param options The OH_PackingOptionsForSequence pointer will be operated. + * @param delayTimeList The pointer of image delayTime list. + * @param delayTimeListLength The number of image delayTimeListLength. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options or delayTimeList is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PackingOptionsForSequence_SetDelayTimeList(OH_PackingOptionsForSequence *options, + int32_t *delayTimeList, size_t delayTimeListLength); + +/** + * @brief Get DelayTimeList number for OH_PackingOptionsForSequence struct. + * + * @param options The OH_PackingOptionsForSequence pointer will be operated. + * @param delayTimeList The pointer of image delayTime list. + * @param delayTimeListLength The number of image delayTimeListLength. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options or delayTimeList is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PackingOptionsForSequence_GetDelayTimeList(OH_PackingOptionsForSequence *options, + int32_t *delayTimeList, size_t delayTimeListLength); + +/** + * @brief Set DisposalTypes number for OH_PackingOptionsForSequence struct. + * + * @param options The OH_PackingOptionsForSequence pointer will be operated. + * @param disposalTypes The pointer of image disposalTypes. + * @param disposalTypesLength The number of image disposalTypesLength. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options or disposalTypes is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PackingOptionsForSequence_SetDisposalTypes(OH_PackingOptionsForSequence *options, + uint32_t *disposalTypes, size_t disposalTypesLength); + +/** + * @brief Get DisposalTypes number for OH_PackingOptionsForSequence struct. + * + * @param options The OH_PackingOptionsForSequence pointer will be operated. + * @param disposalTypes The pointer of image disposalTypes. + * @param disposalTypesLength The number of image disposalTypesLength. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options or disposalTypes is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PackingOptionsForSequence_GetDisposalTypes(OH_PackingOptionsForSequence *options, + uint32_t *disposalTypes, size_t disposalTypesLength); + +/** + * @brief Set LoopCount number for OH_PackingOptionsForSequence struct. + * + * @param options The OH_PackingOptionsForSequence pointer will be operated. + * @param loopCount The number of image loopCount. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PackingOptionsForSequence_SetLoopCount(OH_PackingOptionsForSequence *options, uint32_t loopCount); + +/** + * @brief Get LoopCount number for OH_PackingOptionsForSequence struct. + * + * @param options The OH_PackingOptionsForSequence pointer will be operated. + * @param loopCount The number of image loopCount. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options or loopCount is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PackingOptionsForSequence_GetLoopCount(OH_PackingOptionsForSequence *options, uint32_t *loopCount); + +/** + * @brief delete OH_PackingOptionsForSequence pointer. + * + * @param options The OH_PackingOptionsForSequence pointer will be operated. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} options is nullptr. + * @since 12 + */ +Image_ErrorCode OH_PackingOptionsForSequence_Release(OH_PackingOptionsForSequence *options); + /** * @brief Create a pointer for OH_ImagePackerNative struct. * @@ -237,6 +379,25 @@ Image_ErrorCode OH_ImagePackerNative_PackToDataFromPixelmap(OH_ImagePackerNative Image_ErrorCode OH_ImagePackerNative_PackToDataFromPicture(OH_ImagePackerNative *imagePacker, OH_PackingOptions *options, OH_PictureNative *picture, uint8_t *outData, size_t *size); +/** + * @brief Encoding a PixelMap sequence into the data + * + * @param imagePacker The imagePacker to use for packing. + * @param options Indicates the encoding {@link OH_PackingOptionsForSequence}. + * @param pixelmapSequence The pixelmap sequence to be packed. + * @param sequenceLength The pixelmap sequence size to be packed. + * @param outData The output data buffer to store the packed image. + * @param outDataSize A pointer to the size of the output data buffer. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} one of the pointer type parameters is nullptr, or size/length is invalid + * {@link IMAGE_ENCODE_FAILED} encode failed. + * @since 12 + */ +Image_ErrorCode OH_ImagePackerNative_PackToDataFromPixelmapSequence(OH_ImagePackerNative *imagePacker, + OH_PackingOptionsForSequence *options, OH_PixelmapNative **pixelmapSequence, + size_t sequenceLength, uint8_t *outData, size_t *outDataSize); + /** * @brief Encoding an ImageSource into the a file with fd with required format. * @@ -279,6 +440,23 @@ Image_ErrorCode OH_ImagePackerNative_PackToFileFromPixelmap(OH_ImagePackerNative Image_ErrorCode OH_ImagePackerNative_PackToFileFromPicture(OH_ImagePackerNative *imagePacker, OH_PackingOptions *options, OH_PictureNative *picture, int32_t fd); +/** + * @brief Encoding a PixelMap sequence into the a file with fd + * + * @param imagePacker The image packer to use for packing. + * @param options Indicates the encoding {@link OH_PackingOptionsForSequence}. + * @param pixelmapSequence The pixelmap sequence to be packed. + * @param sequenceLength The pixelmap sequence size to be packed. + * @param fd Indicates a writable file descriptor. + * @return Image functions result code. + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_BAD_PARAMETER} one of the pointer type parameters is nullptr, or length is invalid + * {@link IMAGE_ENCODE_FAILED} encode failed. + * @since 12 + */ +Image_ErrorCode OH_ImagePackerNative_PackToFileFromPixelmapSequence(OH_ImagePackerNative *imagePacker, + OH_PackingOptionsForSequence *options, OH_PixelmapNative **pixelmapSequence, size_t sequenceLength, int32_t fd); + /** * @brief Releases an imagePacker object. * diff --git a/multimedia/image_framework/libimage_packer.ndk.json b/multimedia/image_framework/libimage_packer.ndk.json index 3488cb646..694b6e2b8 100644 --- a/multimedia/image_framework/libimage_packer.ndk.json +++ b/multimedia/image_framework/libimage_packer.ndk.json @@ -39,6 +39,46 @@ "first_introduced": "12", "name": "OH_PackingOptions_Release" }, + { + "first_introduced": "12", + "name": "OH_PackingOptionsForSequence_Create" + }, + { + "first_introduced": "12", + "name": "OH_PackingOptionsForSequence_SetFrameCount" + }, + { + "first_introduced": "12", + "name": "OH_PackingOptionsForSequence_GetFrameCount" + }, + { + "first_introduced": "12", + "name": "OH_PackingOptionsForSequence_SetDelayTimeList" + }, + { + "first_introduced": "12", + "name": "OH_PackingOptionsForSequence_GetDelayTimeList" + }, + { + "first_introduced": "12", + "name": "OH_PackingOptionsForSequence_SetDisposalTypes" + }, + { + "first_introduced": "12", + "name": "OH_PackingOptionsForSequence_GetDisposalTypes" + }, + { + "first_introduced": "12", + "name": "OH_PackingOptionsForSequence_SetLoopCount" + }, + { + "first_introduced": "12", + "name": "OH_PackingOptionsForSequence_GetLoopCount" + }, + { + "first_introduced": "12", + "name": "OH_PackingOptionsForSequence_Release" + }, { "first_introduced": "12", "name": "OH_ImagePackerNative_Create" @@ -55,6 +95,10 @@ "first_introduced": "12", "name": "OH_ImagePackerNative_PackToDataFromPicture" }, + { + "first_introduced": "12", + "name": "OH_ImagePackerNative_PackToDataFromPixelmapSequence" + }, { "first_introduced": "12", "name": "OH_ImagePackerNative_PackToFileFromImageSource" @@ -67,6 +111,10 @@ "first_introduced": "12", "name": "OH_ImagePackerNative_PackToFileFromPicture" }, + { + "first_introduced": "12", + "name": "OH_ImagePackerNative_PackToFileFromPixelmapSequence" + }, { "first_introduced": "12", "name": "OH_ImagePackerNative_Release" -- Gitee From 578fcd980c913c2968872f8350432a087df09d9e Mon Sep 17 00:00:00 2001 From: multimodalinput Date: Wed, 7 Aug 2024 09:21:03 +0800 Subject: [PATCH 039/620] =?UTF-8?q?=E5=A4=9A=E6=A8=A1=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E6=8B=A6=E6=88=AA=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: multimodalinput --- multimodalinput/kits/c/input/oh_axis_type.h | 35 ++++--------------- .../kits/c/input/oh_input_manager.h | 27 ++++++++++++++ 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_axis_type.h b/multimodalinput/kits/c/input/oh_axis_type.h index 7d5fd8cc4..de141042d 100644 --- a/multimodalinput/kits/c/input/oh_axis_type.h +++ b/multimodalinput/kits/c/input/oh_axis_type.h @@ -107,56 +107,35 @@ typedef enum InputEvent_AxisEventType { } InputEvent_AxisEventType; /** - * @brief Enumerates axis event source types. + * @brief Enumerates axis event actions. * * @since 12 */ -typedef enum InputEvent_SourceType { - /** - * Indicates that the input source generates events similar to mouse cursor movement, - * button press and release, and wheel scrolling. - * - * @since 12 - */ - SOURCE_TYPE_MOUSE = 1, - /** - * Indicates that the input source generates a touchscreen multi-touch event. - * - * @since 12 - */ - SOURCE_TYPE_TOUCHSCREEN = 2, +typedef enum InputEvent_AxisAction { /** - * Indicates that the input source generates a touchpad multi-touch event. + * Cancel action for the axis input event. * * @since 12 */ - SOURCE_TYPE_TOUCHPAD = 3 -} InputEvent_SourceType; - -/** - * @brief Enumerates axis event actions. - * - * @since 12 - */ -typedef enum InputEvent_AxisAction { + AXIS_ACTION_CANCEL = 0, /** * Start action for the axis input event. * * @since 12 */ - AXIS_ACTION_BEGIN = 5, + AXIS_ACTION_BEGIN, /** * Update action for the axis input event. * * @since 12 */ - AXIS_ACTION_UPDATE = 6, + AXIS_ACTION_UPDATE, /** * End action for the axis input event. * * @since 12 */ - AXIS_ACTION_END = 7, + AXIS_ACTION_END, } InputEvent_AxisAction; #ifdef __cplusplus } diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 5ae7d4df7..1e6c0dd85 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -146,6 +146,33 @@ typedef enum Input_TouchEventAction { TOUCH_ACTION_UP = 3, } Input_TouchEventAction; +/** + * @brief Enumerates event source types. + * + * @since 12 + */ +typedef enum InputEvent_SourceType { + /** + * Indicates that the input source generates events similar to mouse cursor movement, + * button press and release, and wheel scrolling. + * + * @since 12 + */ + SOURCE_TYPE_MOUSE = 1, + /** + * Indicates that the input source generates a touchscreen multi-touch event. + * + * @since 12 + */ + SOURCE_TYPE_TOUCHSCREEN = 2, + /** + * Indicates that the input source generates a touchpad multi-touch event. + * + * @since 12 + */ + SOURCE_TYPE_TOUCHPAD = 3 +} InputEvent_SourceType; + /** * @brief Defines key information, which identifies a key pressing behavior. For example, the Ctrl key information contains the key value and key type. * -- Gitee From 16e95666d107a2ddb6dbfe1d99f2bb6935d175a9 Mon Sep 17 00:00:00 2001 From: zhuguoyang Date: Fri, 9 Aug 2024 11:15:42 +0800 Subject: [PATCH 040/620] add ffrt loop type des Signed-off-by: zhuguoyang --- resourceschedule/ffrt/c/loop.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resourceschedule/ffrt/c/loop.h b/resourceschedule/ffrt/c/loop.h index 2d4e72c78..443956853 100644 --- a/resourceschedule/ffrt/c/loop.h +++ b/resourceschedule/ffrt/c/loop.h @@ -41,6 +41,10 @@ #include "queue.h" #include "type_def.h" +/** + * @brief Defines the ffrt loop type. + * @since 12 + */ typedef void* ffrt_loop_t; /** -- Gitee From e53b94c4499331fcea8b1d8aa4d6c14749ebd506 Mon Sep 17 00:00:00 2001 From: zhangwuf Date: Fri, 9 Aug 2024 11:28:52 +0800 Subject: [PATCH 041/620] =?UTF-8?q?check=E5=B7=A5=E5=85=B7bug=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=92=8C=E8=AF=AD=E6=B3=95=E5=B7=A5=E5=85=B7=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangwuf --- build-tools/capi_parser/src/bin/config.py | 12 ++- .../src/coreImpl/check/check_doc.py | 7 +- .../src/coreImpl/check/check_name.py | 17 ++-- .../src/coreImpl/check/check_syntax.py | 95 ++++++++++++++++++- .../src/coreImpl/parser/parse_include.py | 12 ++- .../capi_parser/src/coreImpl/parser/parser.py | 1 - .../capi_parser/src/typedef/check/check.py | 49 ++++++---- 7 files changed, 157 insertions(+), 36 deletions(-) diff --git a/build-tools/capi_parser/src/bin/config.py b/build-tools/capi_parser/src/bin/config.py index cd015a745..d0bfeff8a 100644 --- a/build-tools/capi_parser/src/bin/config.py +++ b/build-tools/capi_parser/src/bin/config.py @@ -15,7 +15,7 @@ import enum from coreImpl.parser import parser -from coreImpl.check import check +from coreImpl.check import check, check_syntax from coreImpl.diff import diff @@ -25,6 +25,7 @@ class ToolNameType(enum.Enum): CHECK = 'check' COLLECT_H = 'collect_h' COLLECT_FILE = 'collect_file' + CHECK_SYNTAX = 'check_syntax' tool_name_type_set = [ @@ -57,6 +58,8 @@ def run_tools(options): parser.parser_direct(options.parser_path) elif tool_name == ToolNameType['COLLECT_FILE'].value: parser.parser_file_level(options.output_path) + elif tool_name == ToolNameType['CHECK_SYNTAX'].value: + check_syntax.check_syntax_entrance(options.parser_path, options.dependent_path, options.output_path) else: print("工具名称错误") @@ -89,6 +92,13 @@ class Config(object): "type": str, "help": "工具输出文件路径" }, + { + "name": "--dependent-path", + "abbr": "-D", + "required": False, + "type": str, + "help": "依赖文件路径" + }, { "name": "--codecheck--path", "abbr": "--path", diff --git a/build-tools/capi_parser/src/coreImpl/check/check_doc.py b/build-tools/capi_parser/src/coreImpl/check/check_doc.py index 4e95d50a7..99fbee693 100644 --- a/build-tools/capi_parser/src/coreImpl/check/check_doc.py +++ b/build-tools/capi_parser/src/coreImpl/check/check_doc.py @@ -21,7 +21,7 @@ import subprocess from clang.cindex import CursorKind -from typedef.check.check import DocInfo, FileDocInfo, TAGS, CheckErrorMessage, CheckOutPut +from typedef.check.check import DocInfo, FileDocInfo, TAGS, CheckErrorMessage, CheckOutPut, CommentStartEndValue current_file = os.path.dirname(__file__) # permission数据来源于https://gitee.com/openharmony/utils_system_resources/raw/master/systemres/main/config.json @@ -474,7 +474,7 @@ def process_file_doc_info(file_doc_info: FileDocInfo, file_info, comment_start_l api_result_info = set_value_to_result(file_info, CheckErrorMessage.API_DOC_GLOBAL_10.name, get_tage_start_and_end(None, comment_start_line, file_doc_info.group_comment_str, file_info)) - api_result_info.mainBuggyLine = -1 + api_result_info.mainBuggyLine = CommentStartEndValue.DEFAULT_END.value api_result_info_list.append(api_result_info) # 处理file说明 if file_doc_info.file_name is None: @@ -502,6 +502,5 @@ def set_value_to_result(api_info, command, comment_value_info): def get_main_buggy_code(api_info): - main_buggy_code = os.path.basename(api_info['name']) if (len(api_info['node_content']) - == 0) else api_info['node_content']['content'] + main_buggy_code = '' if (len(api_info['node_content']) == 0) else api_info['node_content']['content'] return main_buggy_code diff --git a/build-tools/capi_parser/src/coreImpl/check/check_name.py b/build-tools/capi_parser/src/coreImpl/check/check_name.py index b32636d43..98690645c 100644 --- a/build-tools/capi_parser/src/coreImpl/check/check_name.py +++ b/build-tools/capi_parser/src/coreImpl/check/check_name.py @@ -55,9 +55,14 @@ def check_function_name(api_info, kind, parent_kind): def set_value_to_result(api_info, command): + content = api_info['node_content']['content'] + node_name = api_info['name'] + if api_info['kind'] == 'MACRO_DEFINITION' and api_info.get('def_func_name'): + node_name = api_info.get('def_func_name') + descriptive_message = CheckErrorMessage.__getitem__(command).value.replace('$$', node_name) return CheckOutPut(os.path.abspath(os.path.join(api_info['gn_path'], api_info['location']['location_path'])), - api_info['location']['location_line'], command, CheckErrorMessage.__getitem__(command).value, - api_info['node_content']['content'], api_info['location']['location_line']) + api_info['location']['location_line'], command, descriptive_message, + content, api_info['location']['location_line']) def is_self_developed_function(function_name): @@ -124,10 +129,10 @@ def check_file_name(file_info): file_name = os.path.basename(file_info['name']) result = re.match(CheckName['FILE_NAME'].value, file_name) if result is None: - chck_output = CheckOutPut(os.path.abspath(os.path.join(file_info['gn_path'], file_info['name'])), 0, - CheckErrorMessage.API_NAME_UNIVERSAL_14.name, - CheckErrorMessage.API_NAME_UNIVERSAL_14.value, file_name, 0) - api_result_info_list.append(chck_output) + check_output = CheckOutPut(os.path.abspath(os.path.join(file_info['gn_path'], file_info['name'])), 0, + CheckErrorMessage.API_NAME_UNIVERSAL_14.name, + CheckErrorMessage.API_NAME_UNIVERSAL_14.value.replace('$$', file_name), '', 0) + api_result_info_list.append(check_output) return api_result_info_list diff --git a/build-tools/capi_parser/src/coreImpl/check/check_syntax.py b/build-tools/capi_parser/src/coreImpl/check/check_syntax.py index 70572b31a..a54d7ff71 100644 --- a/build-tools/capi_parser/src/coreImpl/check/check_syntax.py +++ b/build-tools/capi_parser/src/coreImpl/check/check_syntax.py @@ -16,7 +16,8 @@ import re import os import subprocess -from typedef.check.check import ApiResultInfo, ErrorMessage, ErrorType, LogType, ErrorLevel +import openpyxl as op +from typedef.check.check import ApiResultInfo, ErrorType, LogType, ErrorLevel def check_syntax(file_path): @@ -32,26 +33,110 @@ def check_syntax(file_path): return result_list -def processing_data(run_result, result_file): +def get_all_dependent_file_path(dependent_file_path): + link_path = [] + for dir_path, _, _ in os.walk(dependent_file_path): + if 'build-tools' not in dir_path: + link_path.append(dir_path) + + return link_path + + +def process_result_data(result_info_list): + syntax_info_data = [] + for syntax_info in result_info_list: + info_data = [ + syntax_info.api_name, + syntax_info.file_name, + syntax_info.error_info, + syntax_info.location_line, + syntax_info.error_content, + ] + syntax_info_data.append(info_data) + + return syntax_info_data + + +def general_syntax_excel(syntax_data_list, output_path): + data = process_result_data(syntax_data_list) + wb = op.Workbook() + ws = wb['Sheet'] + ws.title = '语法错误信息' + ws.append(['当前文件路径', '错误文件路径', '错误信息', '行号', '代码片段']) + for title in data: + d = title[0], title[1], title[2], title[3], title[4] + ws.append(d) + + wb.save(output_path) + + +def get_dir_file_path(file_path): + file_path_total = [] + for dir_path, _, filenames in os.walk(file_path): + for file_name in filenames: + if 'build-tools' not in dir_path and 'sysroot_myself' not in dir_path and file_name.endswith('.h'): + file_path_total.append(os.path.join(dir_path, file_name)) + + return file_path_total + + +def get_all_object_file_path(file_path): + file_path_total = [] + if os.path.isdir(file_path): + file_path_total = get_dir_file_path(file_path) + else: + if file_path.endswith('.h'): + file_path_total.append(file_path) + + return file_path_total + + +def check_syntax_entrance(file_path, dependent_file_path, output_path): + cmd_list = ['clang'] + link_path = get_all_dependent_file_path(dependent_file_path) + args = ['-I{}'.format(path) for path in link_path] + cmd_list.extend(args) + cmd_list.append('-std=c99') + cmd_list.append('--target=aarch64-linux-musl') + result_list = [] + all_files_list = get_all_object_file_path(file_path) + for element_file in all_files_list: + command = cmd_list + [element_file] + run_result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + result_list.extend(processing_data(run_result, element_file)) + general_syntax_excel(result_list, output_path) + return result_list + + +def processing_data(run_result, current_file): api_result_info_list = [] for run_result_child in run_result.stderr.decode().split('^'): + split_error_message = run_result_child.split('\r\n') + error_content = ''.join(split_error_message[-2:-3:-1]) result_child = run_result_child.replace('~', '') ret = re.findall('\\d+:\\d+', result_child) + error_file_message = re.search(r'([^"]+):\d:\d:', result_child) + error_file_name = current_file + if error_file_message: + error_file_list = error_file_message.group(1).split('\r\n') + if len(error_file_list) >= 1: + error_file_name = os.path.normpath(error_file_list[len(error_file_list) - 1]) if len(ret) != 0: error_message = get_specified_string(result_child) if len(error_message) == 1: continue position = ret[0] api_result_info = ApiResultInfo(ErrorType.SYNTAX_ERRORS.value, - error_message[1], result_file) + error_message[1], current_file) line_column = get_line_and_column(position) api_result_info.set_location_line(line_column[0]) api_result_info.set_location_column(line_column[1]) - api_result_info.set_location(result_file) + api_result_info.set_location(current_file) api_result_info.set_type(LogType.LOG_API.value) api_result_info.set_level(ErrorLevel.LOW.value) - api_result_info.set_file_name(result_file) + api_result_info.set_file_name(error_file_name) api_result_info_list.append(api_result_info) + api_result_info.set_error_content(error_content) return api_result_info_list diff --git a/build-tools/capi_parser/src/coreImpl/parser/parse_include.py b/build-tools/capi_parser/src/coreImpl/parser/parse_include.py index 446ddfc8d..841af8f82 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/parse_include.py +++ b/build-tools/capi_parser/src/coreImpl/parser/parse_include.py @@ -150,7 +150,7 @@ def processing_def(cursor, data): # 处理宏定义 if text: text = text.strip() # 删除两边的字符(默认是删除左右空格) data['text'] = text - data["type"] = "def_no_type" + data["type"] = "" def difference_api(api_data: dict): @@ -291,14 +291,20 @@ def processing_special_node(cursor, data, key, gn_path): # 处理需要特殊 def node_extent(cursor, current_file): start_offset = cursor.extent.start.offset end_offset = cursor.extent.end.offset + start_line = cursor.extent.start.line + end_line = cursor.extent.end.line with open(current_file, 'r', encoding='utf=8') as f: f.seek(start_offset) content = f.read(end_offset - start_offset) - + f.seek(0) + file_content_all = f.readlines() + line_content = file_content_all[start_line - 1: end_line] + line_content = ''.join(line_content) extent = { "start_offset": start_offset, "end_offset": end_offset, - "content": content + "content": content, + "line_content": line_content } f.close() return extent diff --git a/build-tools/capi_parser/src/coreImpl/parser/parser.py b/build-tools/capi_parser/src/coreImpl/parser/parser.py index 1adac3f2e..a0ecee8d2 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/parser.py +++ b/build-tools/capi_parser/src/coreImpl/parser/parser.py @@ -408,7 +408,6 @@ def complete_kit_or_system(api_message: OneFileApiMessage, json_path): def parser_direct(path): # 目录路径 file_path_list = [] link_include_path = [] # 装链接头文件路径 - copy_std_lib(link_include_path) dir_path = '' if os.path.isdir(path): link_include_path.append(path) diff --git a/build-tools/capi_parser/src/typedef/check/check.py b/build-tools/capi_parser/src/typedef/check/check.py index 44f8e8248..a77da9802 100644 --- a/build-tools/capi_parser/src/typedef/check/check.py +++ b/build-tools/capi_parser/src/typedef/check/check.py @@ -158,34 +158,34 @@ be reused please delete the extra tags.' class CheckErrorMessage(enum.Enum): - API_NAME_UNIVERSAL_01 = ('API check error of [naming errors]:The names of self-developed ' + API_NAME_UNIVERSAL_01 = ('API check error of [naming errors]:The [$$] of self-developed ' 'functions in APIs must start with OH_ or OS_ or HMS_ and comply ' 'with the large hump case format.') - API_NAME_UNIVERSAL_02 = ('API check error of [naming errors]:The names of constants in ' + API_NAME_UNIVERSAL_02 = ('API check error of [naming errors]:The [$$] of constants in ' 'APIs must be in uppercase and separated by underscores.') - API_NAME_UNIVERSAL_03 = ('API check error of [naming errors]:The naming of enumeration ' + API_NAME_UNIVERSAL_03 = ('API check error of [naming errors]:The [$$] of enumeration ' 'types should follow the big hump rule.') - API_NAME_UNIVERSAL_04 = ('API check error of [naming errors]:The naming of enumeration ' + API_NAME_UNIVERSAL_04 = ('API check error of [naming errors]:The [$$] of enumeration ' 'values should follow the all uppercase rule and separated by underscores.') - API_NAME_UNIVERSAL_05 = ('API check error of [naming errors]:The naming of struct should ' + API_NAME_UNIVERSAL_05 = ('API check error of [naming errors]:The [$$] of struct should ' 'follow the rules of the Great Hump.') - API_NAME_UNIVERSAL_06 = ('API check error of [naming errors]:The naming of members in the ' + API_NAME_UNIVERSAL_06 = ('API check error of [naming errors]:The [$$] of members in the ' 'structure should follow the small hump format.') - API_NAME_UNIVERSAL_07 = ('API check error of [naming errors]:The naming of the consortium ' - 'should follow the format of the large camel hump.') - API_NAME_UNIVERSAL_08 = ('API check error of [naming errors]:The naming of members in the ' + API_NAME_UNIVERSAL_07 = ('API check error of [naming errors]:The [$$] of the consortium ' + 'should follow the format of the Great hump.') + API_NAME_UNIVERSAL_08 = ('API check error of [naming errors]:The [$$] of members in the ' 'consortium should follow the small hump format.') - API_NAME_UNIVERSAL_09 = ('API check error of [naming errors]:The names of a global variable ' + API_NAME_UNIVERSAL_09 = ('API check error of [naming errors]:The [$$] of a global variable ' 'must be prefixed with g_ in the small camel case format.') - API_NAME_UNIVERSAL_10 = ('API check error of [naming errors]:The naming of general functions ' + API_NAME_UNIVERSAL_10 = ('API check error of [naming errors]:The [$$] of general functions ' 'should follow the big hump format.') - API_NAME_UNIVERSAL_11 = ('API check error of [naming errors]:Function parameter names should ' + API_NAME_UNIVERSAL_11 = ('API check error of [naming errors]:Function parameter [$$] should ' 'follow the small hump format.') - API_NAME_UNIVERSAL_12 = ('API check error of [naming errors]:Macro naming should follow all ' + API_NAME_UNIVERSAL_12 = ('API check error of [naming errors]:Macro [$$] should follow all ' 'uppercase format and separated by underscores.') - API_NAME_UNIVERSAL_13 = ('API check error of [naming errors]:Functional macro naming should ' + API_NAME_UNIVERSAL_13 = ('API check error of [naming errors]:Functional macro [$$] should ' 'follow all uppercase format and separated by underscores.') - API_NAME_UNIVERSAL_14 = ('API check error of [naming errors]:The file name should be all ' + API_NAME_UNIVERSAL_14 = ('API check error of [naming errors]:The [$$] file name should be all ' 'lowercase and separated by underscores.') API_DOC_GLOBAL_01 = ('API check error of [api doc errors]:The [file] tag is repeat. Please ' 'check the tag in file.') @@ -263,12 +263,16 @@ class CheckOutPut: main_buggy_code, main_buggy_line): self.analyzerName = 'apiengine' self.buggyFilePath = buggy_file_path + if code_context_start_line == -1: + code_context_start_line = 0 self.codeContextStartLine = code_context_start_line self.defectLevel = 2 self.defectType = defect_type self.description = description - self.language = 'c' + self.language = 'c++' self.mainBuggyCode = main_buggy_code + if main_buggy_line == -1: + main_buggy_line = 0 self.mainBuggyLine = main_buggy_line @@ -328,6 +332,7 @@ class OutputTxt: class ApiResultInfo: error_type: ErrorType = ErrorType.DEFAULT.value error_info = '' + error_content = '' level: ErrorLevel = -1 api_name = '' api_since = '' @@ -425,6 +430,12 @@ class ApiResultInfo: def set_location(self, location_param): self.location = location_param + def get_error_content(self): + return self.error_content + + def set_error_content(self, error_content): + self.error_content = error_content + class DocInfo: group = '' @@ -455,3 +466,9 @@ class FileDocInfo: file_since = False file_comment_str = '' curr_doc_info = DocInfo() + + +class CommentStartEndValue(enum.Enum): + DEFAULT_START = 0, + DEFAULT_END = 0 + -- Gitee From a0964597bcdfbd711f09df7be88e34e3821657f0 Mon Sep 17 00:00:00 2001 From: zhuguoyang Date: Fri, 9 Aug 2024 11:31:14 +0800 Subject: [PATCH 042/620] ffrt loop t Signed-off-by: zhuguoyang --- resourceschedule/ffrt/c/loop.h | 1 + 1 file changed, 1 insertion(+) diff --git a/resourceschedule/ffrt/c/loop.h b/resourceschedule/ffrt/c/loop.h index 443956853..95d6a8bef 100644 --- a/resourceschedule/ffrt/c/loop.h +++ b/resourceschedule/ffrt/c/loop.h @@ -43,6 +43,7 @@ /** * @brief Defines the ffrt loop type. + * * @since 12 */ typedef void* ffrt_loop_t; -- Gitee From d50b43307d25454d10db6d71dfa3a564f3dd129c Mon Sep 17 00:00:00 2001 From: yangfan Date: Fri, 9 Aug 2024 15:31:33 +0800 Subject: [PATCH 043/620] =?UTF-8?q?=E5=A2=9E=E5=8A=A0@kit=E6=A0=87?= =?UTF-8?q?=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangfan --- multimedia/image_framework/include/image/picture_native.h | 1 + 1 file changed, 1 insertion(+) diff --git a/multimedia/image_framework/include/image/picture_native.h b/multimedia/image_framework/include/image/picture_native.h index 36b012402..ddc402513 100644 --- a/multimedia/image_framework/include/image/picture_native.h +++ b/multimedia/image_framework/include/image/picture_native.h @@ -29,6 +29,7 @@ * @brief Declares the APIs that can access a picture. * * @library libpicture.so + * @kit ImageKit * @Syscap SystemCapability.Multimedia.Image.Core * @since 12 */ -- Gitee From 65f9eace4a2d41ad7fd862c14ebad4b53acd0b11 Mon Sep 17 00:00:00 2001 From: liushang Date: Fri, 9 Aug 2024 16:33:10 +0800 Subject: [PATCH 044/620] add vpe Signed-off-by: liushang --- .../image_processing.h | 314 +++++++++++++++++ .../image_processing/BUILD.gn | 35 ++ .../libimage_processing.ndk.json | 87 +++++ .../image_processing_types.h | 229 ++++++++++++ .../video_processing.h | 329 ++++++++++++++++++ .../video_processing/BUILD.gn | 35 ++ .../libvideo_processing.ndk.json | 93 +++++ .../video_processing_types.h | 278 +++++++++++++++ 8 files changed, 1400 insertions(+) create mode 100644 multimedia/video_processing_engine/image_processing.h create mode 100644 multimedia/video_processing_engine/image_processing/BUILD.gn create mode 100644 multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json create mode 100644 multimedia/video_processing_engine/image_processing_types.h create mode 100644 multimedia/video_processing_engine/video_processing.h create mode 100644 multimedia/video_processing_engine/video_processing/BUILD.gn create mode 100644 multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json create mode 100644 multimedia/video_processing_engine/video_processing_types.h diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h new file mode 100644 index 000000000..81f503ecf --- /dev/null +++ b/multimedia/video_processing_engine/image_processing.h @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup ImageProcessing + * @{ + * + * @brief Provide APIs for image quality processing. + * + * @since 12 + */ + +/** + * @file image_processing.h + * + * @brief Declare image processing functions. + * + * Provides SDR content processing for images, including color space conversion, metadata generation + * and image scaling. + * + * @library libimage_processing.so + * @syscap SystemCapability.Multimedia.VideoProcessingEngine + * @kit ImageKit + * @since 12 + */ + +#ifndef VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_H +#define VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_H + +#include +#include +#include "image_processing_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Initialize global environment for image processing. + * + * This function is optional. \n + * Typically, this function is called once when the host process is started to initialize the global environment for + * image processing, which can reduce the time of {@link OH_ImageProcessing_Create}. \n + * To deinitialize global environment, call {@link OH_ImageProcessing_DeinitializeEnvironment}. + * + * @return {@link IMAGE_PROCESSING_SUCCESS} if initialization is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INITIALIZE_FAILED} if initialization is failed. \n + * You can check if the device GPU is working properly. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_InitializeEnvironment(void); + +/** + * @brief Deinitialize global environment for image processing. + * + * This function is required if {@link OH_ImageProcessing_InitializeEnvironment} is called. Typically, this + * function is called when the host process is about to exit to deinitialize the global environment, which is + * initialized by calling {@link OH_ImageProcessing_InitializeEnvironment}. \n + * If there is some image processing instance existing, this function should not be called. \n + * If the {@link OH_ImageProcessing_InitializeEnvironment} is not called, this function should not be called. + * + * @return {@link IMAGE_PROCESSING_SUCCESS} if deinitialization is successful. \n + * {@link IMAGE_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if some image processing instance is not destroyed or + * {@link OH_ImageProcessing_InitializeEnvironment} is not called. \n + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_DeinitializeEnvironment(void); + +/** + * @brief Query whether the image color space conversion is supported. + * + * @param sourceImageInfo Input image color space information pointer. + * @param destinationImageInfo Output image color space information pointer. + * @return true if the color space conversion is supported. \n + * false if the the color space conversion is unsupported. + * @since 12 + */ +bool OH_ImageProcessing_IsColorSpaceConversionSupported( + const ImageProcessing_ColorSpaceInfo* sourceImageInfo, + const ImageProcessing_ColorSpaceInfo* destinationImageInfo); + +/** + * @brief Query whether the image composition is supported. + * + * @param sourceImageInfo Input image color space information pointer. + * @param sourceGainmapInfo Input gainmap color space information pointer. + * @param destinationImageInfo Output image color space information pointer. + * @return true if the image composition is supported. \n + * false if the image composition is unsupported. + * @since 12 + */ +bool OH_ImageProcessing_IsCompositionSupported( + const ImageProcessing_ColorSpaceInfo* sourceImageInfo, + const ImageProcessing_ColorSpaceInfo* sourceGainmapInfo, + const ImageProcessing_ColorSpaceInfo* destinationImageInfo); + +/** + * @brief Query whether the image decomposition is supported. + * + * @param sourceImageInfo Input image color space information pointer. + * @param destinationImageInfo Output image color space information pointer. + * @param destinationGainmapInfo Output gainmap information pointer. + * @return true if the image decomposition is supported. \n + * false if the image decomposition is unsupported. + * @since 12 + */ +bool OH_ImageProcessing_IsDecompositionSupported( + const ImageProcessing_ColorSpaceInfo* sourceImageInfo, + const ImageProcessing_ColorSpaceInfo* destinationImageInfo, + const ImageProcessing_ColorSpaceInfo* destinationGainmapInfo); + +/** + * @brief Query whether the image metadata generation is supported. + * + * @param sourceImageInfo Input image color space information pointer. + * @return true if the image metadata generation is supported.. \n + * false if the image metadata generation is unsupported. + * @since 12 + */ +bool OH_ImageProcessing_IsMetadataGenerationSupported( + const ImageProcessing_ColorSpaceInfo* sourceImageInfo); + +/** + * @brief Create an image processing instance. + * + * @param imageProcessor Output parameter. The *imageProcessor points to a new image processing object. + * The *imageProcessor must be null before passed in. + * @param type Use IMAGE_PROCESSING_TYPE_XXX to specify the processing type. The processing type of the instance can not + * be changed. + * @return {@link IMAGE_PROCESSING_SUCCESS} if creating an image processing successfully. \n + * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the type is not supported. For example, if metadata + * generation is not supported by vendor, it returns unsupported processing. \n + * {@link IMAGE_PROCESSING_ERROR_CREATE_FAILED} if failed to create an image processing. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or *instance is not null. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if type is invalid. \n + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** imageProcessor, int32_t type); + +/** + * @brief Destroy the image processing instance. + * + * @param imageProcessor An image processing instance pointer. It is recommended setting the + * instance pointer to null after the instance is destroyed. + * @return {@link IMAGE_PROCESSING_SUCCESS} if the instance is destroyed successfully. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* imageProcessor); + +/** + * @brief Set parameter for image processing. + * + * Add parameter identified by the specified parameter key. + * + * @param imageProcessor An image processing instance pointer. + * @param parameter The parameter for image processing. + * @return {@link IMAGE_PROCESSING_SUCCESS} if setting parameter is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_VALUE} if some property of the parameter is invalid. For example, the parameter + * contains unsupported parameter key or value. \n + * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter(OH_ImageProcessing* imageProcessor, + const OH_AVFormat* parameter); + +/** + * @brief Get parameter of image processing. + * + * Get parameter identified by the specified parameter key. + * + * @param imageProcessor An image processing instance pointer. + * @param parameter The parameter used by the image processing instance. + * @return {@link IMAGE_PROCESSING_SUCCESS} if getting parameter is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* imageProcessor, + OH_AVFormat* parameter); + +/** + * @brief Conversion between single-layer images. + * + * The function generate the destinationImage from sourceImage. It include the colorspace conversion from + * HDR image to SDR image, SDR image to HDR image, SDR image to SDR image and HDR image to HDR image. + * + * @param imageProcessor An image processing instance pointer. The instance should be created with + * type {@link IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION}. + * @param sourceImage Input image pointer. + * @param destinationImage Output image pointer. + * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the image is null. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_VALUE} if some property of image is invalid. For example, the color space + * of the image is unsupported. \n + * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n + * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n + * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessing* imageProcessor, + OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage); + +/** + * @brief Composition from dual-layer HDR images to single-layer HDR images. + * + * The function generate the destinationImage from sourceImage and sourceGainmap. + * + * @param imageProcessor An image processing instance pointer. The instance should be created with + * type {@link IMAGE_PROCESSING_TYPE_COMPOSITION}. + * @param sourceImage Input image pointer. + * @param sourceGainmap Input gainmap pointer. + * @param destinationImage Output image pointer. + * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the image is null. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_VALUE} if some property of image is invalid. For example, the color space + * of the image is unsupported. \n + * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n + * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n + * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* imageProcessor, + OH_PixelmapNative* sourceImage, OH_PixelmapNative* sourceGainmap, OH_PixelmapNative* destinationImage); + +/** + * @brief Decomposition from single-layer HDR images to dual-layer HDR images. + * + * The function generate the destinationImage and destinationGainmap from sourceImage. + * + * @param imageProcessor An image processing instance pointer. The instance should be created with + * type {@link IMAGE_PROCESSING_TYPE_DECOMPOSITION}. + * @param sourceImage Input image pointer. + * @param destinationImage Output image pointer. + * @param destinationGainmap Output gainmap pointer. + * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the image is null. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_VALUE} if some property of image is invalid. For example, the color space + * of the image is unsupported. \n + * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n + * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n + * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_Decompose(OH_ImageProcessing* imageProcessor, + OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage, OH_PixelmapNative* destinationGainmap); + +/** + * @brief Metadata Generation for HDR images. + * + * The function generate metadata for the sourceImage. + * + * @param imageProcessor An image processing instance pointer. The instance should be created with + * type {@link IMAGE_PROCESSING_TYPE_METADATA_GENERATION}. + * @param sourceImage Input image pointer. + * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the image is null. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_VALUE} if some property of image is invalid. For example, the color space + * of the image is unsupported. \n + * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n + * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n + * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing* imageProcessor, + OH_PixelmapNative* sourceImage); + +/** + * @brief Clarity enhancement for images. + * + * The function generate the destinationImage from sourceImage with necessary scaling operation according to the size + * preset in the sourceImage and destinationImage. Different levels of scaling methonds are provided to balance + * performance and image quality. + * + * @param imageProcessor An image processing instance pointer. The instance should be created with + * type {@link IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER}. + * @param sourceImage Input image pointer. + * @param destinationImage Output image pointer. + * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the image is null. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_VALUE} if some property of image is invalid. For example, the color space + * of the image is unsupported. \n + * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n + * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n + * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_EnhanceDetail(OH_ImageProcessing* imageProcessor, + OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage); +#ifdef __cplusplus +} +#endif + +#endif // VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_H +/** @} */ diff --git a/multimedia/video_processing_engine/image_processing/BUILD.gn b/multimedia/video_processing_engine/image_processing/BUILD.gn new file mode 100644 index 000000000..d3c02809b --- /dev/null +++ b/multimedia/video_processing_engine/image_processing/BUILD.gn @@ -0,0 +1,35 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_headers("image_processing_ndk_headers") { + dest_dir = "$ndk_headers_out_dir/multimedia/video_processing_engine" + sources = [ + "../image_processing.h", + "../image_processing_types.h", + ] +} + +ohos_ndk_library("libimage_processing_ndk") { + ndk_description_file = "./libimage_processing.ndk.json" + output_name = "image_processing" + output_extension = "so" + min_compact_version = "12" + system_capability = "SystemCapability.Multimedia.VideoProcessingEngine" + system_capability_headers = [ + "multimedia/video_processing_engine/image_processing_types.h", + "multimedia/video_processing_engine/image_processing.h", + ] +} diff --git a/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json b/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json new file mode 100644 index 000000000..8cb58693c --- /dev/null +++ b/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json @@ -0,0 +1,87 @@ +[ + { + "first_introduced": "12", + "name": "OH_ImageProcessing_InitializeEnvironment" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_DeinitializeEnvironment" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_IsColorSpaceConversionSupported" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_IsCompositionSupported" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_IsDecompositionSupported" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_IsMetadataGenerationSupported" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_Create" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_SetParameter" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_GetParameter" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_ConvertColorSpace" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_Compose" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_Decompose" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_GenerateMetadata" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_EnhanceDetail" + }, + { + "first_introduced": "12", + "name": "IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION", + "type": "variable" + }, + { + "first_introduced": "12", + "name": "IMAGE_PROCESSING_TYPE_COMPOSITION", + "type": "variable" + }, + { + "first_introduced": "12", + "name": "IMAGE_PROCESSING_TYPE_DECOMPOSITION", + "type": "variable" + }, + { + "first_introduced": "12", + "name": "IMAGE_PROCESSING_TYPE_METADATA_GENERATION", + "type": "variable" + }, + { + "first_introduced": "12", + "name": "IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER", + "type": "variable" + } +] diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h new file mode 100644 index 000000000..46f8d249c --- /dev/null +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup ImageProcessing + * @{ + * + * @brief Provide image processing including color space conversion and metadata generation. + * + * @since 12 + */ + +/** + * @file image_processing_types.h + * + * @brief Type definitions for image processing. + * + * @library libimage_processing.so + * @syscap SystemCapability.Multimedia.VideoProcessingEngine + * @kit ImageKit + * @since 12 + */ + +#ifndef VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_TYPES_H +#define VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_TYPES_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Define the object for image processing. + * + * Define a null pointer of OH_ImageProcessing and call {@link OH_ImageProcessing_Create} to create an image processing + * instance. The pointer should be null before creating instance. + * User can create multiple image processing instances for different processing types. + * + * @since 12 + */ +typedef struct OH_ImageProcessing OH_ImageProcessing; + +/** + * @brief Forward declaration of OH_PixelmapNative. + * + * @since 12 + */ +typedef struct OH_PixelmapNative OH_PixelmapNative; + +/** + * @brief Forward declaration of OH_AVFormat. + * + * @since 12 + */ +typedef struct OH_AVFormat OH_AVFormat; + +/** + * @brief Used to create an image processing instance for color space conversion. + * + * Color space conversion includes the conversion of single-layer HDR images to SDR images, as well as + * the color space conversion of SDR images, and the conversion of SDR images to single-layer HDR images. Some + * capabilities are supported by vendor. Use {@link OH_ImageProcessing_IsColorSpaceConversionSupported} to query if + * the conversion is supported between single-layer images. + * + * @see OH_ImageProcessing_Create + * @since 12 + */ +extern const int32_t IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION; + +/** + * @brief Used to create an image processing instance for HDR image composition. + * + * HDR image compose includes the conversion from dual-layer HDR images to single-layer HDR images. Some + * capabilities are supported by vendor. Use {@link OH_ImageProcessing_IsCompositionSupported} to + * query if the composition is supported from dual-layer HDR image to single-layer HDR image. + * + * @see OH_ImageProcessing_Create + * @since 12 + */ +extern const int32_t IMAGE_PROCESSING_TYPE_COMPOSITION; + +/** + * @brief Used to create an image processing instance for HDR image decomposition. + * + * HDR image decompose includes the conversion from single-layer HDR images to dual-layer HDR images. Some + * capabilities are supported by vendor. Use {@link OH_ImageProcessing_IsDecompositionSupported} to + * query if the decomposition is supported from single-layer image to dual-layer HDR image. + * + * @see OH_ImageProcessing_Create + * @since 12 + */ +extern const int32_t IMAGE_PROCESSING_TYPE_DECOMPOSITION; + +/** + * @brief Used to create an image processing instance for metadata generation. + * + * Generate HDR Vivid metadata for single-layer image. The capability is supported by vendor. If the capability is not + * supported, {@link OH_ImageProcessing_Create} returns {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING}. + * + * @see OH_ImageProcessing_Create + * @since 12 + */ +extern const int32_t IMAGE_PROCESSING_TYPE_METADATA_GENERATION; + +/** + * @brief Used to create an image processing instance for detail enhancement. + * + * Scale or resize images with the specified quality or just enhance details for rendering an image without changing + * its resolution. + * + * @see OH_ImageProcessing_Create + * @since 12 + */ +extern const int32_t IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER; + +/** + * @brief The key is used to specify the quality level for image detail enhancement. + * + * See {@link ImageDetailEnhancer_QualityLevel} for its value. + * Use {@link OH_ImageProcessing_SetParameter} to set the quality level. + * Use {@link OH_ImageProcessing_GetParameter} to get the current quality level. + * + * @see OH_VideoProcessing_SetParameter + * @see OH_VideoProcessing_GetParameter + * @since 12 + */ +extern const char* IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL; + +/** + * @brief The color space information is used for color space conversion capability query. + * + * @see OH_ImageProcessing_IsColorSpaceConversionSupported + * @see OH_ImageProcessing_IsCompositionSupported + * @see OH_ImageProcessing_IsDecompositionSupported + * @since 12 + */ +typedef struct ImageProcessing_ColorSpaceInfo { + /** define metadata type */ + int32_t metadataType; + /** define color space, {@link enum OH_NativeBuffer_ColorSpace} */ + int32_t colorSpace; + /** define pixel format, {@link enum OH_NativeBuffer_Format} */ + int32_t pixelFormat; +} ImageProcessing_ColorSpaceInfo; + +/** + * @brief The quality level is used for detail enhancement. + * + * It is the value of the key parameter {@link IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL}. + * + * @see OH_ImageProcessing_SetParameter + * @see OH_ImageProcessing_GetParameter + * @since 12 + */ +typedef enum ImageDetailEnhancer_QualityLevel { + /** No detail enhancement */ + IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_NONE, + /** A low level of detail enhancement quality but with a fast speed. It's the default level */ + IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_LOW, + /** A medium level of detail enhancement quality. Its speed is between the low setting and high setting */ + IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_MEDIUM, + /** A high level of detail enhancement quality but with a relatively slow speed */ + IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_HIGH, +} ImageDetailEnhancer_QualityLevel; + +/** + * @brief Image processing error code. + * + * @since 12 + */ +typedef enum ImageProcessing_ErrorCode { + /** @error Operation is successful. */ + IMAGE_PROCESSING_SUCCESS, + /** @error Input parameter is invalid. This error is returned for all of the following error conditions: + * 1 - Invalid input or output image buffer - The image buffer is null. + * 2 - Invalid parameter - The parameter is null. + * 3 - Invalid type - The type passed in the create function does not exist. + */ + IMAGE_PROCESSING_ERROR_INVALID_PARAMETER = 401, + /** @error Some unknown error occurred, such as GPU calculation failure or memcpy failure. */ + IMAGE_PROCESSING_ERROR_UNKNOWN = 29200001, + /** @error The global environment initialization for image processing failed, such as failure to initialize + * the GPU environment. + */ + IMAGE_PROCESSING_ERROR_INITIALIZE_FAILED, + /** @error Failed to create image processing instance. For example, + * the number of instances exceeds the upper limit. + */ + IMAGE_PROCESSING_ERROR_CREATE_FAILED, + /** @error Failed to process image buffer. For example, the processing times out. */ + IMAGE_PROCESSING_ERROR_PROCESS_FAILED, + /** @error The processing is not supported. You may call OH_ImageProcessing_IsXXXSupported + * to check whether the capability is supported. + */ + IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING, + /** @error The operation is not permitted. This may be caused by incorrect status. */ + IMAGE_PROCESSING_ERROR_OPERATION_NOT_PERMITTED, + /** @error Out of memory. */ + IMAGE_PROCESSING_ERROR_NO_MEMORY, + /** @error The image processing instance is invalid. This may be caused by null instance. */ + IMAGE_PROCESSING_ERROR_INVALID_INSTANCE, + /** @error Input parameter is invalid. This error is returned for all of the following error conditions: + * 1 - Invalid input or output image buffer - The image buffer width(height) + * is too large or colorspace is incorrect. + * 2 - Invalid parameter - The parameter does not contain valid information, + * such as detail enhancer level is incorrect. + */ + IMAGE_PROCESSING_ERROR_INVALID_VALUE +} ImageProcessing_ErrorCode; + +#ifdef __cplusplus +} +#endif + +#endif // VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_TYPES_H +/** @} */ diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h new file mode 100644 index 000000000..7c22782c6 --- /dev/null +++ b/multimedia/video_processing_engine/video_processing.h @@ -0,0 +1,329 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup VideoProcessing + * @{ + * + * @brief Provide APIs for video quality processing. + * + * @since 12 + */ + +/** + * @file video_processing.h + * + * @brief Declare video processing functions. + * + * Provides SDR content processing for videos, including color space conversion, metadata generation + * and video scaling. + * + * @library libvideo_processing.so + * @syscap SystemCapability.Multimedia.VideoProcessingEngine + * @kit MediaKit + * @since 12 + */ + +#ifndef VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_H +#define VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_H + +#include +#include +#include "video_processing_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Initialize global environment for video processing. + * + * This function is optional. \n + * Typically, this function is called once when the host process is started to initialize the global environment for + * video processing, which can reduce the time of {@link OH_VideoProcessing_Create}. \n + * To deinitialize global environment, call {@link OH_VideoProcessing_DeinitializeEnvironment}. + * + * @return {@link VIDEO_PROCESSING_SUCCESS} if initialization is successful. \n + * {@link VIDEO_PROCESSING_ERROR_INITIALIZE_FAILED} if initialization is failed. \n + * You can check if the device GPU is working properly. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_InitializeEnvironment(void); + +/** + * @brief Deinitialize global environment for video processing. + * + * This function is required if {@link OH_VideoProcessing_InitializeEnvironment} is called. Typically, this + * function is called when the host process is about to exit to deinitialize the global environment, which is + * initialized by calling {@link OH_VideoProcessing_InitializeEnvironment}. \n + * If there is some video processing instance existing, this function should not be called. \n + * If the {@link OH_VideoProcessing_InitializeEnvironment} is not called, this function should not be called. + * + * @return {@link VIDEO_PROCESSING_SUCCESS} if deinitialization is successful. \n + * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if some video processing instance is not destroyed or + * {@link OH_VideoProcessing_InitializeEnvironment} is not called. \n + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_DeinitializeEnvironment(void); + +/** + * @brief Query if the video color space conversion is supported. + * + * @param sourceVideoInfo Source video color space information. + * @param destinationVideoInfo Destination video color space information. + * @return true if the video color space conversion is supported. \n + * false if the video color space conversion is not supported. + * @since 12 + */ +bool OH_VideoProcessing_IsColorSpaceConversionSupported( + const VideoProcessing_ColorSpaceInfo* sourceVideoInfo, + const VideoProcessing_ColorSpaceInfo* destinationVideoInfo); + +/** + * @brief Query if the video metadata generation is supported. + * + * @param sourceVideoInfo Source video color space information. + * @return true if the video metadata generation is supported. \n + * false if the video metadata generation is not supported. + * @since 12 + */ +bool OH_VideoProcessing_IsMetadataGenerationSupported( + const VideoProcessing_ColorSpaceInfo* sourceVideoInfo); + +/** + * @brief Create a video processing instance. + * + * @param videoProcessor Output parameter. The *videoProcessor points to a new video processing object. + * The *videoProcessor must be null before passed in. + * @param type Use VIDEO_PROCESSING_TYPE_XXX to specify the processing type. The processing type of the instance can not + * be changed. + * @return {@link VIDEO_PROCESSING_SUCCESS} if creating a video processing instance successfully. \n + * {@link VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the type is not supported. For example, if metadata + * generation is not supported by vendor, it returns unsupported processing. \n + * {@link VIDEO_PROCESSING_ERROR_CREATE_FAILED} if failed to create a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or *instance is not null. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if type is invalid. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_Create(OH_VideoProcessing** videoProcessor, int type); + +/** + * @brief Destroy the video processing instance. + * + * Stop the instance before destroying it. see {@link OH_VideoProcessing_Stop}. \n + * + * @param videoProcessor The video processing instance pointer to be destroyed. It is recommended setting the + * instance pointer to null after the instance is destroyed. + * @return {@link VIDEO_PROCESSING_SUCCESS} if the instance is destroyed successfully . \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if the instance is still running. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_Destroy(OH_VideoProcessing* videoProcessor); + +/** + * @brief Register callback object. + * + * Register the callback object before starting video processing. + * + * @param videoProcessor A video processing instance pointer. + * @param callback Callback pointer to be registered. + * @param userData User's custom data pointer. + * @return {@link VIDEO_PROCESSING_SUCCESS} if callback is registered successfully. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if callback is null. \n + * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if video processing instance is running. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_RegisterCallback(OH_VideoProcessing* videoProcessor, + const VideoProcessing_Callback* callback, void* userData); + +/** + * @brief Set the output surface for video processing. + * + * Set the output surface before starting video processing. + * + * @param videoProcessor A video processing instance pointer. + * @param window The output surface pointer. + * @return {@link VIDEO_PROCESSING_SUCCESS} if setting output surface successfully. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if window is null. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_SetSurface(OH_VideoProcessing* videoProcessor, + const OHNativeWindow* window); + +/** + * @brief Create an input surface. + * + * Create the input surface before starting video processing. + * Call {@link OH_NativeWindow_DestroyNativeWindow} to destroy the input surface. + * + * @param videoProcessor A video processing instance pointer. + * @param window The input surface pointer. For example, it is the output surface of a video decoder. + * @return {@link VIDEO_PROCESSING_SUCCESS} if operation is successful. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if window is null or *window is not null. \n + * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if creating surface failed, input surface is already created + * or video processing instance is running. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_GetSurface(OH_VideoProcessing* videoProcessor, OHNativeWindow** window); + +/** + * @brief Set parameter for video processing. + * + * Add parameter identified by the specified parameter key. + * + * @param videoProcessor An video processing instance pointer. + * @param parameter The parameter for video processing. + * @return {@link VIDEO_PROCESSING_SUCCESS} if setting parameter is successful. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_VALUE} if some property of the parameter is invalid. For example, the parameter + * contains unsupported parameter key or value. \n + * {@link VIDEO_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_SetParameter(OH_VideoProcessing* videoProcessor, + const OH_AVFormat* parameter); + +/** + * @brief Get parameter of video processing. + * + * Get parameter identified by the specified parameter key. + * + * @param videoProcessor An video processing instance pointer. + * @param parameter The parameter used by the video processing instance. + * @return {@link VIDEO_PROCESSING_SUCCESS} if getting parameter is successful. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_GetParameter(OH_VideoProcessing* videoProcessor, OH_AVFormat* parameter); + +/** + * @brief Start video processing instance. + * + * After successfully calling this function, the state {@link VIDEO_PROCESSING_STATE_RUNNING} is reported by callback + * function {@link OH_VideoProcessingCallback_OnState}. + * + * @param videoProcessor A video processing instance pointer. + * @return {@link VIDEO_PROCESSING_SUCCESS} if the operation is successful. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if output surface is not set, input surface is not created or + * instance is already running. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_Start(OH_VideoProcessing* videoProcessor); + +/** + * @brief To stop video processing instance. + * + * After the video processing instance is stopped successfully, the state {@link VIDEO_PROCESSING_STATE_STOPPED} is + * reported by callback function {@link OH_VideoProcessing_OnState}. + * + * @param videoProcessor A video processing instance pointer. + * @return {@link VIDEO_PROCESSING_SUCCESS} if the operation is successful. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if instance is already stopped. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_Stop(OH_VideoProcessing* videoProcessor); + +/** + * @brief Send the output buffer out. + * + * If the callback function {@link OH_VideoProcessingCallback_OnNewOutputBuffer} is set, the buffer's index is reported + * to user by the callback function when an output buffer is ready. + * + * @param videoProcessor A video processing instance pointer. + * @param index The output buffer's index. + * @return {@link VIDEO_PROCESSING_SUCCESS} if the operation is successful. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if index is invalid. \n + * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if callback {@link OH_VideoProcessing_OnNewOutputBuffer} is + * not set or instance is stopped. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_RenderOutputBuffer(OH_VideoProcessing* videoProcessor, uint32_t index); + +/** + * @brief Create a video processing callback object. + * + * @param callback Output parameter. The *callback points to a new callback object. The *callback should be null before + * creating the callback object. + * @return {@link VIDEO_PROCESSING_SUCCESS} if callback object is created successfully. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if callback is null or *callback is not null. \n + * {@link VIDEO_PROCESSING_ERROR_NO_MEMORY} if out of memory. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessingCallback_Create(VideoProcessing_Callback** callback); + +/** + * @brief Destroy the callback object. + * + * The callback object can be destroyed after it is registered to video processing instance. + * + * @param callback The callback object pointer. It is recommended setting the callback pointer to null after the + * callback object is destroyed. + * @return {@link VIDEO_PROCESSING_SUCCESS} if callback is successfully destroyed. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if callback is null. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessingCallback_Destroy(VideoProcessing_Callback* callback); + +/** + * @brief Bind the {@link OH_VideoProcessingCallback_OnError} callback function to callback object. + * + * @param callback A callback object pointer. + * @param onError The callback function. + * @return {@link VIDEO_PROCESSING_SUCCESS} if the function is bound to callback object successfully. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if the callback is null or onError is null. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessingCallback_BindOnError(VideoProcessing_Callback* callback, + OH_VideoProcessingCallback_OnError onError); + +/** + * @brief Bind the {@link OH_VideoProcessingCallback_OnState} callback function to callback object. + * + * @param callback A callback object pointer. + * @param onState The callback function. + * @return {@link VIDEO_PROCESSING_SUCCESS} if the function is bound to callback object successfully. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if the callback is null or onState is null. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessingCallback_BindOnState(VideoProcessing_Callback* callback, + OH_VideoProcessingCallback_OnState onState); + +/** + * @brief Bind the {@link OH_VideoProcessingCallback_OnNewOutputBuffer} callback function to callback object. + * + * @param callback A callback object pointer. + * @param onNewOutputBuffer The callback function. + * @return {@link VIDEO_PROCESSING_SUCCESS} if the function is bound to callback object successfully. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if the callback is null. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessingCallback_BindOnNewOutputBuffer(VideoProcessing_Callback* callback, + OH_VideoProcessingCallback_OnNewOutputBuffer onNewOutputBuffer); + +#ifdef __cplusplus +} +#endif + +#endif // VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_H +/** @} */ diff --git a/multimedia/video_processing_engine/video_processing/BUILD.gn b/multimedia/video_processing_engine/video_processing/BUILD.gn new file mode 100644 index 000000000..0dc56d025 --- /dev/null +++ b/multimedia/video_processing_engine/video_processing/BUILD.gn @@ -0,0 +1,35 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_headers("video_processing_ndk_headers") { + dest_dir = "$ndk_headers_out_dir/multimedia/video_processing_engine" + sources = [ + "../video_processing.h", + "../video_processing_types.h", + ] +} + +ohos_ndk_library("libvideo_processing_ndk") { + ndk_description_file = "./libvideo_processing.ndk.json" + output_name = "video_processing" + output_extension = "so" + min_compact_version = "12" + system_capability = "SystemCapability.Multimedia.VideoProcessingEngine" + system_capability_headers = [ + "multimedia/video_processing_engine/video_processing_types.h", + "multimedia/video_processing_engine/video_processing.h", + ] +} diff --git a/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json b/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json new file mode 100644 index 000000000..dd2fe35ab --- /dev/null +++ b/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json @@ -0,0 +1,93 @@ +[ + { + "first_introduced": "12", + "name": "OH_VideoProcessing_InitializeEnvironment" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_DeinitializeEnvironment" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_IsColorSpaceConversionSupported" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_IsMetadataGenerationSupported" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_Create" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_RegisterCallback" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_SetSurface" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_GetSurface" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_SetParameter" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_GetParameter" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_Start" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_Stop" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_RenderOutputBuffer" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessingCallback_Create" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessingCallback_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessingCallback_BindOnError" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessingCallback_BindOnState" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessingCallback_BindOnNewOutputBuffer" + }, + { + "first_introduced": "12", + "name": "VIDEO_PROCESSING_TYPE_COLOR_SPACE_CONVERSION", + "type": "variable" + }, + { + "first_introduced": "12", + "name": "VIDEO_PROCESSING_TYPE_METADATA_GENERATION", + "type": "variable" + }, + { + "first_introduced": "12", + "name": "VIDEO_PROCESSING_TYPE_DETAIL_ENHANCER", + "type": "variable" + } +] diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h new file mode 100644 index 000000000..51611e9ac --- /dev/null +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup VideoProcessing + * @{ + * + * @brief Provide video processing including color space conversion and metadata generation. + * + * @since 12 + */ + +/** + * @file video_processing_types.h + * + * @brief Type definitions for video processing. + * + * @library libvideo_processing.so + * @syscap SystemCapability.Multimedia.VideoProcessingEngine + * @kit MediaKit + * @since 12 + */ + +#ifndef VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_TYPES_H +#define VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_TYPES_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Define the video processing object. + * + * Define a null pointer of OH_VideoProcessing and call {@link OH_VideoProcessing_Create} to create a video processing + * instance. The pointer should be null before creating instance. + * User can create multiple video processing instances for different processing types. + * + * @since 12 + */ +typedef struct OH_VideoProcessing OH_VideoProcessing; + +/** + * @brief Forward declaration of NativeWindow. + * + * @since 12 + */ +typedef struct NativeWindow OHNativeWindow; + +/** + * @brief Forward declaration of OH_AVFormat. + * + * @since 12 + */ +typedef struct OH_AVFormat OH_AVFormat; + +/** + * @brief Used to create a video processing instance for color space conversion. + * + * Some capabilities are supported by vendor. Use {@link OH_VideoProcessing_IsColorSpaceConversionSupported} to query if + * the conversion is supported. + * + * @see OH_VideoProcessing_Create + * @since 12 + */ +extern const int32_t VIDEO_PROCESSING_TYPE_COLOR_SPACE_CONVERSION; + +/** + * @brief Used to create a video processing instance for metadata generation. + * + * Generate HDR vivid metadata for video. The capability is supported by vendor. If the capability is not supported, + * {@link OH_VideoProcessing_Create} returns {@link VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING}. + * + * @see OH_VideoProcessing_Create + * @since 12 + */ +extern const int32_t VIDEO_PROCESSING_TYPE_METADATA_GENERATION; + +/** + * @brief Used to create an video processing instance of detail enhancement. + * + * Scale or resize video with the specified quality or just enhance details for rendering without changing its + * resolution. + * + * @see OH_ImageProcessing_Create + * @since 12 + */ +extern const int32_t VIDEO_PROCESSING_TYPE_DETAIL_ENHANCER; + +/** + * @brief The key is used to specify the quality level for video detail enhancement. + * + * See {@link VideoDetailEnhancer_QualityLevel} for its values. + * Use {@link OH_VideoProcessing_SetParameter} to set the quality level. + * Use {@link OH_VideoProcessing_GetParameter} to get the current quality level. + * + * @see OH_VideoProcessing_SetParameter + * @see OH_VideoProcessing_GetParameter + * @since 12 + */ +extern const char* VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL; + +/** + * @brief Video color space information structure of querying if video color space conversion is supported. + * + * @see OH_VideoProcessing_IsColorSpaceConversionSupported + * @since 12 + */ +typedef struct VideoProcessing_ColorSpaceInfo { + /** The metadata type of the video, see {@link enum OH_NativeBuffer_MetadataType} */ + int32_t metadataType; + /** The color space type of the video, see {@link enum OH_NativeBuffer_ColorSpace} */ + int32_t colorSpace; + /** The pixel format of the video, see {@link enum OH_NativeBuffer_Format} */ + int32_t pixelFormat; +} VideoProcessing_ColorSpaceInfo; + +/** + * @brief The quality level is used for detail enhancement. + * + * It is the value of the key parameter {@link VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL}. + * + * @see OH_VideoProcessing_SetParameter + * @see OH_VideoProcessing_GetParameter + * @since 12 + */ +typedef enum VideoDetailEnhancer_QualityLevel { + /** No detail enhancement */ + VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_NONE, + /** A low level of detail enhancement quality but with a fast speed. It's the default level */ + VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_LOW, + /** A medium level of detail enhancement quality. Its speed is between the low setting and high setting */ + VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_MEDIUM, + /** A high level of detail enhancement quality but with a relatively slow speed */ + VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_HIGH, +} VideoDetailEnhancer_QualityLevel; + +/** + * @brief Video processing error code. + * + * @since 12 + */ +typedef enum VideoProcessing_ErrorCode { + /** @error Operation is successful. */ + VIDEO_PROCESSING_SUCCESS, + /** @error Input parameter is invalid. This error is returned for all of the following error conditions: + * 1 - Invalid input or output video buffer - The video buffer is null. + * 2 - Invalid parameter - The parameter is null. + * 3 - Invalid type - The type passed in the create function does not exist. + */ + VIDEO_PROCESSING_ERROR_INVALID_PARAMETER = 401, + /** @error Some unknown error occurred, such as GPU calculation failure or memcpy failure. */ + VIDEO_PROCESSING_ERROR_UNKNOWN = 29210001, + /** @error The global environment initialization for video processing failed, such as failure to initialize + * the GPU environment. + */ + VIDEO_PROCESSING_ERROR_INITIALIZE_FAILED, + /** @error Failed to create video processing instance. For example, + * the number of instances exceeds the upper limit. + */ + VIDEO_PROCESSING_ERROR_CREATE_FAILED, + /** @error Failed to process video buffer. For example, the processing times out. */ + VIDEO_PROCESSING_ERROR_PROCESS_FAILED, + /** @error The processing is not supported. You may call OH_VideoProcessing_IsXXXSupported + * to check whether the capability is supported. + */ + VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING, + /** @error The operation is not permitted. This may be caused by incorrect status. */ + VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED, + /** @error Out of memory. */ + VIDEO_PROCESSING_ERROR_NO_MEMORY, + /** @error The video processing instance is invalid. This may be caused by null instance. */ + VIDEO_PROCESSING_ERROR_INVALID_INSTANCE, + /** @error Input parameter is invalid. This error is returned for all of the following error conditions: + * 1 - Invalid input or output video buffer - The video buffer width(height) + * is too large or colorspace is incorrect. + * 2 - Invalid parameter - The parameter does not contain valid information, + * such as detail enhancer level is incorrect. + */ + VIDEO_PROCESSING_ERROR_INVALID_VALUE +} VideoProcessing_ErrorCode; + +/** + * @brief Video processing states. + * + * The state is reported to user by callback function {@link OH_VideoProcessing_OnState}. + * + * @since 12 + */ +typedef enum VideoProcessing_State { + /** Video processing is running */ + VIDEO_PROCESSING_STATE_RUNNING, + /** Video processing is stopped */ + VIDEO_PROCESSING_STATE_STOPPED +} VideoProcessing_State; + +/** + * @brief Video processing asynchronous callback object type. + * + * Define a null pointer of VideoProcessing_Callback and call {@link OH_VideoProcessingCallback_Create} to create a + * callback object. The pointer should be null before creating the callback object. + * Register the callback to a video processing instance by calling {@link OH_VideoProcessing_RegisterCallback}. + * + * @since 12 + */ +typedef struct VideoProcessing_Callback VideoProcessing_Callback; + +/** + * @brief The callback function pointer definition for reporting error during video processing. + * + * Errors: \n + * {@link VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING}, the processing is not supported. For example, the + * color space conversion according to the source and destination videos' properties is not supported. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_VALUE}, some property of the video is invalid. For example, the color space of + * the video is invalid. \n + * {@link VIDEO_PROCESSING_ERROR_NO_MEMORY}, out of memory. \n + * {@link VIDEO_PROCESSING_ERROR_PROCESS_FAILED}, some processing error occurs. \n + * For more errors, see {@link VideoProcessing_ErrorCode}. + * + * @param videoProcessor The video processing instance. + * @param error Error code reporting to user. + * @param userData User's custom data. + * @since 12 + */ +typedef void (*OH_VideoProcessingCallback_OnError)(OH_VideoProcessing* videoProcessor, + VideoProcessing_ErrorCode error, void* userData); + +/** + * @brief The callback function pointer definition for reporting video processing state. + * + * The state will be {@link VIDEO_PROCESSING_STATE_RUNNING} after {@link OH_VideoProcessing_Start} is called + * successfully. + * The state will be {@link VIDEO_PROCESSING_STATE_STOPPED} after all the buffers cached before + * {@link OH_VideoProcessing_Stop} is called are processed. + * + * @param videoProcessor The video processing instance. + * @param state see {@link VideoProcessing_State}. + * @param userData User's custom data. + * @since 12 + */ +typedef void (*OH_VideoProcessingCallback_OnState)(OH_VideoProcessing* videoProcessor, VideoProcessing_State state, + void* userData); + +/** + * @brief The callback function pointer definition for reporting a new output buffer is filled with processed data. + * + * Every new output buffer's index will report to user once the buffer is filled with processed data. Then call + * {@link OH_VideoProcessing_RenderOutputBuffer} with the buffer's index to send the output buffer out. + * If this function is not registered, the output buffer is sent out as soon as the buffer is filled with processed + * data without reporting. + * + * @param videoProcessor The video processing instance. + * @param index The index of the new output buffer. + * @param userData The user's custom data. + * @since 12 + */ +typedef void (*OH_VideoProcessingCallback_OnNewOutputBuffer)(OH_VideoProcessing* videoProcessor, uint32_t index, + void* userData); + +#ifdef __cplusplus +} +#endif + +#endif // VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_TYPES_H +/** @} */ -- Gitee From 6e4d3aa45019d1d814a4d3b6d7d77d44d5b5ad85 Mon Sep 17 00:00:00 2001 From: liushang Date: Fri, 9 Aug 2024 16:39:30 +0800 Subject: [PATCH 045/620] value Signed-off-by: liushang --- multimedia/video_processing_engine/image_processing_types.h | 2 +- multimedia/video_processing_engine/video_processing_types.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index 46f8d249c..cfd2a5473 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -212,7 +212,7 @@ typedef enum ImageProcessing_ErrorCode { IMAGE_PROCESSING_ERROR_NO_MEMORY, /** @error The image processing instance is invalid. This may be caused by null instance. */ IMAGE_PROCESSING_ERROR_INVALID_INSTANCE, - /** @error Input parameter is invalid. This error is returned for all of the following error conditions: + /** @error Input value is invalid. This error is returned for all of the following error conditions: * 1 - Invalid input or output image buffer - The image buffer width(height) * is too large or colorspace is incorrect. * 2 - Invalid parameter - The parameter does not contain valid information, diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h index 51611e9ac..d863e2cf3 100644 --- a/multimedia/video_processing_engine/video_processing_types.h +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -184,7 +184,7 @@ typedef enum VideoProcessing_ErrorCode { VIDEO_PROCESSING_ERROR_NO_MEMORY, /** @error The video processing instance is invalid. This may be caused by null instance. */ VIDEO_PROCESSING_ERROR_INVALID_INSTANCE, - /** @error Input parameter is invalid. This error is returned for all of the following error conditions: + /** @error Input value is invalid. This error is returned for all of the following error conditions: * 1 - Invalid input or output video buffer - The video buffer width(height) * is too large or colorspace is incorrect. * 2 - Invalid parameter - The parameter does not contain valid information, -- Gitee From c8e38bb487007a0e323ae0059f3d8fe5efe36c17 Mon Sep 17 00:00:00 2001 From: xzcbob Date: Fri, 9 Aug 2024 09:30:36 +0000 Subject: [PATCH 046/620] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9E=9A=E4=B8=BE=20?= =?UTF-8?q?OH=5FSCREEN=5FCAPTURE=5FSTATE=5FSTOPPED=5FBY=5FUSER=5FSWITCHES?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xzcbob --- multimedia/player_framework/native_avscreen_capture_base.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/player_framework/native_avscreen_capture_base.h b/multimedia/player_framework/native_avscreen_capture_base.h index b9a795eaf..0d5b35387 100644 --- a/multimedia/player_framework/native_avscreen_capture_base.h +++ b/multimedia/player_framework/native_avscreen_capture_base.h @@ -446,8 +446,8 @@ typedef enum OH_AVScreenCaptureStateCode { OH_SCREEN_CAPTURE_STATE_ENTER_PRIVATE_SCENE = 8, /* Private window disappeared on current captured screen*/ OH_SCREEN_CAPTURE_STATE_EXIT_PRIVATE_SCENE = 9, - /* ScreenCapture stopped by user switched */ - OH_SCREEN_CAPTURE_STATE_STOPPED_BY_USER_SWITCHED = 10, + /* ScreenCapture stopped by user switches */ + OH_SCREEN_CAPTURE_STATE_STOPPED_BY_USER_SWITCHES = 10, } OH_AVScreenCaptureStateCode; /** -- Gitee From 071fd1f16d99887b0aa7e0a5d716e56686c82464 Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Sat, 10 Aug 2024 14:22:50 +0800 Subject: [PATCH 047/620] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=20=E6=96=B0=E5=A2=9E=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=90=8E=E5=A4=84=E7=90=86=E9=94=99=E8=AF=AF=E7=A0=81&?= =?UTF-8?q?=E7=9B=B8=E5=BA=94=E6=8E=A5=E5=8F=A3=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- multimedia/av_codec/native_avcodec_base.h | 14 ++++++++++++++ multimedia/av_codec/native_avcodec_videodecoder.h | 2 ++ multimedia/media_foundation/native_averrors.h | 10 ++++++++++ 3 files changed, 26 insertions(+) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index cdaeeed55..73f52ce50 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -940,6 +940,20 @@ extern const char *OH_MD_KEY_VIDEO_SAR; * @since 12 */ extern const char *OH_MD_KEY_START_TIME; +/** + * @brief Key for setting the output color space of video decoder. The value type is int32_t. + * The supported value is {@link OH_COLORSPACE_BT709_LIMIT}, see {@link OH_NativeBuffer_ColorSpace}. It is used in + * {@link OH_VideoDecoder_Configure}. If the color space conversion capability is supported and this key is configured, + * the video decoder will automatically transcode an HDR Vivid video to an SDR video with color space BT709. + * If color space conversion capability is not supported, {@link OH_VideoDecoder_Configure} returns + * {@link AV_ERR_VIDEO_UNSUPPORT_COLOR_SPACE_CONVERSION}. + * If the input video is not an HDR vivid video, an error {@link AV_ERR_VIDEO_UNSUPPORT_COLOR_SPACE_CONVERSION} will be + * reported by callback function {@link OH_AVCodecOnError}. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE; /** * @brief Media type. diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 012329d4f..0e7307a96 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -146,6 +146,8 @@ OH_AVErrCode OH_VideoDecoder_SetSurface(OH_AVCodec *codec, OHNativeWindow *windo * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. + * {@link AV_ERR_UNSUPPORT}, unsupported features. + * {@link AV_ERR_VIDEO_UNSUPPORT_COLOR_SPACE_CONVERSION}, video unsupported color space conversion. * @since 9 */ OH_AVErrCode OH_VideoDecoder_Configure(OH_AVCodec *codec, OH_AVFormat *format); diff --git a/multimedia/media_foundation/native_averrors.h b/multimedia/media_foundation/native_averrors.h index cffaba60e..ff818f03a 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -92,6 +92,16 @@ typedef enum OH_AVErrCode { * @since 12 */ AV_ERR_DRM_DECRYPT_FAILED = 201, + /** + * @error video error base. + * @since 12 + */ + AV_ERR_VIDEO_BASE = 300, + /** + * @error video unsupported color space conversion. + * @since 12 + */ + AV_ERR_VIDEO_UNSUPPORT_COLOR_SPACE_CONVERSION = 301, } OH_AVErrCode; #ifdef __cplusplus -- Gitee From 52f1f287fac90fb04d1ed64a02449a0eb80a72b6 Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Mon, 12 Aug 2024 01:38:58 +0000 Subject: [PATCH 048/620] add capi Signed-off-by: hellohyh001 Change-Id: I5519d7f2889fd459762c66a639875fcea6e9873a --- multimodalinput/kits/c/input/oh_input_manager.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 5ae7d4df7..a4d96ef4a 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -1174,6 +1174,19 @@ Input_Result OH_Input_RemoveKeyEventInterceptor(); * @since 12 */ Input_Result OH_Input_RemoveInputEventInterceptor(); + +/** + * @brief Obtains the interval since the last system input event. + * + * @param timeInterval Interval, in nanoseconds. + * @return OH_Input_GetIntervalSinceLastInput status code, specifically. + * {@Link INPUT_SUCCESS} if the Operation is successful.\n + * {@Link INPUT_SERVICE_EXCEPTION} otherwise.\n + * {@link INPUT_PARAMETER_ERROR} Parameter check failed.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +int32_t OH_Input_GetIntervalSinceLastInput(int64_t *timeInterval); #ifdef __cplusplus } #endif -- Gitee From 400d3b0815e1ca1a2c4d3e6c6a6f9943a317b470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E6=AC=A3=E7=91=B6?= Date: Mon, 12 Aug 2024 02:02:09 +0000 Subject: [PATCH 049/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A0=E5=BD=A2?= =?UTF-8?q?=E5=8F=82=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任欣瑶 --- multimodalinput/kits/c/input/oh_input_manager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 1e6c0dd85..f55c4f32a 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -1187,7 +1187,7 @@ Input_Result OH_Input_AddInputEventInterceptor(Input_InterceptorEventCallback *c * @syscap SystemCapability.MultimodalInput.Input.Core * @since 12 */ -Input_Result OH_Input_RemoveKeyEventInterceptor(); +Input_Result OH_Input_RemoveKeyEventInterceptor(void); /** * @brief Removes an interceptor for input events, including mouse, touch, and axis events. @@ -1200,7 +1200,7 @@ Input_Result OH_Input_RemoveKeyEventInterceptor(); * @syscap SystemCapability.MultimodalInput.Input.Core * @since 12 */ -Input_Result OH_Input_RemoveInputEventInterceptor(); +Input_Result OH_Input_RemoveInputEventInterceptor(void); #ifdef __cplusplus } #endif -- Gitee From a8199fb59143486985bd1a65beaf94ede4177c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Mon, 12 Aug 2024 10:30:50 +0800 Subject: [PATCH 050/620] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20metadata=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../include/image/pixelmap_native.h | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 5f8be7c78..5a53806c6 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -765,6 +765,32 @@ Image_ErrorCode OH_PixelmapNative_ConvertAlphaFormat(OH_PixelmapNative* srcpixel Image_ErrorCode OH_PixelmapNative_CreateEmptyPixelmap( OH_Pixelmap_InitializationOptions *options, OH_PixelmapNative **pixelmap); +/** + * @brief Set metadata. + * + * @param pixelmap The Pixelmap pointer to be operated. + * @param key Type of metadata. + * @param value Value of metadata. + * @return Returns {@link Image_ErrorCode} + * @see OH_PixelmapNative + * @since 12 + */ +Image_ErrorCode OH_PixelmapNative_SetMetadata(OH_PixelmapNative *pixelmap, OH_Pixelmap_HdrMetadataKey key, + OH_Pixelmap_HdrMetadataValue *value); + +/** + * @brief Get metadata. + * + * @param pixelmap The Pixelmap pointer to be operated. + * @param key Type of metadata. + * @param value Value of metadata. + * @return Returns {@link Image_ErrorCode} + * @see OH_PixelmapNative + * @since 12 + */ +Image_ErrorCode OH_PixelmapNative_GetMetadata(OH_PixelmapNative *pixelmap, OH_Pixelmap_HdrMetadataKey key, + OH_Pixelmap_HdrMetadataValue **value); + #ifdef __cplusplus }; #endif -- Gitee From e8feff79fdb62ede5931b840dc29a8c9b60e37bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Mon, 12 Aug 2024 10:36:02 +0800 Subject: [PATCH 051/620] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../image_framework/include/image/pixelmap_native.h | 12 ++++++------ multimedia/image_framework/libpixelmap.ndk.json | 8 ++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 5a53806c6..52ddbea8b 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -766,7 +766,7 @@ Image_ErrorCode OH_PixelmapNative_CreateEmptyPixelmap( OH_Pixelmap_InitializationOptions *options, OH_PixelmapNative **pixelmap); /** - * @brief Set metadata. + * @brief Get metadata. * * @param pixelmap The Pixelmap pointer to be operated. * @param key Type of metadata. @@ -775,11 +775,11 @@ Image_ErrorCode OH_PixelmapNative_CreateEmptyPixelmap( * @see OH_PixelmapNative * @since 12 */ -Image_ErrorCode OH_PixelmapNative_SetMetadata(OH_PixelmapNative *pixelmap, OH_Pixelmap_HdrMetadataKey key, - OH_Pixelmap_HdrMetadataValue *value); +Image_ErrorCode OH_PixelmapNative_GetMetadata(OH_PixelmapNative *pixelmap, OH_Pixelmap_HdrMetadataKey key, + OH_Pixelmap_HdrMetadataValue **value); /** - * @brief Get metadata. + * @brief Set metadata. * * @param pixelmap The Pixelmap pointer to be operated. * @param key Type of metadata. @@ -788,8 +788,8 @@ Image_ErrorCode OH_PixelmapNative_SetMetadata(OH_PixelmapNative *pixelmap, OH_Pi * @see OH_PixelmapNative * @since 12 */ -Image_ErrorCode OH_PixelmapNative_GetMetadata(OH_PixelmapNative *pixelmap, OH_Pixelmap_HdrMetadataKey key, - OH_Pixelmap_HdrMetadataValue **value); +Image_ErrorCode OH_PixelmapNative_SetMetadata(OH_PixelmapNative *pixelmap, OH_Pixelmap_HdrMetadataKey key, + OH_Pixelmap_HdrMetadataValue *value); #ifdef __cplusplus }; diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index f06f6b186..be4d2b8fe 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -147,6 +147,14 @@ "first_introduced": "12", "name": "OH_PixelmapNative_CreateEmptyPixelmap" }, + { + "first_introduced": "12", + "name": "OH_PixelmapNative_GetMetadata" + }, + { + "first_introduced": "12", + "name": "OH_PixelmapNative_SetMetadata" + }, { "first_introduced": "12", "name": "OH_PixelmapNative_ConvertPixelmapToNapi" -- Gitee From 4dbc87845039dc1fe01bcdd2789b5f2cfd2e91bd Mon Sep 17 00:00:00 2001 From: libliang Date: Mon, 12 Aug 2024 11:21:49 +0800 Subject: [PATCH 052/620] audio_session_native_1 Signed-off-by: libliang --- .../native_audio_session_manager.h | 221 ++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 multimedia/audio_framework/audio_manager/native_audio_session_manager.h diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h new file mode 100644 index 000000000..a0284cf2e --- /dev/null +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup OHAudio + * @{ + * + * @brief Provide the definition of the C interface for the audio module. + * + * @syscap SystemCapability.Multimedia.Audio.Core + * + * @since 12 + * @version 1.0 + */ + +/** + * @file native_audio_session_manager.h + * + * @brief Declare audio session manager related interfaces. + * + * This file interfaces are used for the creation of audioSessionManager + * as well as activating/deactivating the audio session + * as well as checking and listening the audio session decativated events. + * + * @library libohaudio.so + * @syscap SystemCapability.Multimedia.Audio.Core + * @since 12 + * @version 1.0 + */ + +#ifndef NATIVE_AUDIO_SESSION_MANAGER_H +#define NATIVE_AUDIO_SESSION_MANAGER_H + +#include "native_audio_common.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Declare the audio session manager. + * The handle of audio session manager is used for audio session related functions. + * + * @since 12 + */ +typedef struct OH_AudioSessionManager OH_AudioSessionManager; + +/** + * @brief Declare the audio concurrency modes. + * + * @since 12 + */ +typedef enum { + /** + * @brief default mode + */ + CONCURRENCY_DEFAULT = 0, + + /** + * @brief mix with others mode + */ + CONCURRENCY_MIX_WITH_OTHERS = 1, + + /** + * @brief duck others mode + */ + CONCURRENCY_DUCK_OTHERS = 2, + + /** + * @brief pause others mode + */ + CONCURRENCY_PAUSE_OTHERS = 3, +} OH_AudioSession_ConcurrencyMode; + +/** + * @brief Declare the audio deactivated reasons. + * + * @since 12 + */ +typedef enum { + /** + * @brief deactivated because of lower priority + */ + DEACTIVATED_LOWER_PRIORITY = 0, + + /** + * @brief deactivated because of timing out + */ + DEACTIVATED_TIMEOUT = 1, +} OH_AudioSession_DeactivatedReason; + +/** + * @brief declare the audio session strategy + * + * @since 12 + */ +typedef struct OH_AudioSession_Strategy { + /** + * @brief audio session concurrency mode + */ + OH_AudioSession_ConcurrencyMode concurrencyMode; +} OH_AudioSession_Strategy; + +/** + * @brief declare the audio session deactivated event + * + * @since 12 + */ +typedef struct OH_AudioSession_DeactivatedEvent { + /** + * @brief audio session deactivated reason + */ + OH_AudioSession_DeactivatedReason reason; +} OH_AudioSession_DeactivatedEvent; + +/** + * @brief This function pointer will point to the callback function that + * is used to return the audio session deactivated event. + * + * @param event the {@link #OH_AudioSession_DeactivatedEvent} deactivated triggering event. + * @since 12 + */ +typedef int32_t (*OH_AudioSession_DeactivatedCallback) ( + OH_AudioSession_DeactivatedEvent event); + +/** + * @brief Fetch the audio session manager handle. + * The audio session manager handle should be the first parameter in audio session related functions + * + * @param audioSessionManager the {@link #OH_AudioSessionManager} + * which will be returned as the output parameter + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error + * @since 12 + */ +OH_AudioCommon_Result OH_AudioManager_GetAudioSessionManager( + OH_AudioSessionManager **audioSessionManager); + +/** + * @brief Activate the audio session for the current pid application. + * + * @param audioSessionManager the {@link #OH_AudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * @param strategy the {@link #OH_AudioSession_Strategy} + * which is used for setting audio session strategy + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds + * or {@link #AUDIOCOMMON_REULT_INVALID_PARAM} if parameter validation fails + * or {@link #AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE} if system illegal state + * @since 12 + */ +OH_AudioCommon_Result OH_AudioSessionManager_ActivateAudioSession( + OH_AudioSessionManager *audioSessionManager, OH_AudioSession_Strategy strategy); + +/** + * @brief Deactivate the audio session for the current pid application. + * + * @param audioSessionManager the {@link #OH_AudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds + * or {@link #AUDIOCOMMON_REULT_INVALID_PARAM} if parameter validation fails + * or {@link #AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE} if system illegal state + * @since 12 + */ +OH_AudioCommon_Result OH_AudioSessionManager_DeactivateAudioSession( + OH_AudioSessionManager *audioSessionManager); + +/** + * @brief Querying whether the current pid application has an activated audio session. + * + * @param audioSessionManager the {@link #OH_AudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * @return True when the current pid application has an activated audio session + * False when it does not + * @since 12 + */ +bool OH_AudioSessionManager_IsAudioSessionActivated( + OH_AudioSessionManager *audioSessionManager); + +/** + * @brief Register the audio session deactivated event callback. + * + * @param audioSessionManager the {@link #OH_AudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * @param callback the {@link #OH_AudioSession_DeactivatedCallback} which is used + * to receive the deactivated event + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails + * @since 12 + */ +OH_AudioCommon_Result OH_AudioSessionManager_RegisterSessionDeactivatedCallback( + OH_AudioSessionManager *audioSessionManager, OH_AudioSession_DeactivatedCallback callback); + +/** + * @brief Unregister the audio session deactivated event callback. + * + * @param audioSessionManager the {@link #OH_AudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * @param callback the {@link #OH_AudioSession_DeactivatedCallback} which is used + * to receive the deactivated event + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails + * @since 12 + */ +OH_AudioCommon_Result OH_AudioSessionManager_UnregisterSessionDeactivatedCallback( + OH_AudioSessionManager *audioSessionManager, OH_AudioSession_DeactivatedCallback callback); +#ifdef __cplusplus +} +#endif +/** @} */ +#endif // NATIVE_AUDIO_ROUTING_MANAGER_H \ No newline at end of file -- Gitee From 09fcfe1a42f6b9b6e5348fa5c1928da86aa3230e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Mon, 12 Aug 2024 14:22:21 +0800 Subject: [PATCH 053/620] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- multimedia/image_framework/include/image/image_common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index 6e50d7764..3c032aca8 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -119,12 +119,16 @@ typedef enum { IMAGE_SUCCESS = 0, /** invalid parameter */ IMAGE_BAD_PARAMETER = 401, + /** resource unavailable */ + IMAGE_RESOURCE_UNAVAILABLE = 501, /** unsupported mime type */ IMAGE_UNSUPPORTED_MIME_TYPE = 7600101, /** unknown mime type */ IMAGE_UNKNOWN_MIME_TYPE = 7600102, /** too large data or image */ IMAGE_TOO_LARGE = 7600103, + /** DMA memory does not exist */ + IMAGE_DMA_NOT_EXIST = 7600173, /** unsupported operations */ IMAGE_UNSUPPORTED_OPERATION = 7600201, /** unsupported metadata */ -- Gitee From df9d251552ad432bc9aae5dcbc1a7d9a8b7bea53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Mon, 12 Aug 2024 15:45:31 +0800 Subject: [PATCH 054/620] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../image_framework/include/image/pixelmap_native.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 2b031f8d1..b5f19ec54 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -771,7 +771,11 @@ Image_ErrorCode OH_PixelmapNative_CreateEmptyPixelmap( * @param pixelmap The Pixelmap pointer to be operated. * @param key Type of metadata. * @param value Value of metadata. - * @return Returns {@link Image_ErrorCode} + * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if invalid parameter, x and y are incorrect. + * returns {@link Image_ErrorCode} IMAGE_TOO_LARGE - if image is too large. + * returns {@link Image_ErrorCode} IMAGE_ALLOC_FAILED - if device has no memory. + * returns {@link Image_ErrorCode} IMAGE_UNKNOWN_ERROR - inner unknown error, maybe source pixelmap is released. * @see OH_PixelmapNative * @since 12 */ @@ -784,7 +788,11 @@ Image_ErrorCode OH_PixelmapNative_GetMetadata(OH_PixelmapNative *pixelmap, OH_Pi * @param pixelmap The Pixelmap pointer to be operated. * @param key Type of metadata. * @param value Value of metadata. - * @return Returns {@link Image_ErrorCode} + * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if invalid parameter, x and y are incorrect. + * returns {@link Image_ErrorCode} IMAGE_TOO_LARGE - if image is too large. + * returns {@link Image_ErrorCode} IMAGE_ALLOC_FAILED - if device has no memory. + * returns {@link Image_ErrorCode} IMAGE_UNKNOWN_ERROR - inner unknown error, maybe source pixelmap is released. * @see OH_PixelmapNative * @since 12 */ -- Gitee From 4cb8b54f478e9d7e02b154a05d7dcd6f5353ec78 Mon Sep 17 00:00:00 2001 From: peng Date: Mon, 12 Aug 2024 08:04:14 +0000 Subject: [PATCH 055/620] del lbvc Signed-off-by: peng --- .../codec_base/libnative_media_codecbase.ndk.json | 4 ---- multimedia/av_codec/native_avcodec_base.h | 8 -------- 2 files changed, 12 deletions(-) diff --git a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json index 74292f25c..88ee0f832 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -59,10 +59,6 @@ "first_introduced": "11", "name": "OH_AVCODEC_MIMETYPE_AUDIO_G711MU" }, - { - "first_introduced": "12", - "name": "OH_AVCODEC_MIMETYPE_AUDIO_LBVC" - }, { "first_introduced": "12", "name": "OH_AVCODEC_MIMETYPE_AUDIO_APE" diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index cdaeeed55..0f62400e4 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -312,14 +312,6 @@ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_OPUS; */ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711MU; -/** - * @brief Enumerates the mime type of audio low bitrate voice codec. - * - * @syscap SystemCapability.Multimedia.Media.CodecBase - * @since 12 - */ -extern const char *OH_AVCODEC_MIMETYPE_AUDIO_LBVC; - /** * @brief Enumerates the mime type of audio ape codec. * -- Gitee From 1fc78a2a0032ce383556a9f6fe46280b594d7c43 Mon Sep 17 00:00:00 2001 From: shegangbin Date: Mon, 12 Aug 2024 16:31:04 +0800 Subject: [PATCH 056/620] fix Signed-off-by: shegangbin --- graphic/graphic_2d/native_vsync/native_vsync.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_vsync/native_vsync.h b/graphic/graphic_2d/native_vsync/native_vsync.h index 85627485c..610fe1deb 100644 --- a/graphic/graphic_2d/native_vsync/native_vsync.h +++ b/graphic/graphic_2d/native_vsync/native_vsync.h @@ -77,7 +77,7 @@ void OH_NativeVSync_Destroy(OH_NativeVSync* nativeVsync); * @syscap SystemCapability.Graphic.Graphic2D.NativeVsync * @param nativeVsync Indicates the pointer to a NativeVsync. * @param callback Indicates the OH_NativeVSync_FrameCallback which will be called when next vsync coming. - * @param data Indicates data whick will be used in callback. + * @param data Indicates data which will be used in callback. * @return {@link NATIVE_ERROR_OK} 0 - Success. * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - the parameter nativeVsync is NULL or callback is NULL. * {@link NATIVE_ERROR_BINDER_ERROR} 50401000 - ipc send failed. @@ -93,7 +93,7 @@ int OH_NativeVSync_RequestFrame(OH_NativeVSync* nativeVsync, OH_NativeVSync_Fram * @syscap SystemCapability.Graphic.Graphic2D.NativeVsync * @param nativeVsync Indicates the pointer to a NativeVsync. * @param callback Indicates the OH_NativeVSync_FrameCallback which will be called when next vsync coming. - * @param data Indicates data whick will be used in callback. + * @param data Indicates data which will be used in callback. * @return {@link NATIVE_ERROR_OK} 0 - Success. * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - the parameter nativeVsync is NULL or callback is NULL. * {@link NATIVE_ERROR_BINDER_ERROR} 50401000 - ipc send failed. -- Gitee From 0cbee81ccda83afa3d44a0a25d18621c47be8871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Mon, 12 Aug 2024 17:17:52 +0800 Subject: [PATCH 057/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81=E6=B3=A8=E9=87=8A=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../include/image/pixelmap_native.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index b5f19ec54..bf68694c0 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -772,10 +772,9 @@ Image_ErrorCode OH_PixelmapNative_CreateEmptyPixelmap( * @param key Type of metadata. * @param value Value of metadata. * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. - * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if invalid parameter, x and y are incorrect. - * returns {@link Image_ErrorCode} IMAGE_TOO_LARGE - if image is too large. - * returns {@link Image_ErrorCode} IMAGE_ALLOC_FAILED - if device has no memory. - * returns {@link Image_ErrorCode} IMAGE_UNKNOWN_ERROR - inner unknown error, maybe source pixelmap is released. + * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if invalid parameter, key and value are incorrect. + * returns {@link Image_ErrorCode} IMAGE_DMA_NOT_EXIST - if DMA memory does not exist. + * returns {@link Image_ErrorCode} IMAGE_COPY_FAILED - if memory copy failed. * @see OH_PixelmapNative * @since 12 */ @@ -789,10 +788,9 @@ Image_ErrorCode OH_PixelmapNative_GetMetadata(OH_PixelmapNative *pixelmap, OH_Pi * @param key Type of metadata. * @param value Value of metadata. * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. - * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if invalid parameter, x and y are incorrect. - * returns {@link Image_ErrorCode} IMAGE_TOO_LARGE - if image is too large. - * returns {@link Image_ErrorCode} IMAGE_ALLOC_FAILED - if device has no memory. - * returns {@link Image_ErrorCode} IMAGE_UNKNOWN_ERROR - inner unknown error, maybe source pixelmap is released. + * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if invalid parameter, key and value are incorrect. + * returns {@link Image_ErrorCode} IMAGE_DMA_NOT_EXIST - if DMA memory does not exist. + * returns {@link Image_ErrorCode} IMAGE_COPY_FAILED - if memory copy failed. * @see OH_PixelmapNative * @since 12 */ -- Gitee From 903a8c7c6fd8a64108db7745bd8ee003d7903865 Mon Sep 17 00:00:00 2001 From: zoulinken Date: Wed, 7 Aug 2024 17:54:09 +0800 Subject: [PATCH 058/620] =?UTF-8?q?C-API=20=E7=B3=BB=E7=BB=9F=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E5=8C=96=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zoulinken --- arkui/ace_engine/native/libace.ndk.json | 4 ++-- arkui/ace_engine/native/native_node.h | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 774365f3b..7e3b610ab 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2129,10 +2129,10 @@ }, { "first_introduced": "12", - "name": "OH_ArkUI_SystemFontStyleEvent_GetFontSize" + "name": "OH_ArkUI_SystemFontStyleEvent_GetFontSizeScale" }, { "first_introduced": "12", - "name": "OH_ArkUI_SystemFontStyleEvent_GetFontWeight" + "name": "OH_ArkUI_SystemFontStyleEvent_GetFontWeightScale" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 8442784be..15b036ed2 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -7729,20 +7729,19 @@ void OH_ArkUI_UnregisterSystemFontStyleChangeEvent(ArkUI_NodeHandle node); * @brief Retrieve the font size value for system font change events. * * @param event Indicates a pointer to the current system font change event. - * @return Updated system font size. -1 indicates a retrieval error. + * @return Updated system font size scaling factor. Default value: 1.0. * @since 12 */ -int32_t OH_ArkUI_SystemFontStyleEvent_GetFontSize(const ArkUI_SystemFontStyleEvent* event); +float OH_ArkUI_SystemFontStyleEvent_GetFontSizeScale(const ArkUI_SystemFontStyleEvent* event); /** * @brief Retrieve the font thickness values for system font change events. * * @param event Indicates a pointer to the current system font change event. - * @return Updated system font thickness, return value type {@link ArkUI_fontWeight}, - * default value:ARKUI_FONT_WEIGHT_W100。 + * @return The updated system font thickness scaling factor. Default value: 1.0. * @since 12 */ -int32_t OH_ArkUI_SystemFontStyleEvent_GetFontWeight(const ArkUI_SystemFontStyleEvent* event); +float OH_ArkUI_SystemFontStyleEvent_GetFontWeightScale(const ArkUI_SystemFontStyleEvent* event); #ifdef __cplusplus }; -- Gitee From 109fa769d25410a29baa8820ce57fd63c8889301 Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Mon, 12 Aug 2024 09:55:56 +0800 Subject: [PATCH 059/620] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=20=E6=A0=B9=E6=8D=AE=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E6=84=8F=E8=A7=81=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- multimedia/av_codec/native_avcodec_base.h | 6 +++--- multimedia/av_codec/native_avcodec_videodecoder.h | 2 +- multimedia/media_foundation/native_averrors.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 73f52ce50..bde35e6ec 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -946,9 +946,9 @@ extern const char *OH_MD_KEY_START_TIME; * {@link OH_VideoDecoder_Configure}. If the color space conversion capability is supported and this key is configured, * the video decoder will automatically transcode an HDR Vivid video to an SDR video with color space BT709. * If color space conversion capability is not supported, {@link OH_VideoDecoder_Configure} returns - * {@link AV_ERR_VIDEO_UNSUPPORT_COLOR_SPACE_CONVERSION}. - * If the input video is not an HDR vivid video, an error {@link AV_ERR_VIDEO_UNSUPPORT_COLOR_SPACE_CONVERSION} will be - * reported by callback function {@link OH_AVCodecOnError}. + * {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION}. + * If the input video is not an HDR vivid video, an error {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION} will + * be reported by callback function {@link OH_AVCodecOnError}. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 0e7307a96..7cb92a41c 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -147,7 +147,7 @@ OH_AVErrCode OH_VideoDecoder_SetSurface(OH_AVCodec *codec, OHNativeWindow *windo * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. * {@link AV_ERR_UNSUPPORT}, unsupported features. - * {@link AV_ERR_VIDEO_UNSUPPORT_COLOR_SPACE_CONVERSION}, video unsupported color space conversion. + * {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION}, video unsupported color space conversion. * @since 9 */ OH_AVErrCode OH_VideoDecoder_Configure(OH_AVCodec *codec, OH_AVFormat *format); diff --git a/multimedia/media_foundation/native_averrors.h b/multimedia/media_foundation/native_averrors.h index ff818f03a..0a2a54d60 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -92,16 +92,16 @@ typedef enum OH_AVErrCode { * @since 12 */ AV_ERR_DRM_DECRYPT_FAILED = 201, - /** + /** * @error video error base. * @since 12 */ AV_ERR_VIDEO_BASE = 300, - /** + /** * @error video unsupported color space conversion. * @since 12 */ - AV_ERR_VIDEO_UNSUPPORT_COLOR_SPACE_CONVERSION = 301, + AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION = 301, } OH_AVErrCode; #ifdef __cplusplus -- Gitee From 0663d335f021c32e9e0d9614782951d354a949b6 Mon Sep 17 00:00:00 2001 From: KentZustc Date: Tue, 13 Aug 2024 02:28:14 +0000 Subject: [PATCH 060/620] update arkui/ace_engine/native/native_node.h. Signed-off-by: KentZustc --- arkui/ace_engine/native/native_node.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 8442784be..1a4e2baa7 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -1087,13 +1087,13 @@ typedef enum { * .value[0].i32: blend mode. The parameter type is {@link ArkUI_BlendMode}. The default value is * ARKUI_BLEND_MODE_NONE. \n * .value[1].?i32: how the specified blend mode is applied. The parameter type is {@link ArkUI_BlendApplyType}. - * The default value is ARKUI_BLEND_APPLY_TYPE_FAST. \n + * The default value is BLEND_APPLY_TYPE_FAST. \n * \n * Format of the return value {@link ArkUI_AttributeItem}:\n * .value[0].i32: blend mode. The parameter type is {@link ArkUI_BlendMode}. The default value is * ARKUI_BLEND_MODE_NONE. \n * .value[1].i32: how the specified blend mode is applied. The parameter type is {@link ArkUI_BlendApplyType}. - * The default value is ARKUI_BLEND_APPLY_TYPE_FAST. \n + * The default value is BLEND_APPLY_TYPE_FAST. \n * */ NODE_BLEND_MODE, -- Gitee From 140992d7f952b7653ce55cdccd98a9e19a813483 Mon Sep 17 00:00:00 2001 From: y30025806 Date: Tue, 13 Aug 2024 14:46:30 +0800 Subject: [PATCH 061/620] add track start time Signed-off-by: y30025806 Change-Id: Iae8638ba8a25919bf8a0f03844aea4f05f9a4203 --- multimedia/av_codec/native_avcodec_base.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index cdaeeed55..2dba60541 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -940,7 +940,13 @@ extern const char *OH_MD_KEY_VIDEO_SAR; * @since 12 */ extern const char *OH_MD_KEY_START_TIME; - +/** + * @brief Key for start time of track, value type is int64_t. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +extern const char *OH_MD_KEY_TRACK_START_TIME; /** * @brief Media type. * -- Gitee From 22b1e860577585216d6656e2e6df52629fff80ed Mon Sep 17 00:00:00 2001 From: yuanzhipu <2710242656@qq.com> Date: Tue, 13 Aug 2024 16:53:10 +0800 Subject: [PATCH 062/620] open ffrt recursive mutex Signed-off-by: yuanzhipu <2710242656@qq.com> --- resourceschedule/ffrt/c/mutex.h | 47 ++++++++++++++++++++++++++++++ resourceschedule/ffrt/c/type_def.h | 17 +++++++++++ 2 files changed, 64 insertions(+) diff --git a/resourceschedule/ffrt/c/mutex.h b/resourceschedule/ffrt/c/mutex.h index eb76379ba..1671a104a 100644 --- a/resourceschedule/ffrt/c/mutex.h +++ b/resourceschedule/ffrt/c/mutex.h @@ -39,6 +39,53 @@ #define FFRT_API_C_MUTEX_H #include "type_def.h" +/** + * @brief Initializes mutex attr. + * + * @param mutex Indicates a pointer to the mutex. + * @param attr Indicates a pointer to the mutex attribute. + * @return {@link ffrt_success} 0 - success + {@link ffrt_error_inval} 22 - if attr is null. + * @since 12 + * @version 1.0 + */ +FFRT_C_API int ffrt_mutexattr_init(ffrt_mutexattr_t* attr); + +/** + * @brief set mutex type. + * + * @param attr Indicates a pointer to the mutex attribute. + * @param type Indicates a int to the mutex type. + * @return {@link ffrt_success} 0 - success + {@link ffrt_error_inval} 22 - if attr is null or type is not 0 or 2. + * @since 12 + * @version 1.0 + */ +FFRT_C_API int ffrt_mutexattr_settype(ffrt_mutexattr_t* attr, int type); + +/** + * @brief get mutex type. + * + * @param attr Indicates a pointer to the mutex attribute. + * @param type Indicates a pointer to the mutex type. + * @return {@link ffrt_success} 0 - success + {@link ffrt_error_inval} 22 - if attr is null or type is null. + * @since 12 + * @version 1.0 + */ +FFRT_C_API int ffrt_mutexattr_gettype(ffrt_mutexattr_t* attr, int* type); + +/** + * @brief destroy mutex attr, the user needs to invoke this interface. + * + * @param attr Indicates a pointer to the mutex attribute. + * @return {@link ffrt_success} 0 - success + {@link ffrt_error_inval} 22 - if attr is null. + * @since 12 + * @version 1.0 + */ +FFRT_C_API int ffrt_mutexattr_destroy(ffrt_mutexattr_t* attr); + /** * @brief Initializes a mutex. * diff --git a/resourceschedule/ffrt/c/type_def.h b/resourceschedule/ffrt/c/type_def.h index c929b5ff9..8d9f7c1ab 100644 --- a/resourceschedule/ffrt/c/type_def.h +++ b/resourceschedule/ffrt/c/type_def.h @@ -183,6 +183,23 @@ typedef struct { long storage; } ffrt_mutexattr_t; +/** + * @brief ffrt mutex type enum + * + * Describes the mutex type, ffrt_mutex_normal is normal mutex; + * ffrt_mutex_recursive is recursive mutex, ffrt_mutex_default is normal mutex. + * + * @since 12 + */ +typedef enum { + /** ffrt normal mutex type */ + ffrt_mutex_normal = 0, + /** ffrt recursive mutex type */ + ffrt_mutex_recursive = 2, + /** ffrt default mutex type */ + ffrt_mutex_default = ffrt_mutex_normal +} ffrt_mutex_type; + typedef struct { uint32_t storage[(ffrt_mutex_storage_size + sizeof(uint32_t) - 1) / sizeof(uint32_t)]; } ffrt_mutex_t; -- Gitee From 4aebf9df49e27b6614657ce16cb43e1da7516213 Mon Sep 17 00:00:00 2001 From: yuanzhipu <2710242656@qq.com> Date: Tue, 13 Aug 2024 16:56:26 +0800 Subject: [PATCH 063/620] open ffrt recursive mutex Signed-off-by: yuanzhipu <2710242656@qq.com> --- resourceschedule/ffrt/ffrt.ndk.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resourceschedule/ffrt/ffrt.ndk.json b/resourceschedule/ffrt/ffrt.ndk.json index 0c83414e0..41cb9cc5a 100644 --- a/resourceschedule/ffrt/ffrt.ndk.json +++ b/resourceschedule/ffrt/ffrt.ndk.json @@ -5,6 +5,10 @@ { "name": "ffrt_cond_wait" }, { "name": "ffrt_cond_timedwait" }, { "name": "ffrt_cond_destroy" }, + { "name": "ffrt_mutexattr_init"}, + { "name": "ffrt_mutexattr_settype"}, + { "name": "ffrt_mutexattr_gettype"}, + { "name": "ffrt_mutexattr_destroy"}, { "name": "ffrt_mutex_init" }, { "name": "ffrt_mutex_lock" }, { "name": "ffrt_mutex_unlock" }, -- Gitee From 3615852942546a6d8dbf18f461de24e6bcae9fc5 Mon Sep 17 00:00:00 2001 From: libliang Date: Tue, 13 Aug 2024 17:48:24 +0800 Subject: [PATCH 064/620] fix pointer issue Signed-off-by: libliang --- .../audio_manager/native_audio_session_manager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index a0284cf2e..34898557e 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -152,7 +152,7 @@ OH_AudioCommon_Result OH_AudioManager_GetAudioSessionManager( * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager} - * @param strategy the {@link #OH_AudioSession_Strategy} + * @param strategy pointer of {@link #OH_AudioSession_Strategy} * which is used for setting audio session strategy * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds * or {@link #AUDIOCOMMON_REULT_INVALID_PARAM} if parameter validation fails @@ -160,7 +160,7 @@ OH_AudioCommon_Result OH_AudioManager_GetAudioSessionManager( * @since 12 */ OH_AudioCommon_Result OH_AudioSessionManager_ActivateAudioSession( - OH_AudioSessionManager *audioSessionManager, OH_AudioSession_Strategy strategy); + OH_AudioSessionManager *audioSessionManager, const OH_AudioSession_Strategy *strategy); /** * @brief Deactivate the audio session for the current pid application. -- Gitee From 7de9398592f1efabaaae00674a71392dd4a853a0 Mon Sep 17 00:00:00 2001 From: yuanzhipu <2710242656@qq.com> Date: Tue, 13 Aug 2024 19:28:36 +0800 Subject: [PATCH 065/620] open ffrt recursive mutex Signed-off-by: yuanzhipu <2710242656@qq.com> --- resourceschedule/ffrt/c/mutex.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/resourceschedule/ffrt/c/mutex.h b/resourceschedule/ffrt/c/mutex.h index 1671a104a..1c397cdd3 100644 --- a/resourceschedule/ffrt/c/mutex.h +++ b/resourceschedule/ffrt/c/mutex.h @@ -45,7 +45,7 @@ * @param mutex Indicates a pointer to the mutex. * @param attr Indicates a pointer to the mutex attribute. * @return {@link ffrt_success} 0 - success - {@link ffrt_error_inval} 22 - if attr is null. + * {@link ffrt_error_inval} 22 - if attr is null. * @since 12 * @version 1.0 */ @@ -56,8 +56,8 @@ FFRT_C_API int ffrt_mutexattr_init(ffrt_mutexattr_t* attr); * * @param attr Indicates a pointer to the mutex attribute. * @param type Indicates a int to the mutex type. - * @return {@link ffrt_success} 0 - success - {@link ffrt_error_inval} 22 - if attr is null or type is not 0 or 2. + * @return {@link ffrt_success} 0 - success. + * {@link ffrt_error_inval} 22 - if attr is null or type is not 0 or 2. * @since 12 * @version 1.0 */ @@ -68,8 +68,8 @@ FFRT_C_API int ffrt_mutexattr_settype(ffrt_mutexattr_t* attr, int type); * * @param attr Indicates a pointer to the mutex attribute. * @param type Indicates a pointer to the mutex type. - * @return {@link ffrt_success} 0 - success - {@link ffrt_error_inval} 22 - if attr is null or type is null. + * @return {@link ffrt_success} 0 - success. + * {@link ffrt_error_inval} 22 - if attr is null or type is null. * @since 12 * @version 1.0 */ @@ -79,8 +79,8 @@ FFRT_C_API int ffrt_mutexattr_gettype(ffrt_mutexattr_t* attr, int* type); * @brief destroy mutex attr, the user needs to invoke this interface. * * @param attr Indicates a pointer to the mutex attribute. - * @return {@link ffrt_success} 0 - success - {@link ffrt_error_inval} 22 - if attr is null. + * @return {@link ffrt_success} 0 - success. + * {@link ffrt_error_inval} 22 - if attr is null. * @since 12 * @version 1.0 */ -- Gitee From 9bcc5d9ce1b4aec115843097b97a34687bc2dd35 Mon Sep 17 00:00:00 2001 From: zhenghongda <13135671+zhenghongda@user.noreply.gitee.com> Date: Tue, 13 Aug 2024 12:31:42 +0000 Subject: [PATCH 066/620] Fix unknown type name 'bool' error. Signed-off-by: zhenghongda --- multimedia/drm_framework/native_mediakeysession.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multimedia/drm_framework/native_mediakeysession.h b/multimedia/drm_framework/native_mediakeysession.h index 8afa6cfbe..1eec1dfc3 100644 --- a/multimedia/drm_framework/native_mediakeysession.h +++ b/multimedia/drm_framework/native_mediakeysession.h @@ -38,6 +38,7 @@ #define OHOS_DRM_NATIVE_MEDIA_KEY_SESSION_H #include +#include #include #include "native_drm_err.h" #include "native_drm_common.h" @@ -300,4 +301,4 @@ Drm_ErrCode OH_MediaKeySession_Destroy(MediaKeySession *mediaKeySessoin); } #endif -#endif // OHOS_DRM_NATIVE_MEDIA_KEY_SYSTEM_H \ No newline at end of file +#endif // OHOS_DRM_NATIVE_MEDIA_KEY_SYSTEM_H -- Gitee From a5ee17ddadda6a43ceb29b4126818a3ad95cb09f Mon Sep 17 00:00:00 2001 From: zhangkai Date: Tue, 13 Aug 2024 21:40:56 +0800 Subject: [PATCH 067/620] =?UTF-8?q?ohaudio=20=E5=AF=BC=E5=85=A5stdbool.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangkai --- multimedia/audio_framework/audio_renderer/native_audiorenderer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index 226b9c980..baf29a672 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -40,6 +40,7 @@ #ifndef NATIVE_AUDIORENDERER_H #define NATIVE_AUDIORENDERER_H +#include #include #include "native_audiostream_base.h" #include "multimedia/native_audio_channel_layout.h" -- Gitee From 87edf2d2b0fe37e74a11a3de3773630266b0b314 Mon Sep 17 00:00:00 2001 From: 0165418301 Date: Wed, 14 Aug 2024 01:29:56 +0000 Subject: [PATCH 068/620] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E6=80=A7=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 0165418301 --- multimedia/player_framework/avplayer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h index d2d7aa7e8..ab0d17cd3 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -39,6 +39,7 @@ #ifndef MULTIMEDIA_PLAYER_FRAMEWORK_NATIVE_AVPLAYER_H #define MULTIMEDIA_PLAYER_FRAMEWORK_NATIVE_AVPLAYER_H +#include #include #include #include "native_averrors.h" -- Gitee From c1c1dfb1a82ac9dfa6ff124754d3f3497b972e85 Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Wed, 14 Aug 2024 01:58:27 +0000 Subject: [PATCH 069/620] Add interface capi Signed-off-by: hellohyh001 Change-Id: If648b8328fd621659191dd8f047179ba9edc4929 --- multimodalinput/kits/c/input/oh_input_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index a4d96ef4a..479df3903 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -1181,7 +1181,7 @@ Input_Result OH_Input_RemoveInputEventInterceptor(); * @param timeInterval Interval, in nanoseconds. * @return OH_Input_GetIntervalSinceLastInput status code, specifically. * {@Link INPUT_SUCCESS} if the Operation is successful.\n - * {@Link INPUT_SERVICE_EXCEPTION} otherwise.\n + * {@Link INPUT_SERVICE_EXCEPTION} Failed to get the interval because the service is exception.\n * {@link INPUT_PARAMETER_ERROR} Parameter check failed.\n * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 -- Gitee From 9f321ac5644004cf368c59d79a230fa3489f48eb Mon Sep 17 00:00:00 2001 From: yuanzhipu <2710242656@qq.com> Date: Wed, 14 Aug 2024 12:03:48 +0800 Subject: [PATCH 070/620] open ffrt recursive mutex Signed-off-by: yuanzhipu <2710242656@qq.com> --- resourceschedule/ffrt/ffrt.ndk.json | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/resourceschedule/ffrt/ffrt.ndk.json b/resourceschedule/ffrt/ffrt.ndk.json index 41cb9cc5a..397494c37 100644 --- a/resourceschedule/ffrt/ffrt.ndk.json +++ b/resourceschedule/ffrt/ffrt.ndk.json @@ -5,10 +5,22 @@ { "name": "ffrt_cond_wait" }, { "name": "ffrt_cond_timedwait" }, { "name": "ffrt_cond_destroy" }, - { "name": "ffrt_mutexattr_init"}, - { "name": "ffrt_mutexattr_settype"}, - { "name": "ffrt_mutexattr_gettype"}, - { "name": "ffrt_mutexattr_destroy"}, + { + "first_introduced": "12", + "name": "ffrt_mutexattr_init" + }, + { + "first_introduced": "12", + "name": "ffrt_mutexattr_settype" + }, + { + "first_introduced": "12", + "name": "ffrt_mutexattr_gettype" + }, + { + "first_introduced": "12", + "name": "ffrt_mutexattr_destroy" + }, { "name": "ffrt_mutex_init" }, { "name": "ffrt_mutex_lock" }, { "name": "ffrt_mutex_unlock" }, -- Gitee From 57fae1328c224bdec9b8c7db39cec3b9571858fd Mon Sep 17 00:00:00 2001 From: milkpotatoes Date: Tue, 13 Aug 2024 20:30:08 +0800 Subject: [PATCH 071/620] Add description for napi_coerce_to_native_binding_object Issue: https://gitee.com/openharmony/interface_sdk_c/issues/IAJT2E Signed-off-by: milkpotatoes Change-Id: Ieb0e4680e79308e92ab289ce95405dfa96883ed4 --- arkui/napi/native_api.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arkui/napi/native_api.h b/arkui/napi/native_api.h index 7cbab661d..a45ce8476 100644 --- a/arkui/napi/native_api.h +++ b/arkui/napi/native_api.h @@ -72,7 +72,19 @@ NAPI_INNER_EXTERN napi_status napi_adjust_external_memory(napi_env env, extern "C" { #endif +/** + * @brief Native detach callback of napi_coerce_to_native_binding_object that can be used to + * detach the js object and the native object. + * + * @since 11 + */ typedef void* (*napi_native_binding_detach_callback)(napi_env env, void* native_object, void* hint); +/** + * @brief Native attach callback of napi_coerce_to_native_binding_object that can be used to + * bind the js object and the native object. + * + * @since 11 + */ typedef napi_value (*napi_native_binding_attach_callback)(napi_env env, void* native_object, void* hint); NAPI_EXTERN napi_status napi_run_script_path(napi_env env, const char* path, napi_value* result); @@ -130,6 +142,18 @@ NAPI_EXTERN napi_status napi_create_object_with_named_properties(napi_env env, size_t property_count, const char** keys, const napi_value* values); +/** + * @brief This API sets native properties to a object and converts this js object to native binding object. + * + * @param[in] env Current running virtual machine context. + * @param[in] js_object The JavaScript value to coerce. + * @param[in] detach_cb Native callback that can be used to detach the js object and the native object. + * @param[in] attach_cb Native callback that can be used to bind the js object and the native object. + * @param[in] native_object User-provided native instance to pass to thr detach callback and attach callback. + * @param[in] hint Optional hint to pass to the detach callback and attach callback. + * @return Return the function execution status. + * @since 11 + */ NAPI_EXTERN napi_status napi_coerce_to_native_binding_object(napi_env env, napi_value js_object, napi_native_binding_detach_callback detach_cb, -- Gitee From b1d9517efa3bfe83151121ae47a39d216aecba0b Mon Sep 17 00:00:00 2001 From: j00466033 Date: Fri, 9 Aug 2024 20:24:29 +0800 Subject: [PATCH 072/620] postmessage ndk interfaces Signed-off-by: j00466033 Change-Id: Ie9d9c49f0e279f24beb04ba9f8f62076d6711d05 Signed-off-by: j00466033 --- .../interfaces/native/arkweb_error_code.h | 6 + .../interfaces/native/arkweb_interface.h | 4 + web/webview/interfaces/native/arkweb_type.h | 178 +++++++++++++++++- 3 files changed, 187 insertions(+), 1 deletion(-) diff --git a/web/webview/interfaces/native/arkweb_error_code.h b/web/webview/interfaces/native/arkweb_error_code.h index 2162e368c..0ebf021f9 100644 --- a/web/webview/interfaces/native/arkweb_error_code.h +++ b/web/webview/interfaces/native/arkweb_error_code.h @@ -33,6 +33,12 @@ #define ARKWEB_ERROR_CODE_H typedef enum ArkWeb_ErrorCode { +/** @error Success. */ +ARKWEB_SUCCESS = 0, + +/** @error Init error. */ +ARKWEB_INIT_ERROR = 17100001, + /** @error Unknown error. */ ARKWEB_ERROR_UNKNOWN = 17100100, diff --git a/web/webview/interfaces/native/arkweb_interface.h b/web/webview/interfaces/native/arkweb_interface.h index d0b1fa45a..7b60c5bcb 100644 --- a/web/webview/interfaces/native/arkweb_interface.h +++ b/web/webview/interfaces/native/arkweb_interface.h @@ -59,6 +59,10 @@ typedef enum { ARKWEB_NATIVE_COMPONENT, /** API type related to ArkWeb controller. */ ARKWEB_NATIVE_CONTROLLER, + /** API type related to ArkWeb WebMessagePort. */ + ARKWEB_NATIVE_WEB_MESSAGE_PORT, + /** API type related to ArkWeb WebMessage. */ + ARKWEB_NATIVE_WEB_MESSAGE, } ArkWeb_NativeAPIVariantKind; /* diff --git a/web/webview/interfaces/native/arkweb_type.h b/web/webview/interfaces/native/arkweb_type.h index c63cfc26f..2a1d56d64 100644 --- a/web/webview/interfaces/native/arkweb_type.h +++ b/web/webview/interfaces/native/arkweb_type.h @@ -36,6 +36,8 @@ #include #include +#include "arkweb_error_code.h" + #ifdef __cplusplus extern "C" { #endif @@ -52,6 +54,27 @@ typedef struct { size_t size; } ArkWeb_JavaScriptBridgeData; +/** + * @brief Defines the data type carried in a ArkWeb_WebMessage. + * + * @since 12 + */ +typedef enum ArkWeb_WebMessageType { + /** Represent error data */ + ARKWEB_NONE = 0, + /** The data carried in the ArkWeb_WebMessage is string. */ + ARKWEB_STRING, + /** The data carried in the ArkWeb_WebMessage is buffer(uint8_t). */ + ARKWEB_BUFFER +} ArkWeb_WebMessageType; + +/** + * @brief Defines the ArkWeb_WebMessage. + * + * @since 12 + */ +typedef struct ArkWeb_WebMessage* ArkWeb_WebMessagePtr; + /** * @brief Defines the javascript callback of the native ArkWeb. * @@ -75,6 +98,26 @@ typedef void (*ArkWeb_OnJavaScriptProxyCallback)( */ typedef void (*ArkWeb_OnComponentCallback)(const char* webTag, void* userData); +/** + * @brief Defines the ArkWeb_WebMessagePort that represent a HTML5 message port. + * + * @since 12 + */ +typedef struct ArkWeb_WebMessagePort* ArkWeb_WebMessagePortPtr; + +/** + * @brief Defines the callback to receive message from HTML. + * + * @param webTag The name of the web component. + * @param port The ArkWeb_WebMessagePort for registering the ArkWeb_OnMessageEventHandler. + * @param message The received ArkWeb_WebMessage. + * @param userData The data set by user. + * + * @since 12 + */ +typedef void (*ArkWeb_OnMessageEventHandler)( + const char* webTag, const ArkWeb_WebMessagePortPtr port, const ArkWeb_WebMessagePtr message, void* userData); + /** * @brief Defines the javascript object. * @@ -121,6 +164,9 @@ typedef struct { /** * @brief Defines the controller API for native ArkWeb. + * Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check + * whether the function structure has a corresponding function pointer to avoid crash + * caused by mismatch between the SDK and the device ROM. * * @since 12 */ @@ -137,6 +183,37 @@ typedef struct { void (*refresh)(const char* webTag); /** Register the JavaScript object and async method list. */ void (*registerAsyncJavaScriptProxy)(const char* webTag, const ArkWeb_ProxyObject* proxyObject); + /** + * @brief Creates a message channel to communicate with HTML and returns + * the message ports representing the message channel endpoints. + * + * @param webTag The name of the web component. + * @param size The quantity of message ports. + */ + ArkWeb_WebMessagePortPtr* (*createWebMessagePorts)(const char* webTag, size_t* size); + + /** + * @brief Destroy message ports. + * + * @param ports Address of the message ports array pointer. + * @param size The quantity of message ports. + */ + void (*destroyWebMessagePorts)(ArkWeb_WebMessagePortPtr** ports, size_t size); + + /** + * @brief Post message ports to main frame. + * + * @param webTag The name of the web component. + * @param name Name of the message to be sent. + * @param size The quantity of message ports. + * @param url Indicates the URI for receiving the message. + * @return Post web message result code. + * {@link ARKWEB_SUCCESS} post web message success. + * {@link ARKWEB_INVALID_PARAM} the parameter verification fails. + * {@link ARKWEB_INIT_ERROR} no web associated with this webTag. + */ + ArkWeb_ErrorCode (*postWebMessage)( + const char* webTag, const char* name, ArkWeb_WebMessagePortPtr* webMessagePorts, size_t size, const char* url); } ArkWeb_ControllerAPI; /** @@ -157,6 +234,105 @@ typedef struct { void (*onDestroy)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData); } ArkWeb_ComponentAPI; +/** + * @brief Defines the web message API for native ArkWeb. + * Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check + * whether the function structure has a corresponding function pointer to avoid crash + * caused by mismatch between the SDK and the device ROM. + * + * @since 12 + */ +typedef struct { + /** The ArkWeb_WebMessagePortAPI struct size. */ + size_t size; + /** + * @brief Post message to HTML. + * + * @param webMessagePort The ArkWeb_WebMessagePort. + * @param webTag The name of the web component. + * @param webMessage The ArkWeb_WebMessage to send. + * @return Post message result code. + * {@link ARKWEB_SUCCESS} post message success. + * {@link ARKWEB_INVALID_PARAM} the parameter verification fails. + * {@link ARKWEB_INIT_ERROR} no web associated with this webTag. + */ + ArkWeb_ErrorCode (*postMessage)( + const ArkWeb_WebMessagePortPtr webMessagePort, const char* webTag, const ArkWeb_WebMessagePtr webMessage); + /** + * @brief Close the message port. + * + * @param webMessagePort The ArkWeb_WebMessagePort. + * @param webTag The name of the web component. + */ + void (*close)(const ArkWeb_WebMessagePortPtr webMessagePort, const char* webTag); + /** + * @brief Set a callback to receive message from HTML. + * + * @param webMessagePort The ArkWeb_WebMessagePort. + * @param webTag The name of the web component. + * @param messageEventHandler The handler to receive message from HTML. + * @param userData The data set by user. + */ + void (*setMessageEventHandler)(const ArkWeb_WebMessagePortPtr webMessagePort, const char* webTag, + ArkWeb_OnMessageEventHandler messageEventHandler, void* userData); +} ArkWeb_WebMessagePortAPI; + +/** + * @brief Defines the web message data API for native ArkWeb. + * Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check + * whether the function structure has a corresponding function pointer to avoid crash + * caused by mismatch between the SDK and the device ROM. + * + * @since 12 + */ +typedef struct { + /** The ArkWeb_WebMessageAPI struct size. */ + size_t size; + /** + * @brief Used to create a ArkWeb_WebMessage. + * + * @return The created ArkWeb_WebMessage, destroy it through + * destroyWebMessage after it is no longer used. + */ + ArkWeb_WebMessagePtr (*createWebMessage)(); + /** + * @brief Used to destroy a ArkWeb_WebMessage. + * + * @param webMessage The ArkWeb_WebMessage to destroy. + */ + void (*destroyWebMessage)(ArkWeb_WebMessagePtr* webMessage); + /** + * @brief Set the type of ArkWeb_WebMessage. + * + * @param webMessage The ArkWeb_WebMessage. + * @param type The type of ArkWeb_WebMessage. + */ + void (*setType)(ArkWeb_WebMessagePtr webMessage, ArkWeb_WebMessageType type); + /** + * @brief Get the type of ArkWeb_WebMessage. + * + * @param webMessage The ArkWeb_WebMessage. + * @return The type of ArkWeb_WebMessage. + */ + ArkWeb_WebMessageType (*getType)(ArkWeb_WebMessagePtr webMessage); + /** + * @brief Set the data of ArkWeb_WebMessage. + * + * @param webMessage The ArkWeb_WebMessage. + * @param data The data of ArkWeb_WebMessage. + * @param dataLength The length of data. + */ + void (*setData)(ArkWeb_WebMessagePtr webMessage, void* data, size_t dataLength); + /** + * @brief Get the data of ArkWeb_WebMessage. + * + * @param webMessage The ArkWeb_WebMessage. + * @param dataLength The length of data. + * @return The data of ArkWeb_WebMessage. + */ + void* (*getData)(ArkWeb_WebMessagePtr webMessage, size_t* dataLength); +} ArkWeb_WebMessageAPI; + /** * @brief Check whether the member variables of the current struct exist. * @@ -173,6 +349,6 @@ typedef struct { #define ARKWEB_MEMBER_MISSING(s, f) (!ARKWEB_MEMBER_EXISTS(s, f) || !((s)->f)) #ifdef __cplusplus -}; +} #endif #endif // ARKWEB_TYPE_H \ No newline at end of file -- Gitee From 4fa0cfaec26d96997e4e702d909d29d759158245 Mon Sep 17 00:00:00 2001 From: y30025806 Date: Wed, 14 Aug 2024 20:26:11 +0800 Subject: [PATCH 073/620] add start time Signed-off-by: y30025806 Change-Id: I114d276a486588630c97c443eb426f8209c359f6 --- .../av_codec/codec_base/libnative_media_codecbase.ndk.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json index 74292f25c..43ffa275e 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -387,6 +387,10 @@ "first_introduced": "12", "name": "OH_MD_KEY_START_TIME" }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_TRACK_START_TIME" + }, { "first_introduced": "10", "name": "OH_AVCodec_GetCapability" -- Gitee From dd0019bd50d2497e3e9a80f17baef8471cc12b48 Mon Sep 17 00:00:00 2001 From: y30025806 Date: Wed, 14 Aug 2024 20:29:45 +0800 Subject: [PATCH 074/620] fix conflic Signed-off-by: y30025806 Change-Id: I3b4c70769c72b330a6e2275501b453210faa4320 --- multimedia/av_codec/native_avcodec_base.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 2dba60541..d74d09f98 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -940,6 +940,20 @@ extern const char *OH_MD_KEY_VIDEO_SAR; * @since 12 */ extern const char *OH_MD_KEY_START_TIME; +/** + * @brief Key for setting the output color space of video decoder. The value type is int32_t. + * The supported value is {@link OH_COLORSPACE_BT709_LIMIT}, see {@link OH_NativeBuffer_ColorSpace}. It is used in + * {@link OH_VideoDecoder_Configure}. If the color space conversion capability is supported and this key is configured, + * the video decoder will automatically transcode an HDR Vivid video to an SDR video with color space BT709. + * If color space conversion capability is not supported, {@link OH_VideoDecoder_Configure} returns + * {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION}. + * If the input video is not an HDR vivid video, an error {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION} will + * be reported by callback function {@link OH_AVCodecOnError}. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE; /** * @brief Key for start time of track, value type is int64_t. * @@ -947,6 +961,7 @@ extern const char *OH_MD_KEY_START_TIME; * @since 12 */ extern const char *OH_MD_KEY_TRACK_START_TIME; + /** * @brief Media type. * -- Gitee From 3f5e1f96367fa9c2587589d844a42971bce49fcc Mon Sep 17 00:00:00 2001 From: y30025806 Date: Wed, 14 Aug 2024 20:37:22 +0800 Subject: [PATCH 075/620] fix conflic Signed-off-by: y30025806 Change-Id: Iec966d60ae4cfcf3f844ba6ce9242eec1dbd2b63 --- multimedia/av_codec/native_avcodec_base.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index d74d09f98..edc98a2a0 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -940,6 +940,13 @@ extern const char *OH_MD_KEY_VIDEO_SAR; * @since 12 */ extern const char *OH_MD_KEY_START_TIME; +/** + * @brief Key for start time of track, value type is int64_t. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +extern const char *OH_MD_KEY_TRACK_START_TIME; /** * @brief Key for setting the output color space of video decoder. The value type is int32_t. * The supported value is {@link OH_COLORSPACE_BT709_LIMIT}, see {@link OH_NativeBuffer_ColorSpace}. It is used in @@ -954,13 +961,6 @@ extern const char *OH_MD_KEY_START_TIME; * @since 12 */ extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE; -/** - * @brief Key for start time of track, value type is int64_t. - * - * @syscap SystemCapability.Multimedia.Media.CodecBase - * @since 12 - */ -extern const char *OH_MD_KEY_TRACK_START_TIME; /** * @brief Media type. -- Gitee From 961b73a94c093128a4fc773341d9f7102f2f3c39 Mon Sep 17 00:00:00 2001 From: y30025806 Date: Thu, 15 Aug 2024 08:52:44 +0800 Subject: [PATCH 076/620] add err code Signed-off-by: y30025806 Change-Id: I37ce49dabb9d592e9533c2e35d5f7bba6106b7b1 --- multimedia/media_foundation/native_averrors.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/multimedia/media_foundation/native_averrors.h b/multimedia/media_foundation/native_averrors.h index cffaba60e..a1dd55875 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -78,6 +78,11 @@ typedef enum OH_AVErrCode { * @error unsupport interface. */ AV_ERR_UNSUPPORT = 9, + /** + * @error input data error. + * @since 12 + */ + AV_ERR_INPUT_DATA_ERROR = 10, /** * @error extend err start. */ -- Gitee From 7877aaaa617147877591146ae084ba53556ca437 Mon Sep 17 00:00:00 2001 From: wisdom Date: Thu, 15 Aug 2024 09:43:39 +0800 Subject: [PATCH 077/620] Description: Update NDK interface BUILD.gn Signed-off-by: wisdom --- multimedia/audio_framework/BUILD.gn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multimedia/audio_framework/BUILD.gn b/multimedia/audio_framework/BUILD.gn index 3445ac0be..2928db509 100644 --- a/multimedia/audio_framework/BUILD.gn +++ b/multimedia/audio_framework/BUILD.gn @@ -19,6 +19,7 @@ ohos_ndk_headers("ohaudio_header") { sources = [ "audio_capturer/native_audiocapturer.h", "audio_manager/native_audio_routing_manager.h", + "audio_manager/native_audio_session_manager.h", "audio_renderer/native_audiorenderer.h", "common/native_audio_common.h", "common/native_audio_device_base.h", @@ -40,5 +41,6 @@ ohos_ndk_library("libohaudio_ndk") { "ohaudio/native_audio_routing_manager.h", "ohaudio/native_audio_common.h", "ohaudio/native_audio_device_base.h", + "ohaudio/native_audio_session_manager.h", ] } -- Gitee From 3e3b93e6e2934b0f097e872ff0cec5f8d2918f47 Mon Sep 17 00:00:00 2001 From: liyi0309 Date: Thu, 15 Aug 2024 10:06:41 +0800 Subject: [PATCH 078/620] =?UTF-8?q?NDK=20=E5=91=8A=E8=AD=A6=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20Signed-off-by:=20liyi0309?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arkui/ace_engine/native/native_dialog.h | 1 + arkui/ace_engine/native/native_type.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arkui/ace_engine/native/native_dialog.h b/arkui/ace_engine/native/native_dialog.h index 1338eee7a..95b1a6cbe 100644 --- a/arkui/ace_engine/native/native_dialog.h +++ b/arkui/ace_engine/native/native_dialog.h @@ -37,6 +37,7 @@ #ifndef ARKUI_NATIVE_DIALOG_H #define ARKUI_NATIVE_DIALOG_H +#include #include "native_type.h" #ifdef __cplusplus diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 6bf306990..18f2e18b6 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -808,7 +808,7 @@ typedef enum { * does not scroll when the component scrolling reaches the boundary. */ ARKUI_SCROLL_NESTED_MODE_SELF_ONLY = 0, /** The component scrolls first, and when it hits the boundary, the parent component scrolls. - /** When the parent component hits the boundary, its edge effect is displayed. If no edge + * When the parent component hits the boundary, its edge effect is displayed. If no edge * effect is specified for the parent component, the edge effect of the child component is displayed instead. */ ARKUI_SCROLL_NESTED_MODE_SELF_FIRST, /** The parent component scrolls first, and when it hits the boundary, the component scrolls. @@ -1523,7 +1523,7 @@ typedef enum { /** The content of the view is blended in sequence on the target image. */ BLEND_APPLY_TYPE_FAST = 0, /** The content of the component and its child components are drawn on the offscreen canvas, and then blended with - /* the existing content on the canvas. */ + * the existing content on the canvas. */ BLEND_APPLY_TYPE_OFFSCREEN, } ArkUI_BlendApplyType; -- Gitee From e956dbdd67e07f9cb5a7d07364ce045bcec7038e Mon Sep 17 00:00:00 2001 From: zhouchaobo Date: Thu, 15 Aug 2024 10:23:44 +0800 Subject: [PATCH 079/620] native gesture code warning fix Signed-off-by: zhouchaobo Change-Id: I366acad9a146872b962f653095e4894731421c64 --- arkui/ace_engine/native/native_gesture.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arkui/ace_engine/native/native_gesture.h b/arkui/ace_engine/native/native_gesture.h index 19e83b1f5..42b37aa9c 100644 --- a/arkui/ace_engine/native/native_gesture.h +++ b/arkui/ace_engine/native/native_gesture.h @@ -38,6 +38,7 @@ #include "ui_input_event.h" #include "native_type.h" +#include #ifdef __cplusplus extern "C" { -- Gitee From 3fc7d139f605e722224cb3dbc0de7001343b7349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Thu, 15 Aug 2024 11:35:35 +0800 Subject: [PATCH 080/620] =?UTF-8?q?CodeCheck=20=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- multimedia/image_framework/include/image/image_common.h | 2 -- multimedia/image_framework/include/image/pixelmap_native.h | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index d382eeda8..2b8161002 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -133,8 +133,6 @@ typedef enum { IMAGE_SUCCESS = 0, /** invalid parameter */ IMAGE_BAD_PARAMETER = 401, - /** resource unavailable */ - IMAGE_RESOURCE_UNAVAILABLE = 501, /** unsupported mime type */ IMAGE_UNSUPPORTED_MIME_TYPE = 7600101, /** unknown mime type */ diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index bf68694c0..b37820226 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -767,7 +767,7 @@ Image_ErrorCode OH_PixelmapNative_CreateEmptyPixelmap( /** * @brief Get metadata. - * + * * @param pixelmap The Pixelmap pointer to be operated. * @param key Type of metadata. * @param value Value of metadata. @@ -783,7 +783,7 @@ Image_ErrorCode OH_PixelmapNative_GetMetadata(OH_PixelmapNative *pixelmap, OH_Pi /** * @brief Set metadata. - * + * * @param pixelmap The Pixelmap pointer to be operated. * @param key Type of metadata. * @param value Value of metadata. -- Gitee From 30dc5a6ff7e68e44e6b907d5dc005e6f1d9294e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=86=9B=E6=97=97?= Date: Thu, 15 Aug 2024 07:05:05 +0000 Subject: [PATCH 081/620] =?UTF-8?q?AVPlaybackSpeed=E6=96=B0=E5=A2=9E3.0?= =?UTF-8?q?=E3=80=810.25=E3=80=810.125=E5=80=8D=E9=80=9F=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任军旗 --- multimedia/player_framework/avplayer_base.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/multimedia/player_framework/avplayer_base.h b/multimedia/player_framework/avplayer_base.h index 903a52f72..db07e5b76 100644 --- a/multimedia/player_framework/avplayer_base.h +++ b/multimedia/player_framework/avplayer_base.h @@ -121,6 +121,24 @@ typedef enum AVPlaybackSpeed { * @since 12 */ AV_SPEED_FORWARD_1_50_X, + /** + * @brief Video playback at 3.0x normal speed. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 13 + */ + AV_SPEED_FORWARD_3_00_X, + /** + * @brief Video playback at 0.25x normal speed. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 13 + */ + AV_SPEED_FORWARD_0_25_X, + /** + * @brief Video playback at 0.125x normal speed. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 13 + */ + AV_SPEED_FORWARD_0_125_X, } AVPlaybackSpeed; /** -- Gitee From 92423f3ed48fc9f91219fd82d8fc83f831fcbcf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Thu, 15 Aug 2024 15:35:37 +0800 Subject: [PATCH 082/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- multimedia/image_framework/include/image/image_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index 2b8161002..590b69dac 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -139,7 +139,7 @@ typedef enum { IMAGE_UNKNOWN_MIME_TYPE = 7600102, /** too large data or image */ IMAGE_TOO_LARGE = 7600103, - /** DMA memory does not exist */ + /** @error DMA memory does not exist */ IMAGE_DMA_NOT_EXIST = 7600173, /** unsupported operations */ IMAGE_UNSUPPORTED_OPERATION = 7600201, -- Gitee From 7fca7fbbfb76b5d8567a8b45cbe3e14d796c66c1 Mon Sep 17 00:00:00 2001 From: wangyulie Date: Thu, 15 Aug 2024 17:35:56 +0800 Subject: [PATCH 083/620] ffrt add interfaces in API12 Signed-off-by: wangyulie --- resourceschedule/ffrt/c/task.h | 40 +++++++++++++++++++++++++++++ resourceschedule/ffrt/ffrt.ndk.json | 16 ++++++++++++ 2 files changed, 56 insertions(+) diff --git a/resourceschedule/ffrt/c/task.h b/resourceschedule/ffrt/c/task.h index 066493f9e..b789fdc74 100644 --- a/resourceschedule/ffrt/c/task.h +++ b/resourceschedule/ffrt/c/task.h @@ -141,6 +141,26 @@ FFRT_C_API void ffrt_task_attr_set_queue_priority(ffrt_task_attr_t* attr, ffrt_q */ FFRT_C_API ffrt_queue_priority_t ffrt_task_attr_get_queue_priority(const ffrt_task_attr_t* attr); +/** + * @brief Sets the task stack size. + * + * @param attr Indicates a pointer to the task attribute. + * @param size Indicates the task stack size, unit is byte. + * @since 12 + * @version 1.0 + */ +FFRT_C_API void ffrt_task_attr_set_stack_size(ffrt_task_attr_t* attr, uint64_t size); + +/** + * @brief Obtains the task stack size. + * + * @param attr Indicates a pointer to the task attribute. + * @return Returns the task stack size, unit is byte. + * @since 12 + * @version 1.0 + */ +FFRT_C_API uint64_t ffrt_task_attr_get_stack_size(const ffrt_task_attr_t* attr); + /** * @brief Updates the QoS of this task. * @@ -209,6 +229,26 @@ FFRT_C_API void ffrt_submit_base(ffrt_function_header_t* f, const ffrt_deps_t* i FFRT_C_API ffrt_task_handle_t ffrt_submit_h_base(ffrt_function_header_t* f, const ffrt_deps_t* in_deps, const ffrt_deps_t* out_deps, const ffrt_task_attr_t* attr); +/** + * @brief increase reference count of task handle. + * + * @param handle Indicates a task handle. + * @return return the task handle original reference count. + * @since 12 + * @version 1.0 + */ +FFRT_C_API uint32_t ffrt_task_handle_inc_ref(ffrt_task_handle_t handle); + +/** + * @brief decrease reference count of task handle. + * + * @param handle Indicates a task handle. + * @return return the task handle original reference count. + * @since 12 + * @version 1.0 + */ +FFRT_C_API uint32_t ffrt_task_handle_dec_ref(ffrt_task_handle_t handle); + /** * @brief Destroys a task handle. * diff --git a/resourceschedule/ffrt/ffrt.ndk.json b/resourceschedule/ffrt/ffrt.ndk.json index 397494c37..ed52dcc3b 100644 --- a/resourceschedule/ffrt/ffrt.ndk.json +++ b/resourceschedule/ffrt/ffrt.ndk.json @@ -50,11 +50,27 @@ { "name": "ffrt_task_attr_get_qos" }, { "name": "ffrt_task_attr_set_delay" }, { "name": "ffrt_task_attr_get_delay" }, + { + "first_introduced": "12", + "name": "ffrt_task_attr_set_stack_size" + }, + { + "first_introduced": "12", + "name": "ffrt_task_attr_get_stack_size" + }, { "name": "ffrt_this_task_update_qos" }, { "name": "ffrt_this_task_get_id" }, { "name": "ffrt_alloc_auto_managed_function_storage_base" }, { "name": "ffrt_submit_base" }, { "name": "ffrt_submit_h_base" }, + { + "first_introduced": "12", + "name": "ffrt_task_handle_inc_ref" + }, + { + "first_introduced": "12", + "name": "ffrt_task_handle_dec_ref" + }, { "name": "ffrt_task_handle_destroy" }, { "name": "ffrt_wait_deps" }, { "name": "ffrt_wait" }, -- Gitee From fb31df1f6a5167302a4c973f3403d84e0f693ec5 Mon Sep 17 00:00:00 2001 From: NoCodeNoBB Date: Thu, 15 Aug 2024 09:44:54 +0000 Subject: [PATCH 084/620] =?UTF-8?q?=E7=BD=91=E7=BB=9C=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: NoCodeNoBB --- network/netmanager/include/net_connection_type.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index 32a8118c8..36f68e874 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -73,7 +73,12 @@ typedef enum NetConn_NetCap { * Portal * @since 12 */ - NETCONN_NET_CAPABILITY_PORTAL = 17 + NETCONN_NET_CAPABILITY_PORTAL = 17, + /** + * In checking network connectivity. + * @since 12 + */ + NETCONN_NET_CAPABILITY_CHECKING_CONNECTIVITY = 31 } NetConn_NetCap; /** @@ -87,6 +92,11 @@ typedef enum NetConn_NetBearerType { NETCONN_BEARER_CELLULAR = 0, /** WIFI */ NETCONN_BEARER_WIFI = 1, + /** + * Bluetooth + * @since 12 + */ + NETCONN_BEARER_BLUETOOTH = 2, /** Ethernet */ NETCONN_BEARER_ETHERNET = 3, /** -- Gitee From fddad9cb2a43f52def1883f6622fe2f5a0cf2c1c Mon Sep 17 00:00:00 2001 From: yuanjinghua Date: Thu, 15 Aug 2024 15:46:11 +0800 Subject: [PATCH 085/620] Add interfaces for NDK AVPlayer to implement OnError and OnInfo Signed-off-by: yuanjinghua Change-Id: Ie5f7ef84100daca3e0b3b1db502947272e42236d --- multimedia/player_framework/avplayer.h | 28 +++ .../avplayer/libavplayer.ndk.json | 84 ++++++++ multimedia/player_framework/avplayer_base.h | 200 +++++++++++++++++- 3 files changed, 309 insertions(+), 3 deletions(-) diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h index ab0d17cd3..ce355909a 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -462,6 +462,8 @@ OH_AVErrCode OH_AVPlayer_SetLooping(OH_AVPlayer *player, bool loop); * {@link AV_ERR_INVALID_VAL} if input player is nullptr, callback.onInfo or callback.onError is null, * or player SetPlayerCallback failed. * @since 11 + * @deprecated since 12 + * @useinstead {@link OH_AVPlayer_SetPlayerOnInfoCallback} {@link OH_AVPlayer_SetPlayerOnErrorCallback} * @version 1.0 */ OH_AVErrCode OH_AVPlayer_SetPlayerCallback(OH_AVPlayer *player, AVPlayerCallback callback); @@ -563,6 +565,32 @@ OH_AVErrCode OH_AVPlayer_GetMediaKeySystemInfo(OH_AVPlayer *player, DRM_MediaKey OH_AVErrCode OH_AVPlayer_SetDecryptionConfig(OH_AVPlayer *player, MediaKeySession *mediaKeySession, bool secureVideoPath); +/** + * @brief Method to set player information notify callback. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @param player Pointer to an OH_AVPlayer instance. + * @param callback Pointer to callback function, nullptr indicates unregister callback. + * @param userData Pointer to user specific data. + * @return Function result code. + * {@link AV_ERR_OK} if the execution is successful. + * {@link AV_ERR_INVALID_VAL} if input player is null or player SetOnInfoCallback failed. + * @since 12 + */ +OH_AVErrCode OH_AVPlayer_SetOnInfoCallback(OH_AVPlayer *player, OH_AVPlayerOnInfoCallback callback, void *userData); + +/** + * @brief Method to set player error callback. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @param player Pointer to an OH_AVPlayer instance. + * @param callback Pointer to callback function, nullptr indicates unregister callback. + * @param userData Pointer to user specific data. + * @return Function result code. + * {@link AV_ERR_OK} if the execution is successful. + * {@link AV_ERR_INVALID_VAL} if input player is null or player SetOnErrorCallback failed. + * @since 12 + */ +OH_AVErrCode OH_AVPlayer_SetOnErrorCallback(OH_AVPlayer *player, OH_AVPlayerOnErrorCallback callback, void *userData); + #ifdef __cplusplus } #endif diff --git a/multimedia/player_framework/avplayer/libavplayer.ndk.json b/multimedia/player_framework/avplayer/libavplayer.ndk.json index dbfa420ed..d7151471e 100644 --- a/multimedia/player_framework/avplayer/libavplayer.ndk.json +++ b/multimedia/player_framework/avplayer/libavplayer.ndk.json @@ -27,6 +27,90 @@ { "name": "OH_AVPlayer_SelectTrack" }, { "name": "OH_AVPlayer_DeselectTrack" }, { "name": "OH_AVPlayer_GetCurrentTrack" }, + { + "first_introduced": "12", + "name": "OH_PLAYER_STATE" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_STATE_CHANGE_REASON" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_VOLUME" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_BITRATE_ARRAY" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_AUDIO_INTERRUPT_TYPE" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_AUDIO_INTERRUPT_FORCE" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_AUDIO_INTERRUPT_HINT" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_AUDIO_DEVICE_CHANGE_REASON" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_BUFFERING_TYPE" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_BUFFERING_VALUE" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_SEEK_POSITION" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_PLAYBACK_SPEED" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_BITRATE" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_CURRENT_POSITION" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_DURATION" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_VIDEO_WIDTH" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_VIDEO_HEIGHT" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_MESSAGE_TYPE" + }, + { + "first_introduced": "12", + "name": "OH_PLAYER_IS_LIVE_STREAM" + }, + { + "first_introduced": "12", + "name": "OH_AVPlayer_SetOnInfoCallback" + }, + { + "first_introduced": "12", + "name": "OH_AVPlayer_SetOnErrorCallback" + }, { "first_introduced": "12", "name": "OH_AVPlayer_SetMediaKeySystemInfoCallback" diff --git a/multimedia/player_framework/avplayer_base.h b/multimedia/player_framework/avplayer_base.h index 903a52f72..50a8ffa49 100644 --- a/multimedia/player_framework/avplayer_base.h +++ b/multimedia/player_framework/avplayer_base.h @@ -40,6 +40,8 @@ #include +#include "native_avformat.h" + #ifdef __cplusplus extern "C" { #endif @@ -113,13 +115,13 @@ typedef enum AVPlaybackSpeed { * @brief Video playback at 0.5x normal speed. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since 12 - */ + */ AV_SPEED_FORWARD_0_50_X, /** * @brief Video playback at 1.5x normal speed. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since 12 - */ + */ AV_SPEED_FORWARD_1_50_X, } AVPlaybackSpeed; @@ -172,6 +174,169 @@ typedef enum AVPlayerOnInfoType { AV_INFO_TYPE_AUDIO_OUTPUT_DEVICE_CHANGE = 17, } AVPlayerOnInfoType; +/** + * @brief Player Buffering Type + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + * @version 1.0 + */ +typedef enum AVPlayerBufferingType { + /** Indicates the buffer to start buffering. */ + AVPLAYER_BUFFERING_START = 1, + + /** Indicates the buffer to end buffering and start playback. */ + AVPLAYER_BUFFERING_END, + + /** Indicates the current buffering percentage of the buffer. */ + AVPLAYER_BUFFERING_PERCENT, + + /** Indicates how long the buffer cache data can be played. */ + AVPLAYER_BUFFERING_CACHED_DURATION, +} AVPlayerBufferingType; + +/** + * @brief Key to get state, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + * @version 1.0 + */ +extern const char* OH_PLAYER_STATE; + +/** + * @brief Key to get state change reason, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + * @version 1.0 + */ +extern const char* OH_PLAYER_STATE_CHANGE_REASON; + +/** + * @brief Key to get volume, value type is float. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + * @version 1.0 + */ +extern const char* OH_PLAYER_VOLUME; + +/** + * @brief Key to get bitrate count, value type is uint32_t array. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + * @version 1.0 + */ +extern const char* OH_PLAYER_BITRATE_ARRAY; + +/** + * @brief Key to get audio interrupt type, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + * @version 1.0 + */ +extern const char* OH_PLAYER_AUDIO_INTERRUPT_TYPE; + +/** + * @brief Key to get audio interrupt force, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + * @version 1.0 + */ +extern const char* OH_PLAYER_AUDIO_INTERRUPT_FORCE; + +/** + * @brief Key to get audio interrupt hint, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + * @version 1.0 + */ +extern const char* OH_PLAYER_AUDIO_INTERRUPT_HINT; + +/** + * @brief Key to get audio device change reason, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + * @version 1.0 + */ +extern const char* OH_PLAYER_AUDIO_DEVICE_CHANGE_REASON; + +/** + * @brief Key to get buffering type, value type is AVPlayerBufferingType. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + * @version 1.0 + */ +extern const char* OH_PLAYER_BUFFERING_TYPE; + +/** + * @brief Key to get buffering value, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + * @version 1.0 + */ +extern const char* OH_PLAYER_BUFFERING_VALUE; + +/** + * @brief Key to get seek position, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + */ +extern const char* OH_PLAYER_SEEK_POSITION; + +/** + * @brief Key to get playback speed, value type is AVPlaybackSpeed. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + */ +extern const char* OH_PLAYER_PLAYBACK_SPEED; + +/** + * @brief Key to get bitrate, value type is uint32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + */ +extern const char* OH_PLAYER_BITRATE; + +/** + * @brief Key to get current position, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + */ +extern const char* OH_PLAYER_CURRENT_POSITION; + +/** + * @brief Key to get duration, value type is int64_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + */ +extern const char* OH_PLAYER_DURATION; + +/** + * @brief Key to get video width, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + */ +extern const char* OH_PLAYER_VIDEO_WIDTH; + +/** + * @brief Key to get video height, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + */ +extern const char* OH_PLAYER_VIDEO_HEIGHT; + +/** + * @brief Key to get message type, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + */ +extern const char* OH_PLAYER_MESSAGE_TYPE; + +/** + * @brief Key to get is live stream, value type is int32_t. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 12 + */ +extern const char* OH_PLAYER_IS_LIVE_STREAM; + /** * @brief Called when a player message or alarm is received. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -179,10 +344,24 @@ typedef enum AVPlayerOnInfoType { * @param type Indicates the information type. For details, see {@link AVPlayerOnInfoType}. * @param extra Indicates other information, for example, the start time position of a playing file. * @since 11 + * @deprecated since 12 + * @useinstead {@link OH_AVPlayerOnInfoCallback} * @version 1.0 */ typedef void (*OH_AVPlayerOnInfo)(OH_AVPlayer *player, AVPlayerOnInfoType type, int32_t extra); +/** + * @brief Called when a player info event is received. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @param player The pointer to an OH_AVPlayer instance. + * @param type Indicates the information type. For details, see {@link AVPlayerOnInfoType}. + * @param infoBody Indicates the information parameters, only valid in callback function. + * @param userData Pointer to user specific data. + * @since 12 + */ +typedef void (*OH_AVPlayerOnInfoCallback)(OH_AVPlayer *player, AVPlayerOnInfoType type, OH_AVFormat* infoBody, + void *userData); + /** * @brief Called when an error occurred for versions above api9 * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -190,10 +369,24 @@ typedef void (*OH_AVPlayerOnInfo)(OH_AVPlayer *player, AVPlayerOnInfoType type, * @param errorCode Error code. * @param errorMsg Error message. * @since 11 + * @deprecated since 12 + * @useinstead {@link OH_AVPlayerOnInfoCallback} {@link OH_AVPlayerOnError} * @version 1.0 */ typedef void (*OH_AVPlayerOnError)(OH_AVPlayer *player, int32_t errorCode, const char *errorMsg); +/** + * @brief Called when an error occurred. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @param player The pointer to an OH_AVPlayer instance. + * @param errorCode Error code. + * @param errorMsg Error message, only valid in callback function. + * @param userData Pointer to user specific data. + * @since 12 + */ +typedef void (*OH_AVPlayerOnErrorCallback)(OH_AVPlayer *player, int32_t errorCode, const char *errorMsg, + void *userData); + /** * @brief A collection of all callback function pointers in OH_AVPlayer. Register an instance of this * structure to the OH_AVPlayer instance, and process the information reported through the callback to ensure the @@ -202,6 +395,8 @@ typedef void (*OH_AVPlayerOnError)(OH_AVPlayer *player, int32_t errorCode, const * @param onInfo Monitor OH_AVPlayer operation information, refer to {@link OH_AVPlayerOnInfo} * @param onError Monitor OH_AVPlayer operation errors, refer to {@link OH_AVPlayerOnError} * @since 11 + * @deprecated since 12 + * @useinstead {@link OH_AVPlayerOnInfoCallback} {@link OH_AVPlayerOnErrorCallback} * @version 1.0 */ typedef struct AVPlayerCallback { @@ -209,7 +404,6 @@ typedef struct AVPlayerCallback { OH_AVPlayerOnError onError; } AVPlayerCallback; - #ifdef __cplusplus } #endif -- Gitee From b218ea6c0a2d3a9823bfacd62a5cbafc6dcedaae Mon Sep 17 00:00:00 2001 From: rchdlee Date: Thu, 15 Aug 2024 19:25:28 +0800 Subject: [PATCH 086/620] =?UTF-8?q?=E8=A1=A5=E5=85=85=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=90=8E=E5=A4=84=E7=90=86key=E4=BF=A1=E6=81=AF=E5=88=B0json?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rchdlee --- .../av_codec/codec_base/libnative_media_codecbase.ndk.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json index 576beec06..589823ef3 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -387,6 +387,10 @@ "first_introduced": "12", "name": "OH_MD_KEY_TRACK_START_TIME" }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE" + }, { "first_introduced": "10", "name": "OH_AVCodec_GetCapability" -- Gitee From 09588e4f6e8b6721eafc3444d109a797a3fb6647 Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Fri, 16 Aug 2024 02:32:36 +0000 Subject: [PATCH 087/620] Add Interface Capi Signed-off-by: hellohyh001 Change-Id: I0396681bbeac77b35fc193d7f1124e3f72511f69 --- multimodalinput/kits/c/input/oh_input_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 479df3903..fcd7303ed 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -1186,7 +1186,7 @@ Input_Result OH_Input_RemoveInputEventInterceptor(); * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ -int32_t OH_Input_GetIntervalSinceLastInput(int64_t *timeInterval); +Input_Result OH_Input_GetIntervalSinceLastInput(int64_t *timeInterval); #ifdef __cplusplus } #endif -- Gitee From 87a68d9cf62fa6dc25b140fa5d5bbc4dd07c8e25 Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Fri, 16 Aug 2024 02:34:01 +0000 Subject: [PATCH 088/620] Add Interface Capi Signed-off-by: hellohyh001 Change-Id: I2633541e1c92061b96235bd45f0bb053a1e1513b --- multimodalinput/kits/c/input/oh_input_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index fcd7303ed..60358bb79 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -1182,7 +1182,7 @@ Input_Result OH_Input_RemoveInputEventInterceptor(); * @return OH_Input_GetIntervalSinceLastInput status code, specifically. * {@Link INPUT_SUCCESS} if the Operation is successful.\n * {@Link INPUT_SERVICE_EXCEPTION} Failed to get the interval because the service is exception.\n - * {@link INPUT_PARAMETER_ERROR} Parameter check failed.\n + * {@Link INPUT_PARAMETER_ERROR} The timeInterval is NULL.\n * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ -- Gitee From f3f0b67d815044c3eb25a1337cf6d96eef4a96ff Mon Sep 17 00:00:00 2001 From: ccfriend Date: Fri, 16 Aug 2024 10:14:26 +0000 Subject: [PATCH 089/620] add test.txt. Signed-off-by: ccfriend --- test.txt | 468 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 468 insertions(+) create mode 100644 test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 000000000..5689b5143 --- /dev/null +++ b/test.txt @@ -0,0 +1,468 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup OHAVSession + * @{ + * + * @brief Provide the definition of the C interface for the native avsession. + * + * @syscap SystemCapability.Multimedia.AVSession.Core + * + * @since 12 + * @version 1.0 + */ + +/** + * @file native_avsession.h + * + * @brief Declare avsession interface. + * + * @library libohavsession.so + * @syscap SystemCapability.Multimedia.AVSession.Core + * @kit AVSessionKit + * @since 12 + * @version 1.0 + */ + +#ifndef NATIVE_AVSESSION_H +#define NATIVE_AVSESSION_H + +#include "native_avsession_base.h" +#include "native_avsession_errors.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Capture session object + * + * A pointer can be created using {@link OH_AVSession} method. + * + * @since 12 + * @version 1.0 + */ +typedef struct OH_AVSession OH_AVSession; + +/* + * Request to create the avsession. + * + * @since 12 + * + * @param avsession reference + * @return Function result code + */ +OH_AVSession_ErrCode OH_AVSession_Create(AVSession_Type sessionType, const char* sessionTag, OH_AVSession** avsession); + +/* + * Request to release the avsession. + * + * @since 12 + * + * @param avsession reference + * @return Function result code + */ +OH_AVSession_ErrCode OH_AVSession_Destroy(OH_AVSession* avsession); + +/* + * Request to set av metadata. + * + * @since 12 + * + * @param avsession reference + * @return Function result code + */ +OH_AVSession_ErrCode OH_AVSession_SetAVMetadata(OH_AVSession* avsession, AVSession_AVMetadata* metadata); + +/* + * Request to set av playbackstate. + * + * @since 12 + * + * @param avsession reference + * @return Function result code + */ +OH_AVSession_ErrCode OH_AVSession_SetAVPlaybackState(OH_AVSession* avsession, AVSession_AVPlaybackState* playbackState); + +/* + * Request to register callback. + * + * @since 12 + * + * @param avsession reference + * @return Function result code + */ +OH_AVSession_ErrCode OH_AVSession_RegisterCallback(OH_AVSession* avsession, AVSession_Callbacks* callback); + +#ifdef __cplusplus +} +#endif +#endif // NATIVE_AVSESSION_H + +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup AVSession + * @{ + * + * @brief Provides APIs of request capability for AVSession. + * @since 12 + */ + +/** + * @file native_avsession_base.h + * + * @brief Declare avsession related definations. + * + * @library libohavsession.so + * @syscap SystemCapability.Multimedia.AVSession.Core + * @kit AVSessionKit + * @since 12 + */ + +#ifndef NATIVE_AVSESSION_ERRORS_H +#define NATIVE_AVSESSION_ERRORS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enum for avsession type. + * + * @since 12 + * @version 1.0 + */ +typedef enum AVSession_Type { + SESSION_TYPE_INVALID = -1, + SESSION_TYPE_AUDIO = 0, + SESSION_TYPE_VIDEO = 1, + SESSION_TYPE_VOICE_CALL = 2, + SESSION_TYPE_VIDEO_CALL = 3 +} AVSession_Type; + +typedef struct AVSession_AVMetadata { + char* assetId; + char* title; + char* artist; + char* author; + // std::string avQueueName_ = ""; + // std::string avQueueId_ = ""; + // std::shared_ptr avQueueImage_ = nullptr; + // std::string avQueueImageUri_ = ""; + char* album; + // std::string writer_ = ""; + // std::string composer_ = ""; + int64_t duration; + // std::shared_ptr mediaImage_ = nullptr; + char* mediaImageUri; + // double publishDate_ = 0; + // std::string subTitle_ = ""; + // std::string description_ = ""; + // std::string lyric_ = ""; + // std::string previousAssetId_ = ""; + // std::string nextAssetId_ = ""; + // int32_t skipIntervals_ = SECONDS_15; + // int32_t filter_ = 2; + // int32_t mediaLength_ = 0; + // int32_t avQueueLength_ = 0; + // int32_t displayTags_ = 0; + // std::vector drmSchemes_; +} AVSession_AVMetadata; + +typedef enum AVSession_PlaybackState { + PLAYBACK_STATE_INITIAL = 0, + PLAYBACK_STATE_PREPARE = 1, + PLAYBACK_STATE_PLAY = 2, + PLAYBACK_STATE_PAUSE = 3, + PLAYBACK_STATE_FAST_FORWARD = 4, + PLAYBACK_STATE_REWIND = 5, + PLAYBACK_STATE_STOP = 6, + PLAYBACK_STATE_COMPLETED = 7, + PLAYBACK_STATE_RELEASED = 8, + PLAYBACK_STATE_ERROR = 9, + PLAYBACK_STATE_IDLE = 10, + PLAYBACK_STATE_BUFFERING = 11, + PLAYBACK_STATE_MAX = 12, +} AVSession_PlaybackState; + +typedef struct AVSession_PlaybackPosition { + int64_t elapsedTime_; + int64_t updateTime_; +} AVSession_PlaybackPosition; + +typedef struct AVSession_AVPlaybackState { + AVSession_PlaybackState state; + AVSession_PlaybackPosition position; + int64_t duration; +} AVSession_AVPlaybackState; + + +typedef enum AVSession_LoopMode { + LOOP_MODE_SEQUENCE = 0, + LOOP_MODE_SINGLE = 1, + LOOP_MODE_LIST = 2, + LOOP_MODE_SHUFFLE = 3, + LOOP_MODE_CUSTOM = 4, +} AVSession_LoopMode; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +/** + * @brief Enum for command state. + * + * @since 12 + * @version 1.0 + */ +typedef enum AVSession_ControlCommand { + SESSION_CMD_INVALID = -1, + SESSION_CMD_PLAY = 0, + SESSION_CMD_PAUSE = 1, + SESSION_CMD_STOP = 2, + SESSION_CMD_PLAY_NEXT = 3, + SESSION_CMD_PLAY_PREVIOUS = 4, + SESSION_CMD_FAST_FORWARD = 5, + SESSION_CMD_REWIND = 6, + SESSION_CMD_SEEK = 7, + SESSION_CMD_SET_SPEED = 8, + SESSION_CMD_SET_LOOP_MODE = 9, + SESSION_CMD_TOGGLE_FAVORITE = 10, + SESSION_CMD_PLAY_FROM_ASSETID = 11, + SESSION_CMD_AVCALL_ANSWER = 12, + SESSION_CMD_AVCALL_HANG_UP = 13, + SESSION_CMD_AVCALL_TOGGLE_CALL_MUTE = 14, + SESSION_CMD_MEDIA_KEY_SUPPORT = 15, + SESSION_CMD_PLAYFROM_ASSET_ID = 16, + SESSION_CMD_MAX +} AVSession_ControlCommand; + +/** + * parameter of the command. Whether this command requires parameters, see {@link AVSessionCommand} + * seek command requires a number parameter + * setSpeed command requires a number parameter + * setLoopMode command requires a {@link LoopMode} parameter. + * toggleFavorite command requires assetId {@link AVMetadata.assetId} parameter + * other commands need no parameter + * @type { ?(LoopMode | string | number) } + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ +// parameter?: LoopMode | string | number; +typedef union AVSession_ControlParameters { + int32_t elapsedTime_; + int64_t updateTime_; + // int32_t + // double + // int64_t + // bool + // std::string +} AVSession_ControlParameters; + +/** + * @brief Control callback to be called in {@link OH_AVSession_ControlCallback}. + * + * @param session the {@link OH_AVSession} which object delivers the callback. + * @param command the {@link AVSession_ControlCommand} which command to be received by the callback. + * @since 11 + */ +typedef void (*OH_AVSession_ControlCallback)(OH_AVSession* session, + AVSession_ControlCommand command, AVSession_ControlParameters controlParameters); + +typedef struct AVSession_Callbacks { + /** + * Control command event callback. + */ + OH_AVSession_ControlCallback onControlCallback; +} AVSession_Callbacks; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +typedef void (*OH_AVSession_Callback_Play)(OH_AVSession* session); +typedef void (*OH_AVSession_Callback_Pause)(OH_AVSession* session); +typedef void (*OH_AVSession_Callback_Stop)(OH_AVSession* session); +typedef void (*OH_AVSession_Callback_Next)(OH_AVSession* session); +typedef void (*OH_AVSession_Callback_Previous)(OH_AVSession* session); +typedef void (*OH_AVSession_Callback_Forward)(OH_AVSession* session); +typedef void (*OH_AVSession_Callback_Rewind)(OH_AVSession* session); +typedef void (*OH_AVSession_Callback_SetSpeed)(OH_AVSession* session, int32_t speed); +typedef void (*OH_AVSession_Callback_SetLoopMode)(OH_AVSession* session, AVSession_LoopMode curLoopMode); +typedef void (*OH_AVSession_Callback_ToggleFavorite)(OH_AVSession* session, char* assetId); +typedef void (*OH_AVSession_Callback_Seek)(OH_AVSession* session, int64_t seekTime); +typedef void (*OH_AVSession_Callback_PlayFromAssetId)(OH_AVSession* session, char* assetId); +typedef void (*OH_AVSession_Callback_Answer)(OH_AVSession* session); +typedef void (*OH_AVSession_Callback_Hangup)(OH_AVSession* session); +typedef void (*OH_AVSession_Callback_ToggleCallMute)(OH_AVSession* session); +typedef void (*OH_AVSession_Callback_HandleKeyEvent)(OH_AVSession* session, Input_KeyEvent keyEvent); + +#ifdef __cplusplus +} +#endif + +#endif // NATIVE_AVSESSION_ERRORS_H +/** @} */ + +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup AVSession + * @{ + * + * @brief Provides APIs of request capability for AVSession. + * @since 12 + */ + +/** + * @file native_avsession_errors.h + * + * @brief Declare avsession related error. + * + * @library libohavsession.so + * @syscap SystemCapability.Multimedia.AVSession.Core + * @kit AVSessionKit + * @since 12 + */ + +#ifndef NATIVE_AVSESSION_ERRORS_H +#define NATIVE_AVSESSION_ERRORS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief AVSession error code + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 10 + * @version 1.0 + */ +typedef enum OH_AVSession_ErrCode { + /** + * @error the operation completed successfully. + */ + AV_SESSION_ERR_SUCCESS = 0, + /** + * @error basic error mask. + */ + AV_SESSION_ERR_BASE = 1000, + /** + * @error no memory. + */ + AV_SESSION_ERR_NO_MEMORY = AV_SESSION_ERR_BASE + 1, + + + AV_SESSION_ERR_INVALID_PARAM = AV_SESSION_ERR_BASE + 2, + + AV_SESSION_ERR_SERVICE_NOT_EXIST = AV_SESSION_ERR_BASE + 3, + + AV_SESSION_ERR_SESSION_LISTENER_EXIST = AV_SESSION_ERR_BASE + 4, +} OH_AVSession_ErrCode; + +#ifdef __cplusplus +} +#endif + +#endif // NATIVE_AVSESSION_ERRORS_H +/** @} */ + + +[ + { + "first_introduced": "12", + "name": "OH_AVSession_Create" + }, + { + "first_introduced": "12", + "name": "OH_AVSession_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_AVSession_SetAVMetadata" + }, + { + "first_introduced": "12", + "name": "OH_AVSession_SetAVPlaybackState" + }, + { + "first_introduced": "12", + "name": "OH_AVSession_RegisterCallback" + } +] + +# Copyright (C) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_headers("avsession_header") { + dest_dir = "$ndk_headers_out_dir/multimedia/av_session" + sources = [ + "native_avsesion.h", + "native_avsesion_base.h", + "native_avsesion_errors.h", + ] +} + +ohos_ndk_library("libohavsession_ndk") { + output_name = "ohavsession" + output_extension = "so" + ndk_description_file = "./libavsession.ndk.json" + system_capability = "SystemCapability.Multimedia.AVSession.Core" + system_capability_headers = [ + "multimedia/av_session/native_avsesion.h", + "multimedia/av_session/native_avsesion_base.h", + "multimedia/av_session/native_avsesion_errors.h", + ] +} \ No newline at end of file -- Gitee From cdab505c271bfbfd591fd9d0b704f1bc6f11887d Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Fri, 16 Aug 2024 12:18:43 +0000 Subject: [PATCH 090/620] Add interface capi Signed-off-by: hellohyh001 Change-Id: I3c517edb2ad0700f29be2b59d705d9e53eb92d7e --- multimodalinput/kits/c/input/oh_input_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 60358bb79..5a823afcf 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -1178,7 +1178,7 @@ Input_Result OH_Input_RemoveInputEventInterceptor(); /** * @brief Obtains the interval since the last system input event. * - * @param timeInterval Interval, in nanoseconds. + * @param timeInterval Interval, in microseconds. * @return OH_Input_GetIntervalSinceLastInput status code, specifically. * {@Link INPUT_SUCCESS} if the Operation is successful.\n * {@Link INPUT_SERVICE_EXCEPTION} Failed to get the interval because the service is exception.\n -- Gitee From 4fe48219f8bfb2ee3b9612c019456933e91cd019 Mon Sep 17 00:00:00 2001 From: yanghaiming Date: Fri, 16 Aug 2024 19:13:14 +0800 Subject: [PATCH 091/620] add interface for: - array buffer backing store - wasm compile and cache Signed-off-by: yanghaiming --- ark_runtime/jsvm/jsvm.h | 131 ++++++++++++++++++++++++++++++ ark_runtime/jsvm/jsvm_types.h | 24 ++++++ ark_runtime/jsvm/libjsvm.ndk.json | 28 +++++++ 3 files changed, 183 insertions(+) diff --git a/ark_runtime/jsvm/jsvm.h b/ark_runtime/jsvm/jsvm.h index 190a60def..2d147ef68 100644 --- a/ark_runtime/jsvm/jsvm.h +++ b/ark_runtime/jsvm/jsvm.h @@ -718,6 +718,54 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateArraybuffer(JSVM_Env env, void** data, JSVM_Value* result); +/** + * @brief This API allocate the memory of array buffer backing store. + * + * @param byteLength: size of backing store memory. + * @param initialized: initialization status of the backing store memory. + * @param data: pointer that recieve the backing store memory pointer. + * @return Returns JSVM funtions result code. + * Returns {@link JSVM_OK } if allocation succeed.\n + * Returns {@link JSVM_GENERIC_FAILURE } if allocation failed.\n + * @since 12 + */ +JSVM_Status JSVM_CDECL OH_JSVM_AllocateArrayBufferBackingStoreData(size_t byteLength, + JSVM_InitializedFlag initialized, + void **data); + +/** + * @brief This API release the memory of an array buffer backing store. + * + * @param data: pointer to the backing store memory. + * @return Only returns JSVM_OK, because this API will not trigger any exception. + * @since 12 + */ +JSVM_Status JSVM_CDECL OH_JSVM_FreeArrayBufferBackingStoreData(void *data); + +/** + * @brief This API create an array buffer using the backing store data. + * + * @param env: The environment that the API is invoked under. + * @param data: pointer to the backing store memory. + * @param backingStoreSize: size of backing store memory in byte. + * @param offset: start position of the array buffer in the backing store memory. + * @param arrayBufferSize: size of the array buffer in byte. + * @param result: pointer that recieve the array buffer. + * @return Returns JSVM funtions result code. + * Returns {@link JSVM_OK } if creation succeed.\n + * Returns {@link JSVM_INVALID_ARG } if any of the following condition reached:\n + * 1. offset + arrayBufferSize > backingStoreSize\n + * 2. backingStoreSize or arrayBufferSize equals zero + * 3. data or result is null pointer + * @since 12 + */ +JSVM_Status JSVM_CDECL OH_JSVM_CreateArraybufferFromBackingStoreData(JSVM_Env env, + void *data, + size_t backingStoreSize, + size_t offset, + size_t arrayBufferSize, + JSVM_Value *result); + /** * @brief This API does not observe leap seconds; they are ignored, as ECMAScript aligns with POSIX time specification. * This API allocates a JavaScript Date object. @@ -2893,6 +2941,89 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ReleaseScript(JSVM_Env env, JSVM_Script script); JSVM_EXTERN JSVM_Status OH_JSVM_OpenInspectorWithName(JSVM_Env env, int pid, const char* name); + +/** + * @brief Compile WebAssembly bytecode into a WebAssembly module. + * If WebAssembly cache provided, deserialization will be performed. + * + * @param env: The environment that the API is invoked under. + * @param wasmBytecode: WebAssembly bytecode. + * @param wasmBytecodeLength: WebAssembly bytecode length in byte. + * @param cacheData: Optional WebAssembly cache. + * @param cacheDataLength: Optional WebAssembly cache length in byte. + * @param cacheRejected: Output parameter representing whether the provided cacheData is rejected. + * @param wasmModule: Output parameter representing compiled WebAssembly module. + * @return Returns JSVM funtions result code. + * Returns {@link JSVM_OK } if the function executed successfully.\n + * Returns {@link JSVM_INVALID_ARG } if any of env, wasmBytecode is NULL, or data length is invalid.\n + * Returns {@link JSVM_GENERIC_FAILURE } if compile failed.\n + * Returns {@link JSVM_PENDING_EXCEPTION } if an exception occurs.\n + * + * @since 12 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_CompileWasmModule(JSVM_Env env, + const uint8_t *wasmBytecode, + size_t wasmBytecodeLength, + const uint8_t *cacheData, + size_t cacheDataLength, + bool *cacheRejected, + JSVM_Value *wasmModule); + +/** + * @brief Compile the function with the specified index in the WebAssembly module + * into the specified optimization level. + * + * @param env: The environment that the API is invoked under. + * @param wasmModule: The WebAssembly module to which the function to compiled belongs. + * @param functionIndex: The index of the function to be compiled, should never be out of range. + * @param optLevel: Optimization level the function will be compiled with. + * @return Returns JSVM funtions result code. + * Returns {@link JSVM_OK } if the function executed successfully.\n + * Returns {@link JSVM_INVALID_ARG } if env is NULL, or wasmModule is NULL or is not a WebAssembly module.\n + * Returns {@link JSVM_GENERIC_FAILURE } if functionIndex out of range or compile failed.\n + * Returns {@link JSVM_PENDING_EXCEPTION } if an exception occurs.\n + * + * @since 12 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_CompileWasmFunction(JSVM_Env env, + JSVM_Value wasmModule, + uint32_t functionIndex, + JSVM_WasmOptLevel optLevel); + +/** + * @brief Check whether the given JSVM_Value is a WebAssembly module. + * + * @param env: The environment that the API is invoked under. + * @param value: The JavaScript value to check. + * @param result: Whether the given value is a WebAssembly module. + * @return Returns JSVM funtions result code. + * Returns {@link JSVM_OK } if the function executed successfully.\n + * Returns {@link JSVM_INVALID_ARG } if any of the input arguments is NULL.\n + * + * @since 12 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_IsWasmModuleObject(JSVM_Env env, + JSVM_Value value, + bool* result); + +/** + * @brief Create cache for compiled WebAssembly module. + * + * @param env: The environment that the API is invoked under. + * @param wasmModule: The compiled WebAssembly module. + * @param data: Output parameter representing generated WebAssembly module cache. + * @param length: Output parameter representing byte length of generated WebAssembly module cache. + * @return Returns JSVM funtions result code. + * Returns {@link JSVM_OK } if the function executed successfully.\n + * Returns {@link JSVM_INVALID_ARG } if any of the input arguments is NULL.\n + * Returns {@link JSVM_GENERIC_FAILURE } if create wasm cache failed.\n + * + * @since 12 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_CreateWasmCache(JSVM_Env env, + JSVM_Value wasmModule, + const uint8_t** data, + size_t* length); EXTERN_C_END /** @} */ #endif /* ARK_RUNTIME_JSVM_JSVM_H */ diff --git a/ark_runtime/jsvm/jsvm_types.h b/ark_runtime/jsvm/jsvm_types.h index b3fb450d5..b68d33d5a 100644 --- a/ark_runtime/jsvm/jsvm_types.h +++ b/ark_runtime/jsvm/jsvm_types.h @@ -734,5 +734,29 @@ typedef enum { /** Unicode Sets mode. */ JSVM_REGEXP_UNICODE_SETS = 1 << 8, } JSVM_RegExpFlags; + +/** + * @brief initialization flag + * + * @since 12 + */ +typedef enum { + /** initialize with zero. */ + JSVM_ZERO_INITIALIZED, + /** leave uninitialized. */ + JSVM_UNINITIALIZED, +} JSVM_InitializedFlag; + +/** + * @brief WebAssembly function optimization level + * + * @since 12 + */ +typedef enum { + /** baseline optimization level. */ + JSVM_WASM_OPT_BASELINE = 10, + /** high optimization level. */ + JSVM_WASM_OPT_HIGH = 20, +} JSVM_WasmOptLevel; /** @} */ #endif /* ARK_RUNTIME_JSVM_JSVM_TYPE_H */ diff --git a/ark_runtime/jsvm/libjsvm.ndk.json b/ark_runtime/jsvm/libjsvm.ndk.json index f7308460d..deb7e9bca 100644 --- a/ark_runtime/jsvm/libjsvm.ndk.json +++ b/ark_runtime/jsvm/libjsvm.ndk.json @@ -702,5 +702,33 @@ { "first_introduced": "12", "name": "OH_JSVM_OpenInspectorWithName" + }, + { + "first_introduced": "12", + "name": "OH_JSVM_AllocateArrayBufferBackingStoreData" + }, + { + "first_introduced": "12", + "name": "OH_JSVM_FreeArrayBufferBackingData" + }, + { + "first_introduced": "12", + "name": "OH_JSVM_CreateArraybufferFromBackingData" + }, + { + "first_introduced": "12", + "name": "OH_JSVM_CompileWasmModule" + }, + { + "first_introduced": "12", + "name": "OH_JSVM_CompileWasmFunction" + }, + { + "first_introduced": "12", + "name": "OH_JSVM_IsWasmModuleObject" + }, + { + "first_introduced": "12", + "name": "OH_JSVM_CreateWasmCache" } ] -- Gitee From cff97b3084d040541fcaa307f0255538711727ca Mon Sep 17 00:00:00 2001 From: liuweili Date: Sat, 17 Aug 2024 15:46:16 +0800 Subject: [PATCH 092/620] add Signed-off-by: liuweili --- ark_runtime/jsvm/jsvm.h | 25 ++++++++++++++++++++++--- ark_runtime/jsvm/jsvm_types.h | 12 ++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/ark_runtime/jsvm/jsvm.h b/ark_runtime/jsvm/jsvm.h index 2d147ef68..606519bd1 100644 --- a/ark_runtime/jsvm/jsvm.h +++ b/ark_runtime/jsvm/jsvm.h @@ -726,6 +726,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateArraybuffer(JSVM_Env env, * @param data: pointer that recieve the backing store memory pointer. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if allocation succeed.\n + * Returns {@link JSVM_INVALID_ARG } if data is null pointer.\n * Returns {@link JSVM_GENERIC_FAILURE } if allocation failed.\n * @since 12 */ @@ -737,7 +738,9 @@ JSVM_Status JSVM_CDECL OH_JSVM_AllocateArrayBufferBackingStoreData(size_t byteLe * @brief This API release the memory of an array buffer backing store. * * @param data: pointer to the backing store memory. - * @return Only returns JSVM_OK, because this API will not trigger any exception. + * @return Returns JSVM funtions result code. + * Returns {@link JSVM_OK } if run succeed.\n + * Returns {@link JSVM_INVALID_ARG } if data is null pointer.\n * @since 12 */ JSVM_Status JSVM_CDECL OH_JSVM_FreeArrayBufferBackingStoreData(void *data); @@ -747,9 +750,9 @@ JSVM_Status JSVM_CDECL OH_JSVM_FreeArrayBufferBackingStoreData(void *data); * * @param env: The environment that the API is invoked under. * @param data: pointer to the backing store memory. - * @param backingStoreSize: size of backing store memory in byte. + * @param backingStoreSize: size of backing store memory. * @param offset: start position of the array buffer in the backing store memory. - * @param arrayBufferSize: size of the array buffer in byte. + * @param arrayBufferSize: size of the array buffer. * @param result: pointer that recieve the array buffer. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if creation succeed.\n @@ -3024,6 +3027,22 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateWasmCache(JSVM_Env env, JSVM_Value wasmModule, const uint8_t** data, size_t* length); + +/** + * @brief Release cache data with specified cache type. + * + * @param env: The environment that the API is invoked under. + * @param cacheData: The cache data to be released, double free is undefined behaviors. + * @param cacheType: The type of cache data. + * @return Returns JSVM funtions result code. + * Returns {@link JSVM_OK } if the function executed successfully.\n + * Returns {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL or cacheType is illegal.\n + * + * @since 12 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_ReleaseCache(JSVM_Env env, + const uint8_t* cacheData, + JSVM_CacheType cacheType); EXTERN_C_END /** @} */ #endif /* ARK_RUNTIME_JSVM_JSVM_H */ diff --git a/ark_runtime/jsvm/jsvm_types.h b/ark_runtime/jsvm/jsvm_types.h index b68d33d5a..1f4145245 100644 --- a/ark_runtime/jsvm/jsvm_types.h +++ b/ark_runtime/jsvm/jsvm_types.h @@ -758,5 +758,17 @@ typedef enum { /** high optimization level. */ JSVM_WASM_OPT_HIGH = 20, } JSVM_WasmOptLevel; + +/** + * @brief Cache data type + * + * @since 12 + */ +typedef enum { + /** js code cache, generated by OH_JSVM_CreateCodeCache */ + JSVM_CACHE_TYPE_JS, + /** WebAssembly cache, generated by OH_JSVM_CreateWasmCache */ + JSVM_CACHE_TYPE_WASM, +} JSVM_CacheType; /** @} */ #endif /* ARK_RUNTIME_JSVM_JSVM_TYPE_H */ -- Gitee From 80db6ff5b7232950b43eaced8bb65219ed6846e9 Mon Sep 17 00:00:00 2001 From: yanghaiming Date: Sat, 17 Aug 2024 20:25:02 +0800 Subject: [PATCH 093/620] standarlize interface name Signed-off-by: yanghaiming --- ark_runtime/jsvm/jsvm.h | 2 +- ark_runtime/jsvm/libjsvm.ndk.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ark_runtime/jsvm/jsvm.h b/ark_runtime/jsvm/jsvm.h index 606519bd1..0d9fa9ad1 100644 --- a/ark_runtime/jsvm/jsvm.h +++ b/ark_runtime/jsvm/jsvm.h @@ -762,7 +762,7 @@ JSVM_Status JSVM_CDECL OH_JSVM_FreeArrayBufferBackingStoreData(void *data); * 3. data or result is null pointer * @since 12 */ -JSVM_Status JSVM_CDECL OH_JSVM_CreateArraybufferFromBackingStoreData(JSVM_Env env, +JSVM_Status JSVM_CDECL OH_JSVM_CreateArrayBufferFromBackingStoreData(JSVM_Env env, void *data, size_t backingStoreSize, size_t offset, diff --git a/ark_runtime/jsvm/libjsvm.ndk.json b/ark_runtime/jsvm/libjsvm.ndk.json index deb7e9bca..a9a775724 100644 --- a/ark_runtime/jsvm/libjsvm.ndk.json +++ b/ark_runtime/jsvm/libjsvm.ndk.json @@ -709,11 +709,11 @@ }, { "first_introduced": "12", - "name": "OH_JSVM_FreeArrayBufferBackingData" + "name": "OH_JSVM_FreeArrayBufferBackingStoreData" }, { "first_introduced": "12", - "name": "OH_JSVM_CreateArraybufferFromBackingData" + "name": "OH_JSVM_CreateArrayBufferFromBackingStoreData" }, { "first_introduced": "12", -- Gitee From c988329755cfb15854c20ac4ac0e4a01873b14c5 Mon Sep 17 00:00:00 2001 From: caochuan Date: Sun, 18 Aug 2024 13:29:18 +0800 Subject: [PATCH 094/620] add media asset ndk Signed-off-by: caochuan --- multimedia/camera_framework/BUILD.gn | 2 + multimedia/camera_framework/camera.ndk.json | 36 ++++ multimedia/camera_framework/camera_manager.h | 14 ++ multimedia/camera_framework/photo_native.h | 89 +++++++++ multimedia/camera_framework/photo_output.h | 92 +++++++++ .../media_library/media_access_helper_capi.h | 68 +++++++ .../media_library/media_asset_base_capi.h | 184 +++++++++++++++++- multimedia/media_library/media_asset_capi.h | 170 ++++++++++++++++ .../media_asset_change_request_capi.h | 130 +++++++++++++ .../media_asset_manager/BUILD.gn | 6 + .../lib_media_asset_namager_capi.ndk.json | 60 ++++++ .../media_library/media_asset_manager_capi.h | 30 ++- 12 files changed, 871 insertions(+), 10 deletions(-) create mode 100644 multimedia/camera_framework/photo_native.h create mode 100644 multimedia/media_library/media_access_helper_capi.h create mode 100644 multimedia/media_library/media_asset_capi.h create mode 100644 multimedia/media_library/media_asset_change_request_capi.h diff --git a/multimedia/camera_framework/BUILD.gn b/multimedia/camera_framework/BUILD.gn index 5193d84e0..2773cb88b 100644 --- a/multimedia/camera_framework/BUILD.gn +++ b/multimedia/camera_framework/BUILD.gn @@ -23,6 +23,7 @@ ohos_ndk_headers("camera_ndk_header") { "./camera_manager.h", "./capture_session.h", "./metadata_output.h", + "./photo_native.h", "./photo_output.h", "./preview_output.h", "./video_output.h", @@ -44,5 +45,6 @@ ohos_ndk_library("libohcamera") { "ohcamera/photo_output.h", "ohcamera/preview_output.h", "ohcamera/video_output.h", + "ohcamera/photo_native.h", ] } diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index cfd6120d9..50cc20db4 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -91,6 +91,10 @@ "first_introduced": "12", "name": "OH_CameraManager_CreatePhotoOutputUsedInPreconfig" }, + { + "first_introduced": "12", + "name": "OH_CameraManager_CreatePhotoOutputWithoutSurface" + }, { "first_introduced": "11", "name": "OH_CameraManager_CreateVideoOutput" @@ -439,6 +443,22 @@ "first_introduced": "11", "name": "OH_PhotoOutput_Capture" }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_RegisterPhotoAvailableCallback" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_UnregisterPhotoAvailableCallback" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_RegisterPhotoAssetAvailableCallback" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_UnregisterPhotoAssetAvailableCallback" + }, { "first_introduced": "11", "name": "OH_PhotoOutput_Capture_WithCaptureSetting" @@ -459,6 +479,14 @@ "first_introduced": "12", "name": "OH_PhotoOutput_DeleteProfile" }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_IsMovingPhotoSupported" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_EnableMovingPhoto" + }, { "first_introduced": "11", "name": "OH_PreviewOutput_RegisterCallback" @@ -550,5 +578,13 @@ { "first_introduced": "12", "name": "OH_CameraDevice_GetCameraOrientation" + }, + { + "first_introduced": "12", + "name": "OH_PhotoNative_GetMainImage" + }, + { + "first_introduced": "12", + "name": "OH_PhotoNative_Release" } ] diff --git a/multimedia/camera_framework/camera_manager.h b/multimedia/camera_framework/camera_manager.h index ed72fcff9..42bcc1aaa 100644 --- a/multimedia/camera_framework/camera_manager.h +++ b/multimedia/camera_framework/camera_manager.h @@ -315,6 +315,20 @@ Camera_ErrorCode OH_CameraManager_CreatePhotoOutput(Camera_Manager* cameraManage Camera_ErrorCode OH_CameraManager_CreatePhotoOutputUsedInPreconfig(Camera_Manager* cameraManager, const char* surfaceId, Camera_PhotoOutput** photoOutput); +/** + * @brief Create a photo output instance without surfaceId. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param profile the {@link Camera_Profile} to create {@link Camera_PhotoOutput}. + * @param photoOutput the {@link Camera_PhotoOutput} will be created if the method call succeeds. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_CameraManager_CreatePhotoOutputWithoutSurface(Camera_Manager *cameraManager, + const Camera_Profile *profile, Camera_PhotoOutput **photoOutput); + /** * @brief Create a video output instance. * diff --git a/multimedia/camera_framework/photo_native.h b/multimedia/camera_framework/photo_native.h new file mode 100644 index 000000000..216883119 --- /dev/null +++ b/multimedia/camera_framework/photo_native.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup OH_Camera + * @{ + * + * @brief Provide the definition of the C interface for the camera module. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * + * @since 12 + * @version 1.0 + */ + +/** + * @file photo_native.h + * + * @brief Declare the camera photo concepts. + * + * @library libohcamera.so + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + * @version 1.0 + */ + +#ifndef NATIVE_INCLUDE_PHOTO_NATIVE_H +#define NATIVE_INCLUDE_PHOTO_NATIVE_H + +#include +#include +#include "camera.h" +#include "multimedia/image_framework/image/image_native.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Camera photo object + * + * A pointer can be created using {@link OH_PhotoNative} method. + * + * @since 12 + * @version 1.0 + */ +typedef struct OH_PhotoNative OH_PhotoNative; + +/** + * @brief Get main image. + * + * @param photo the {@link OH_PhotoNative} instance. + * @param main the {@link OH_ImageNative} which use to get main image. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + * @version 1.0 + */ +Camera_ErrorCode OH_PhotoNative_GetMainImage(OH_PhotoNative* photo, OH_ImageNative* mainImage); + +/** + * @brief Release camera photo. + * + * @param photo the {@link OH_PhotoNative} instance to released. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + * @version 1.0 + */ +Camera_ErrorCode OH_PhotoNative_Release(OH_PhotoNative* photo); + +#ifdef __cplusplus +} +#endif + +#endif // NATIVE_INCLUDE_PHOTO_NATIVE_H +/** @} */ \ No newline at end of file diff --git a/multimedia/camera_framework/photo_output.h b/multimedia/camera_framework/photo_output.h index 941cef603..2ec0654fe 100644 --- a/multimedia/camera_framework/photo_output.h +++ b/multimedia/camera_framework/photo_output.h @@ -43,6 +43,8 @@ #include #include #include "camera.h" +#include "photo_native.h" +#include "multimedia/media_library/media_asset_base_capi.h" #ifdef __cplusplus extern "C" { @@ -139,6 +141,24 @@ typedef void (*OH_PhotoOutput_CaptureReady) (Camera_PhotoOutput* photoOutput); */ typedef void (*OH_PhotoOutput_EstimatedCaptureDuration) (Camera_PhotoOutput* photoOutput, int64_t duration); +/** + * @brief Photo output available high-resolution images callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} which deliver the callback. + * @param photo the {@link OH_PhotoNative} which delivered by the callback. + * @since 12 + */ +typedef void (*OH_PhotoOutput_PhotoAvailable)(Camera_PhotoOutput* photoOutput, OH_PhotoNative* photo); + +/** + * @brief Photo output photo asset available callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} which deliver the callback. + * @param photoAsset the {@link OH_MediaAsset} which delivered by the callback. + * @since 12 + */ +typedef void (*OH_PhotoOutput_PhotoAssetAvailable)(Camera_PhotoOutput* photoOutput, OH_MediaAsset* photoAsset); + /** * @brief A listener for photo output. * @@ -310,6 +330,54 @@ Camera_ErrorCode OH_PhotoOutput_RegisterEstimatedCaptureDurationCallback(Camera_ Camera_ErrorCode OH_PhotoOutput_UnregisterEstimatedCaptureDurationCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_EstimatedCaptureDuration callback); +/** + * @brief Register photo output photo available callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance. + * @param callback the {@link OH_PhotoOutput_PhotoAvailable} to be registered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_RegisterPhotoAvailableCallback(Camera_PhotoOutput* photoOutput, + OH_PhotoOutput_PhotoAvailable callback); + +/** + * @brief Unregister photo output photo available callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance. + * @param callback the {@link PhotoOutput_Callbacks} to be unregistered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_UnregisterPhotoAvailableCallback(Camera_PhotoOutput* photoOutput, + OH_PhotoOutput_PhotoAvailable callback); + +/** + * @brief Register photo output photo asset available callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance. + * @param callback the {@link OH_PhotoOutput_PhotoAssetAvailable} to be registered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_RegisterPhotoAssetAvailableCallback(Camera_PhotoOutput* photoOutput, + OH_PhotoOutput_PhotoAssetAvailable callback); + +/** + * @brief Unregister photo output photo asset available callback. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance. + * @param callback the {@link OH_PhotoOutput_PhotoAssetAvailable} to be unregistered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_UnregisterPhotoAssetAvailableCallback(Camera_PhotoOutput* photoOutput, + OH_PhotoOutput_PhotoAssetAvailable callback); + /** * @brief Capture photo. * @@ -381,6 +449,30 @@ Camera_ErrorCode OH_PhotoOutput_GetActiveProfile(Camera_PhotoOutput* photoOutput */ Camera_ErrorCode OH_PhotoOutput_DeleteProfile(Camera_Profile* profile); +/** + * @brief Check whether to support moving photo. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance which used to check whether moving photo supported. + * @param isSupported the result of whether moving photo supported. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_IsMovingPhotoSupported(Camera_PhotoOutput* photoOutput, bool* isSupported); + +/** + * @brief Enable moving photo or not. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance which used to enable moving photo or not. + * @param enabled the flag of enable moving photo or not. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_EnableMovingPhoto(Camera_PhotoOutput* photoOutput, bool enabled); + #ifdef __cplusplus } #endif diff --git a/multimedia/media_library/media_access_helper_capi.h b/multimedia/media_library/media_access_helper_capi.h new file mode 100644 index 000000000..776bc9e2c --- /dev/null +++ b/multimedia/media_library/media_access_helper_capi.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup MediaAccessHelper + * @{ + * + * @brief Provides APIs of request capability for Media Source. + * + * @since 12 + */ + +/** + * @file media_access_helper_capi.h + * + * @brief Defines APIs related to media assess helper. + * + * Provides the ability to create photo albums, as well as access and modify media data information in the albums. + * + * @kit MediaLibraryKit + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @library libmedia_asset_manager.so + * @since 12 + */ + +#ifndef MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ACCESS_HELPER_H +#define MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ACCESS_HELPER_H + +#include "media_asset_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Apply the change request of asset or album. + * + * @permission ohos.permission.WRITE_IMAGEVIDEO + * @param changeRequest the {@link OH_MediaAssetChangeRequest} instance to be applied. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_PERMISSION_DENIED} Permission is denied. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 12 +*/ +MediaLibrary_ErrorCode OH_MediaAccessHelper_ApplyChanges(OH_MediaAssetChangeRequest* changeRequest); + +#ifdef __cplusplus +} +#endif + +#endif // MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ACCESS_HELPER_H +/** @} */ \ No newline at end of file diff --git a/multimedia/media_library/media_asset_base_capi.h b/multimedia/media_library/media_asset_base_capi.h index 164893324..a0caef2b3 100644 --- a/multimedia/media_library/media_asset_base_capi.h +++ b/multimedia/media_library/media_asset_base_capi.h @@ -38,7 +38,7 @@ * MediaLibrary_RequestOptions structure: This structure provides options for requesting media library resources. \n * * @kit MediaLibraryKit - * @Syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @library libmedia_asset_manager.so * @since 12 */ @@ -48,6 +48,8 @@ #include +#include "multimedia/image_framework/image/image_source_native.h" + #ifdef __cplusplus extern "C" { #endif @@ -71,6 +73,24 @@ static const int32_t UUID_STR_MAX_LENGTH = 37; */ typedef struct OH_MediaAssetManager OH_MediaAssetManager; +/** + * @brief Define Media Asset Change Request + * + * This structure provides the ability to handle a media asset change request. + * + * @since 12 + */ +typedef struct OH_MediaAssetChangeRequest OH_MediaAssetChangeRequest; + +/** + * @brief Define Media Asset + * + * This structure provides the ability to encapsulate file asset attributes. + * + * @since 12 + */ +typedef struct OH_MediaAsset OH_MediaAsset; + /** * @brief Define MediaLibrary_RequestId * @@ -85,6 +105,64 @@ typedef struct MediaLibrary_RequestId { char requestId[UUID_STR_MAX_LENGTH]; } MediaLibrary_RequestId; +/** + * @brief Enum for media library error code. + * + * @since 12 + */ +typedef enum MediaLibrary_ErrorCode { + /** + * @error Media library result is ok. + */ + MEDIA_LIBRARY_OK = 0, + + /** + * @error Permission is denied. + */ + MEDIA_LIBRARY_PERMISSION_DENIED = 201, + + /** + * @error Mandatory parameters are left unspecified + * or incorrect parameter types or parameter verification failed. + */ + MEDIA_LIBRARY_PARAMETER_ERROR = 401, + + /** + * @error File does not exist. + */ + MEDIA_LIBRARY_NO_SUCH_FILE = 23800101, + + /** + * @error Invalid display name. + */ + MEDIA_LIBRARY_INVALID_DISPLAY_NAME = 23800102, + + /** + * @error Invalid asset uri. + */ + MEDIA_LIBRARY_INVALID_ASSET_URI = 23800103, + + /** + * @error Member is not a valid PhotoKey. + */ + MEDIA_LIBRARY_INVALID_PHOTO_KEY = 23800104, + + /** + * @error Operation is not supported. + */ + MEDIA_LIBRARY_OPERATION_NOT_SUPPORTED = 23800201, + + /** + * @error Internal system error. + * It is recommended to retry and check the logs. + * Possible causes: + * 1. Database corrupted. + * 2. The file system is abnormal. + * 3. The IPC request timed out. + */ + MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR = 23800301, +} MediaLibrary_ErrorCode; + /** * @brief Delivery Mode * @@ -102,6 +180,90 @@ typedef enum MediaLibrary_DeliveryMode { MEDIA_LIBRARY_BALANCED_MODE = 2 } MediaLibrary_DeliveryMode; +/** + * @brief Request Options + * + * This structure provides options for requesting media library resources. + * + * @since 12 + */ +typedef struct MediaLibrary_RequestOptions { + /*delivery mode*/ + MediaLibrary_DeliveryMode deliveryMode; +} MediaLibrary_RequestOptions; + +/** + * @brief Enum for media type. + * + * @since 12 + */ +typedef enum MediaLibrary_MediaType { + /*image asset*/ + MEDIA_LIBRARY_IMAGE = 1, + /*video asset*/ + MEDIA_LIBRARY_VIDEO = 2 +} MediaLibrary_MediaType; + +/** + * @brief Enum for media asset subtype. + * + * @since 12 + */ +typedef enum MediaLibrary_MediaSubType { + /*default Photo Type*/ + MEDIA_LIBRARY_DEFAULT = 0, + /*moving Photo Type*/ + MEDIA_LIBRARY_MOVING_PHOTO = 3, + /*burst Photo Type*/ + MEDIA_LIBRARY_BURST = 4 +} MediaLibrary_MediaSubType; + +/** + * @brief Enum for resource types. + * + * @since 12 + */ +typedef enum MediaLibrary_ResourceType { + /*image resource*/ + MEDIA_LIBRARY_IMAGE_RESOURCE = 1, + /*video resource*/ + MEDIA_LIBRARY_VIDEO_RESOURCE = 2 +} MediaLibrary_ResourceType; + +/** + * @brief Enum for image file Type. + * + * @since 12 + */ +typedef enum MediaLibrary_ImageFileType { + /*JPEG type*/ + MEDIA_LIBRARY_IMAGE_JPEG = 1 +} MediaLibrary_ImageFileType; + +/** + * @brief Enum for media quality. + * + * @since 12 + */ +typedef enum MediaLibrary_MediaQuality { + /*fast quality*/ + MEDIA_LIBRARY_QUALITY_FAST = 1, + /*full quality*/ + MEDIA_LIBRARY_QUALITY_FULL = 2 +} MediaLibrary_MediaQuality; + +/** + * @brief Enum for media content type. + * + * @since 12 + */ +typedef enum MediaLibrary_MediaContentType { + /*compressed media content type*/ + MEDIA_LIBRARY_COMPRESSED = 1, + /*picture object media content type*/ + MEDIA_LIBRARY_PICTURE_OBJECT = 2 +} MediaLibrary_MediaContentType; + /** * @brief Called when a requested source is prepared. * @@ -114,18 +276,24 @@ typedef enum MediaLibrary_DeliveryMode { typedef void (*OH_MediaLibrary_OnDataPrepared)(int32_t result, MediaLibrary_RequestId requestId); /** - * @brief Request Options + * @brief Called when a requested image source is prepared. * - * This structure provides options for requesting media library resources. + * This function is called when the requested image source is prepared. * + * @param result results {@link MediaLibrary_ErrorCode} of the processing of the requested resources. + * @param requestId indicates the {@link MediaLibrary_RequestId} of the request. + * @param mediaQuality the {@link MediaLibrary_MediaQuality} of the requested source. + * @param type the {@link MediaLibrary_MediaContentType} of the requested source. + * @param imageSourceNative it used to obtain {@link OH_ImageSourceNative} information when image source is prepared. * @since 12 */ -typedef struct MediaLibrary_RequestOptions { - /*delivery mode*/ - MediaLibrary_DeliveryMode deliveryMode; -} MediaLibrary_RequestOptions; +typedef void (*OH_MediaLibrary_OnImageDataPrepared)(MediaLibrary_ErrorCode result, + MediaLibrary_RequestId requestId, MediaLibrary_MediaQuality mediaQuality, MediaLibrary_MediaContentType type, + OH_ImageSourceNative* imageSourceNative); #ifdef __cplusplus } #endif -#endif // MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ASSET_BASE_H \ No newline at end of file + +#endif // MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ASSET_BASE_H +/** @} */ \ No newline at end of file diff --git a/multimedia/media_library/media_asset_capi.h b/multimedia/media_library/media_asset_capi.h new file mode 100644 index 000000000..772e4be5d --- /dev/null +++ b/multimedia/media_library/media_asset_capi.h @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup MediaAsset + * @{ + * + * @brief Provides APIs of request capability for Media Source. + * + * @since 12 + */ + +/** + * @file media_asset_capi.h + * + * @brief Defines APIs related to media asset. + * + * Provides the ability to obtain image or video information. + * + * @kit MediaLibraryKit + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @library libmedia_asset_manager.so + * @since 12 + */ + +#ifndef MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ASSET_H +#define MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ASSET_H + +#include "media_asset_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Get the uri of the media asset. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param uri the uri of the media asset. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 12 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetUri(OH_MediaAsset* mediaAsset, const char** uri); + +/** + * @brief Get the display name of the media asset. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param displayName the display name of the media asset. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 12 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetDisplayName(OH_MediaAsset* mediaAsset, const char** displayName); + +/** + * @brief Get the file size of the media asset + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param size the file size(in bytes) of the media asset. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 12 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetSize(OH_MediaAsset* mediaAsset, uint32_t* size); + +/** + * @brief Get the modified time of the asset in milliseconds. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param dateModifiedMs the modified time of the asset in milliseconds. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 12 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetDateModifiedMs(OH_MediaAsset* mediaAsset, uint32_t* dateModifiedMs); + +/** + * @brief Get the image width(in pixels) of the media asset. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param width the image width(in pixels) of the media asset. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 12 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetWidth(OH_MediaAsset* mediaAsset, uint32_t* width); + +/** + * @brief Get the image height(in pixels) of the media asset. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param height the image height(in pixels) of the media asset. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 12 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetHeight(OH_MediaAsset* mediaAsset, uint32_t* height); + +/** + * @brief Get the orientation of the image. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param orientation the orientation of the image. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 12 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetOrientation(OH_MediaAsset* mediaAsset, uint32_t* orientation); + +/** + * @brief Release the media asset + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * @since 12 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_Release(OH_MediaAsset* mediaAsset); + +#ifdef __cplusplus +} +#endif + +#endif // MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ASSET_H +/** @} */ \ No newline at end of file diff --git a/multimedia/media_library/media_asset_change_request_capi.h b/multimedia/media_library/media_asset_change_request_capi.h new file mode 100644 index 000000000..d4bb6a772 --- /dev/null +++ b/multimedia/media_library/media_asset_change_request_capi.h @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup MediaAssetChangeRequest + * @{ + * + * @brief Provides APIs of request capability for Media Source. + * + * @since 12 + */ + +/** + * @file media_asset_change_request_capi.h + * + * @brief Defines APIs related to media asset change request. + * + * Provides the ability to change assets. + * + * @kit MediaLibraryKit + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @library libmedia_asset_manager.so + * @since 12 + */ + +#ifndef MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ASSET_CHANGE_REQUEST_H +#define MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ASSET_CHANGE_REQUEST_H + +#include "media_asset_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Create a {@link OH_MediaAssetChangeRequest} instance. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 12 +*/ +OH_MediaAssetChangeRequest* OH_MediaAssetChangeRequest_Create(OH_MediaAsset* mediaAsset); + +/** + * @brief Add resource of the asset using ArrayBuffer. + * + * @param changeRequest the {@link OH_MediaAssetChangeRequest} instance. + * @param resourceType the {@link MediaLibrary_ResourceType} of the resource to add. + * @param buffer the data buffer to add. + * @param length the length of the data buffer. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * {@link #MEDIA_LIBRARY_OPERATION_NOT_SUPPORTED} if operation is not supported. + * @since 12 +*/ +MediaLibrary_ErrorCode OH_MediaAssetChangeRequest_AddResourceWithBuffer(OH_MediaAssetChangeRequest* changeRequest, + MediaLibrary_ResourceType resourceType, uint8_t* buffer, uint32_t length); + +/** + * @brief Save the photo asset captured by camera. + * + * @param changeRequest the {@link OH_MediaAssetChangeRequest} instance. + * @param imageFileType The {@link MediaLibrary_ImageFileType} of photo to be saved. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * {@link #MEDIA_LIBRARY_OPERATION_NOT_SUPPORTED} if operation is not supported. + * @since 12 +*/ +MediaLibrary_ErrorCode OH_MediaAssetChangeRequest_SaveCameraPhoto(OH_MediaAssetChangeRequest* changeRequest, + MediaLibrary_ImageFileType imageFileType); + +/** + * @brief Discard the photo asset captured by camera. + * + * @param changeRequest the {@link OH_MediaAssetChangeRequest} instance. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * {@link #MEDIA_LIBRARY_OPERATION_NOT_SUPPORTED} if operation is not supported. + * @since 12 +*/ +MediaLibrary_ErrorCode OH_MediaAssetChangeRequest_DiscardCameraPhoto(OH_MediaAssetChangeRequest* changeRequest); + +/** + * @brief Release the {@link OH_MediaAssetChangeRequest} instance. + * + * @param changeRequest the {@link OH_MediaAssetChangeRequest} instance. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * @since 12 +*/ +MediaLibrary_ErrorCode OH_MediaAssetChangeRequest_Release(OH_MediaAssetChangeRequest* changeRequest); + +#ifdef __cplusplus +} +#endif + +#endif // MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ASSET_CHANGE_REQUEST_H +/** @} */ diff --git a/multimedia/media_library/media_asset_manager/BUILD.gn b/multimedia/media_library/media_asset_manager/BUILD.gn index 57c7fb44c..a56329237 100644 --- a/multimedia/media_library/media_asset_manager/BUILD.gn +++ b/multimedia/media_library/media_asset_manager/BUILD.gn @@ -18,7 +18,10 @@ import("//foundation/multimedia/media_library/media_library.gni") ohos_ndk_headers("media_asset_manager_header") { dest_dir = "$ndk_headers_out_dir/multimedia/media_library" sources = [ + "../media_access_helper_capi.h", "../media_asset_base_capi.h", + "../media_asset_capi.h", + "../media_asset_change_request_capi.h", "../media_asset_manager_capi.h", ] } @@ -31,5 +34,8 @@ ohos_ndk_library("libmedia_asset_manager") { system_capability_headers = [ "multimedia/media_library/media_asset_manager_capi.h", "multimedia/media_library/media_asset_base_capi.h", + "multimedia/media_library/media_access_helper_capi.h", + "multimedia/media_library/media_asset_capi.h", + "multimedia/media_library/media_asset_change_request_capi.h", ] } diff --git a/multimedia/media_library/media_asset_manager/lib_media_asset_namager_capi.ndk.json b/multimedia/media_library/media_asset_manager/lib_media_asset_namager_capi.ndk.json index 7e910b968..6cc799cb7 100644 --- a/multimedia/media_library/media_asset_manager/lib_media_asset_namager_capi.ndk.json +++ b/multimedia/media_library/media_asset_manager/lib_media_asset_namager_capi.ndk.json @@ -14,5 +14,65 @@ { "first_introduced": "12", "name": "OH_MediaAssetManager_CancelRequest" + }, + { + "first_introduced": "12", + "name": "OH_MediaAssetManager_RequestImage" + }, + { + "first_introduced": "12", + "name": "OH_MediaAccessHelper_ApplyChanges" + }, + { + "first_introduced": "12", + "name": "OH_MediaAsset_GetUri" + }, + { + "first_introduced": "12", + "name": "OH_MediaAsset_GetDisplayName" + }, + { + "first_introduced": "12", + "name": "OH_MediaAsset_GetSize" + }, + { + "first_introduced": "12", + "name": "OH_MediaAsset_GetDateModifiedMs" + }, + { + "first_introduced": "12", + "name": "OH_MediaAsset_GetWidth" + }, + { + "first_introduced": "12", + "name": "OH_MediaAsset_GetHeight" + }, + { + "first_introduced": "12", + "name": "OH_MediaAsset_GetOrientation" + }, + { + "first_introduced": "12", + "name": "OH_MediaAsset_Release" + }, + { + "first_introduced": "12", + "name": "OH_MediaAssetChangeRequest_Create" + }, + { + "first_introduced": "12", + "name": "OH_MediaAssetChangeRequest_AddResourceWithBuffer" + }, + { + "first_introduced": "12", + "name": "OH_MediaAssetChangeRequest_SaveCameraPhoto" + }, + { + "first_introduced": "12", + "name": "OH_MediaAssetChangeRequest_DiscardCameraPhoto" + }, + { + "first_introduced": "12", + "name": "OH_MediaAssetChangeRequest_Release" } ] \ No newline at end of file diff --git a/multimedia/media_library/media_asset_manager_capi.h b/multimedia/media_library/media_asset_manager_capi.h index 4b465e05e..73612f5c8 100644 --- a/multimedia/media_library/media_asset_manager_capi.h +++ b/multimedia/media_library/media_asset_manager_capi.h @@ -31,7 +31,7 @@ * to reqeust media source. * * @kit MediaLibraryKit - * @Syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @library libmedia_asset_manager.so * @since 12 */ @@ -94,7 +94,33 @@ MediaLibrary_RequestId OH_MediaAssetManager_RequestVideoForPath(OH_MediaAssetMan */ bool OH_MediaAssetManager_CancelRequest(OH_MediaAssetManager* manager, const MediaLibrary_RequestId requestId); +/** + * @brief Request image resources based on different strategy modes. + * + * @permission ohos.permission.READ_IMAGEVIDEO + * @param manager the pointer to {@link OH_MediaAssetManager} instance. + * @param mediaAsset the {@link OH_MediaAsset} instance of media file object to be requested. + * @param requestOptions the {@link MediaLibrary_RequestOptions} for image request strategy mode. + * @param requestId indicates the {@link MediaLibrary_RequestId} of the request, which is an output parameter. + * @param callback the {@link OH_MediaLibrary_OnImageDataPrepared} that will be called + * when the requested source is prepared. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_OPERATION_NOT_SUPPORTED} if operation is not supported. + * {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 12 +*/ +MediaLibrary_ErrorCode OH_MediaAssetManager_RequestImage(OH_MediaAssetManager* manager, OH_MediaAsset* mediaAsset, + MediaLibrary_RequestOptions requestOptions, MediaLibrary_RequestId* requestId, + OH_MediaLibrary_OnImageDataPrepared callback); + #ifdef __cplusplus } #endif -#endif // MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ASSET_MANAGER_H \ No newline at end of file + +#endif // MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ASSET_MANAGER_H +/** @} */ \ No newline at end of file -- Gitee From 836beb3b2d73b986210c2555bf3a48b0fd159589 Mon Sep 17 00:00:00 2001 From: liyang Date: Mon, 19 Aug 2024 09:45:29 +0800 Subject: [PATCH 095/620] =?UTF-8?q?=E5=BD=95=E5=B1=8FNDK=E8=AF=AD=E6=B3=95?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liyang --- multimedia/player_framework/native_avscreen_capture.h | 1 + multimedia/player_framework/native_avscreen_capture_base.h | 1 + 2 files changed, 2 insertions(+) diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index e993b8ef2..77fcb27e3 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -35,6 +35,7 @@ #ifndef NATIVE_AVSCREEN_CAPTURE_H #define NATIVE_AVSCREEN_CAPTURE_H +#include #include #include #include "native_avscreen_capture_errors.h" diff --git a/multimedia/player_framework/native_avscreen_capture_base.h b/multimedia/player_framework/native_avscreen_capture_base.h index 0d5b35387..deed04f4c 100644 --- a/multimedia/player_framework/native_avscreen_capture_base.h +++ b/multimedia/player_framework/native_avscreen_capture_base.h @@ -35,6 +35,7 @@ #ifndef NATIVE_AVSCREEN_CAPTURE_BASE_H #define NATIVE_AVSCREEN_CAPTURE_BASE_H +#include #include #include "native_avbuffer.h" -- Gitee From 99e015314fc9d043df17bd932163c40076086361 Mon Sep 17 00:00:00 2001 From: duanhan Date: Mon, 19 Aug 2024 11:29:13 +0800 Subject: [PATCH 096/620] add ndk pixel format Signed-off-by: duanhan --- .../image_framework/include/image/pixelmap_native.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 875bafe5b..128d8a89d 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -112,6 +112,18 @@ typedef enum { * NV12 format */ PIXEL_FORMAT_NV12 = 9, + /* + * RGBA_1010102 format + */ + PIXEL_FORMAT_RGBA_1010102 = 10, + /* + * YCBCR_P010 format + */ + PIXEL_FORMAT_YCBCR_P010 = 11, + /* + * YCRCB_P010 format + */ + PIXEL_FORMAT_YCRCB_P010 = 12, } PIXEL_FORMAT; /** -- Gitee From c4336d34080511de5608037f6ee1172f5d2bfbfe Mon Sep 17 00:00:00 2001 From: zhouyan Date: Mon, 19 Aug 2024 16:33:02 +0800 Subject: [PATCH 097/620] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E6=8E=A7=E5=88=B6ndk=E6=8E=A5=E5=8F=A3=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhouyan Change-Id: Iec95adca938b87e9128b2771e1edab7c48553629 --- security/access_token/BUILD.gn | 29 +++++++++ .../access_token/ability_access_control.h | 61 +++++++++++++++++++ security/access_token/libaccesstoken.ndk.json | 5 ++ 3 files changed, 95 insertions(+) create mode 100644 security/access_token/BUILD.gn create mode 100644 security/access_token/ability_access_control.h create mode 100644 security/access_token/libaccesstoken.ndk.json diff --git a/security/access_token/BUILD.gn b/security/access_token/BUILD.gn new file mode 100644 index 000000000..4b211ad2b --- /dev/null +++ b/security/access_token/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") + +ohos_ndk_headers("accesstoken_header") { + dest_dir = "$ndk_headers_out_dir/accesstoken" + sources = [ "ability_access_control.h" ] +} + +ohos_ndk_library("libability_access_control") { + ndk_description_file = "./libaccesstoken.ndk.json" + min_compact_version = "12" + output_name = "ability_access_control" + output_extension = "so" + + system_capability = "SystemCapability.Security.AccessToken" + system_capability_headers = [ "accesstoken/ability_access_control.h" ] +} diff --git a/security/access_token/ability_access_control.h b/security/access_token/ability_access_control.h new file mode 100644 index 000000000..121e5b983 --- /dev/null +++ b/security/access_token/ability_access_control.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup AbilityAccessControl + * @{ + * + * @brief Provides the capability to manage access token. + * + * @since 12 + */ + +/** + * @file ability_access_control.h + * + * @brief Declares the APIs for managing access token. + * + * @library ability_access_control.so + * @kit AbilityKit + * @syscap SystemCapability.Security.AccessToken + * @since 12 + */ + +#ifndef ABILITY_ACCESS_CONTROL_H +#define ABILITY_ACCESS_CONTROL_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Checks whether this application has been granted the given permission. + * + * @param permission - Name of the permission to be granted. + * @return true - The permission has been granted to this application. + * false - The permission has not been granted to this application. + * @since 12 + */ +bool OH_AT_CheckSelfPermission(const char *permission); + +#ifdef __cplusplus +} +#endif + +/** @} */ +#endif /* ABILITY_ACCESS_CONTROL_H */ diff --git a/security/access_token/libaccesstoken.ndk.json b/security/access_token/libaccesstoken.ndk.json new file mode 100644 index 000000000..3f1d12c5e --- /dev/null +++ b/security/access_token/libaccesstoken.ndk.json @@ -0,0 +1,5 @@ +[ + { + "name": "OH_AT_CheckSelfPermission" + } +] \ No newline at end of file -- Gitee From 4c1c217fadf56d6f57f4b7460359df72bab90596 Mon Sep 17 00:00:00 2001 From: y00656910 Date: Wed, 14 Aug 2024 20:53:18 +0800 Subject: [PATCH 098/620] 0814bugFix Signed-off-by: y00656910 Change-Id: I6a637a7df8242a184cf40d9c05fdc6eae3311e0b Signed-off-by: y00656910 --- .../image_framework/include/image/image_common.h | 14 ++++++++++++++ .../include/image/pixelmap_native.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index f44cf9b9a..b84bb8345 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -83,6 +83,7 @@ struct Image_Region { */ typedef struct Image_Region Image_Region; +#ifdef __cplusplus /** * @brief Defines the region of the image source to decode. * @@ -94,6 +95,19 @@ struct Image_String { /** data lenth for string type */ size_t size = 0; }; +#else +/** + * @brief Defines the region of the image source to decode. + * + * @since 12 + */ +struct Image_String { + /** data for string type */ + char *data; + /** data lenth for string type */ + size_t size; +}; +#endif /** * @brief Define a PictureMetadata struct type, used for picture metadata. diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 875bafe5b..fa5443d5b 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -36,6 +36,9 @@ #ifndef INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PIXELMAP_NATIVE_H_ #define INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PIXELMAP_NATIVE_H_ + +#include + #include "image_common.h" #include "napi/native_api.h" -- Gitee From 476764a78b02309e0ec27316878fa7c5608062a9 Mon Sep 17 00:00:00 2001 From: PengKejie Date: Mon, 19 Aug 2024 19:34:19 +0800 Subject: [PATCH 099/620] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3OH?= =?UTF-8?q?=5FDrawing=5FTypographyGetLongestLineWithIndent=EF=BC=8C=20?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=B8=A6=E6=9C=89=E7=BC=A9=E8=BF=9B=E7=9A=84?= =?UTF-8?q?=E6=9C=80=E9=95=BF=E8=A1=8C=E5=AE=BD=E5=BA=A6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: PengKejie --- .../native_drawing/drawing_text_typography.h | 14 ++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index d821c3855..521534ee1 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1031,6 +1031,20 @@ double OH_Drawing_TypographyGetHeight(OH_Drawing_Typography*); */ double OH_Drawing_TypographyGetLongestLine(OH_Drawing_Typography*); + /** + * @brief Obtains the width of the longest line with indent. You are advised to round up the return value in actual use. + * When the text content is empty, the minimum float value, + * that is, -340282346638528859811704183484516925440.000000, is returned. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography Pointer to an OH_Drawing_Typography object, which is obtained by + * {@link OH_Drawing_CreateTypography}. + * @return Returns the width of the longest line with indent. + * @since 12 + * @version 1.1 + */ + double OH_Drawing_TypographyGetLongestLineWithIndent(OH_Drawing_Typography*); + /** * @brief Gets the min intrinsic width. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index f0d6835c1..492754ecc 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -699,6 +699,10 @@ { "name": "OH_Drawing_TypographyGetMaxWidth" }, { "name": "OH_Drawing_TypographyGetHeight" }, { "name": "OH_Drawing_TypographyGetLongestLine" }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographyGetLongestLineWithIndent" + }, { "name": "OH_Drawing_TypographyGetMinIntrinsicWidth" }, { "name": "OH_Drawing_TypographyGetMaxIntrinsicWidth" }, { "name": "OH_Drawing_TypographyGetAlphabeticBaseline" }, -- Gitee From 0063bb98f2fd653f776eddc79a9552dbd503cfea Mon Sep 17 00:00:00 2001 From: m00472246 Date: Mon, 19 Aug 2024 12:02:43 +0800 Subject: [PATCH 100/620] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AAOH?= =?UTF-8?q?=5FNativeImage=5FCreate=E4=BD=9C=E4=B8=BA=E7=BA=AF=E6=B6=88?= =?UTF-8?q?=E8=B4=B9=E7=AB=AF=20Signed-off-by:=20m00472246=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m00472246 --- .../native_image/libnative_image.ndk.json | 4 ++++ graphic/graphic_2d/native_image/native_image.h | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/graphic/graphic_2d/native_image/libnative_image.ndk.json b/graphic/graphic_2d/native_image/libnative_image.ndk.json index c591bf0fd..4d9f20d89 100644 --- a/graphic/graphic_2d/native_image/libnative_image.ndk.json +++ b/graphic/graphic_2d/native_image/libnative_image.ndk.json @@ -18,5 +18,9 @@ { "first_introduced": "12", "name": "OH_NativeImage_ReleaseNativeWindowBuffer" + }, + { + "first_introduced": "12", + "name": "OH_ConsumerSurface_Create" } ] \ No newline at end of file diff --git a/graphic/graphic_2d/native_image/native_image.h b/graphic/graphic_2d/native_image/native_image.h index a1bbf5122..56e10963d 100644 --- a/graphic/graphic_2d/native_image/native_image.h +++ b/graphic/graphic_2d/native_image/native_image.h @@ -266,6 +266,19 @@ int32_t OH_NativeImage_AcquireNativeWindowBuffer(OH_NativeImage* image, int32_t OH_NativeImage_ReleaseNativeWindowBuffer(OH_NativeImage* image, OHNativeWindowBuffer* nativeWindowBuffer, int fenceFd); +/** + * @brief Create a OH_NativeImage as a consumerSurface. \n + * This method can not be used at the same time with OH_NativeImage_UpdateSurfaceImage.\n + * This interface needs to be used in conjunction with OH_NativeImage_Destroy<\b>, + * otherwise memory leaks will occur.\n + * @syscap SystemCapability.Graphic.Graphic2D.NativeImage + * @return Returns the pointer to the OH_NativeImage instance created if the operation is successful, \n + * returns NULL otherwise. + * @since 12 + * @version 1.0 + */ +OH_NativeImage* OH_ConsumerSurface_Create(); + #ifdef __cplusplus } #endif -- Gitee From ac8bc7b2a077cebb3dde6477407dd6a83604f391 Mon Sep 17 00:00:00 2001 From: gaojianhao1 Date: Fri, 16 Aug 2024 20:12:18 +0800 Subject: [PATCH 101/620] sAdd CookieManager ndk interface. Signed-off-by: gaojianhao1 --- .../interfaces/native/arkweb_error_code.h | 6 ++ .../interfaces/native/arkweb_interface.h | 2 + web/webview/interfaces/native/arkweb_type.h | 66 +++++++++++++++++++ 3 files changed, 74 insertions(+) diff --git a/web/webview/interfaces/native/arkweb_error_code.h b/web/webview/interfaces/native/arkweb_error_code.h index 0ebf021f9..a445de2c7 100644 --- a/web/webview/interfaces/native/arkweb_error_code.h +++ b/web/webview/interfaces/native/arkweb_error_code.h @@ -47,6 +47,12 @@ ARKWEB_INVALID_PARAM = 17100101, /** @error Register custom schemes should be called before create any ArkWeb. */ ARKWEB_SCHEME_REGISTER_FAILED = 17100102, + +/** @error Invalid url. */ +ARKWEB_INVALID_URL = 17100103, + +/** @error Invalid cookie value. */ +ARKWEB_INVALID_COOKIE_VALUE = 17100104, } ArkWeb_ErrorCode; #endif // ARKWEB_ERROR_CODE_H diff --git a/web/webview/interfaces/native/arkweb_interface.h b/web/webview/interfaces/native/arkweb_interface.h index 7b60c5bcb..b610729ed 100644 --- a/web/webview/interfaces/native/arkweb_interface.h +++ b/web/webview/interfaces/native/arkweb_interface.h @@ -63,6 +63,8 @@ typedef enum { ARKWEB_NATIVE_WEB_MESSAGE_PORT, /** API type related to ArkWeb WebMessage. */ ARKWEB_NATIVE_WEB_MESSAGE, + /** API type related to ArkWeb cookie manager. */ + ARKWEB_NATIVE_COOKIE_MANAGER, } ArkWeb_NativeAPIVariantKind; /* diff --git a/web/webview/interfaces/native/arkweb_type.h b/web/webview/interfaces/native/arkweb_type.h index 2a1d56d64..d626371eb 100644 --- a/web/webview/interfaces/native/arkweb_type.h +++ b/web/webview/interfaces/native/arkweb_type.h @@ -333,6 +333,72 @@ typedef struct { void* (*getData)(ArkWeb_WebMessagePtr webMessage, size_t* dataLength); } ArkWeb_WebMessageAPI; +/** + * @brief Defines the native CookieManager API for ArkWeb. + * Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check + * whether the function structure has a corresponding function pointer to avoid crash + * caused by mismatch between the SDK and the device ROM. + * + * @since 12 + */ +typedef struct { + /** The ArkWeb_CookieManagerAPI struct size. */ + size_t size; + + /** + * @brief Obtains the cookie value corresponding to a specified URL. + * + * @param url URL to which the cookie to be obtained belongs. A complete URL is recommended. + * @param incognito True indicates that the memory cookies of the webview in privacy mode are obtained, + * and false indicates that cookies in non-privacy mode are obtained. + * @param includeHttpOnly If true HTTP-only cookies will also be included in the cookieValue. + * @param cookieValue Get the cookie value corresponding to the URL. + * @return Fetch cookie result code. + * {@link ARKWEB_SUCCESS} fetch cookie success. + * {@link ARKWEB_INVALID_URL} invalid url. + * {@link ARKWEB_INVALID_PARAM} cookieValue is nullptr. + */ + ArkWeb_ErrorCode (*fetchCookieSync)(const char* url, bool incognito, bool includeHttpOnly, char** cookieValue); + + /** + * @brief Sets the cookie value for a specified URL. + * + * @param url Specifies the URL to which the cookie belongs. A complete URL is recommended. + * @param cookieValue The value of the cookie to be set. + * @param incognito True indicates that cookies of the corresponding URL are set in privacy mode, + * and false indicates that cookies of the corresponding URL are set in non-privacy mode. + * @param includeHttpOnly If true, HTTP-only cookies can also be overwritten. + * @return Config cookie result code. + * {@link ARKWEB_SUCCESS} config cookie success. + * {@link ARKWEB_INVALID_URL} invalid url. + * {@link ARKWEB_INVALID_COOKIE_VALUE} invalid cookie value. + */ + ArkWeb_ErrorCode (*configCookieSync)(const char* url, + const char* cookieValue, bool incognito, bool includeHttpOnly); + + /** + * @brief Check whether cookies exist. + * + * @param incognito True indicates whether cookies exist in privacy mode, + * and false indicates whether cookies exist in non-privacy mode. + * @return True indicates that the cookie exists, and false indicates that the cookie does not exist. + */ + bool (*existCookies)(bool incognito); + + /** + * @brief Clear all cookies. + * + * @param incognito True indicates that all memory cookies of the webview are cleared in privacy mode, + * and false indicates that persistent cookies in non-privacy mode are cleared. + */ + void (*clearAllCookiesSync)(bool incognito); + + /** + * @brief Clear all session cookies. + */ + void (*clearSessionCookiesSync)(); +} ArkWeb_CookieManagerAPI; + /** * @brief Check whether the member variables of the current struct exist. * -- Gitee From 3c553440277361e356b1cd21ae258aec2dbb4e3c Mon Sep 17 00:00:00 2001 From: zhangqiang Date: Tue, 20 Aug 2024 10:53:17 +0800 Subject: [PATCH 102/620] =?UTF-8?q?20240820=20=20ScreenCapture=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=9A=84=E6=B3=A8=E9=87=8A=E9=94=99=E8=AF=AF=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangqiang --- multimedia/player_framework/native_avscreen_capture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index 77fcb27e3..c260023c6 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -392,7 +392,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ContentFilter_AddWindowContent( * @param height Video frame height of avscreeencapture * @return Function result code. * {@link AV_SCREEN_CAPTURE_ERR_OK} if the execution is successful. - * {@link AV_SCREEN_CAPTURE_ERR_INVALID_VAL} input capture is nullptr or input filter is nullptr. + * {@link AV_SCREEN_CAPTURE_ERR_INVALID_VAL} input capture is nullptr. * {@link AV_SCREEN_CAPTURE_ERR_OPERATE_NOT_PERMIT} opertation not be permitted. * @since 12 * @version 1.0 -- Gitee From 6e8dc463b8d93350e9a37aa1e22c5bec0c763c05 Mon Sep 17 00:00:00 2001 From: renxinyao Date: Tue, 20 Aug 2024 11:50:34 +0800 Subject: [PATCH 103/620] =?UTF-8?q?=E6=9E=B6=E6=9E=84=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: renxinyao --- multimodalinput/kits/c/input/oh_input_manager.h | 1 - 1 file changed, 1 deletion(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index f55c4f32a..4c3a94b31 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -263,7 +263,6 @@ typedef void (*Input_AxisEventCallback)(const Input_AxisEvent* axisEvent); /** * @brief Defines the structure for the interceptor of event callbacks, * including mouseCallback, touchCallback, and axisCallback. - * * @since 12 */ typedef struct Input_InterceptorEventCallback { -- Gitee From 6385b1dba428cf6e74ff7dd15bcd1a5d4134c66a Mon Sep 17 00:00:00 2001 From: li_junsong Date: Mon, 19 Aug 2024 20:27:35 +0800 Subject: [PATCH 104/620] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=97=B6=E5=8C=BA=E8=8E=B7=E5=8F=96=E6=97=B6=E5=8C=BA=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li_junsong --- BasicServicesKit/BUILD.gn | 14 ++++ BasicServicesKit/libtime_service.ndk.json | 5 ++ BasicServicesKit/time_service.h | 79 +++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 BasicServicesKit/libtime_service.ndk.json create mode 100644 BasicServicesKit/time_service.h diff --git a/BasicServicesKit/BUILD.gn b/BasicServicesKit/BUILD.gn index f28da4fa8..d7cb6f57f 100644 --- a/BasicServicesKit/BUILD.gn +++ b/BasicServicesKit/BUILD.gn @@ -57,3 +57,17 @@ ohos_ndk_library("libohscan_ndk") { system_capability = "SystemCapability.Print.PrintFramework" system_capability_headers = [ "BasicServicesKit/ohscan.h" ] } + +ohos_ndk_headers("time_service_ndk_header") { + dest_dir = "$ndk_headers_out_dir/BasicServicesKit/" + sources = [ "./time_service.h" ] +} + +ohos_ndk_library("libtime_service_ndk") { + output_name = "time_service_ndk" + output_extension = "so" + ndk_description_file = "./libtime_service.ndk.json" + min_compact_version = "12" + system_capability = "SystemCapability.MiscServices.Time" + system_capability_headers = [ "BasicServicesKit/time_service.h" ] +} diff --git a/BasicServicesKit/libtime_service.ndk.json b/BasicServicesKit/libtime_service.ndk.json new file mode 100644 index 000000000..2e80130d8 --- /dev/null +++ b/BasicServicesKit/libtime_service.ndk.json @@ -0,0 +1,5 @@ +[ + { "first_introduced": "12", + "name":"OH_TimeService_GetTimeZone" + } +] \ No newline at end of file diff --git a/BasicServicesKit/time_service.h b/BasicServicesKit/time_service.h new file mode 100644 index 000000000..c7194a406 --- /dev/null +++ b/BasicServicesKit/time_service.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TIME_SERVICE_H +#define TIME_SERVICE_H + +/** + * @addtogroup TimeService + * @{ + * + * @brief Declares the time zone capabilities provided by TimeService to an application. + * @since 12 + */ +/** + * @file time_service.h + * + * @brief Declares the APIs for obtaining the time zone information. + * @library libtime_service_ndk.so + * @syscap SystemCapability.MiscServices.Time + * @since 12 + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the error codes. + * + * @since 12 + */ +typedef enum TimeService_ErrCode { + /** @error Success.*/ + TIMESERVICE_ERR_OK = 0, + + /** @error Failed to obtain system parameters.*/ + TIMESERVICE_ERR_INTERNAL_ERROR = 13000001, + + /** @error Invalid parameter.*/ + TIMESERVICE_ERR_INVALID_PARAMETER = 13000002, +} TimeService_ErrCode; + +/** + * @brief Obtains the current system time zone. + * + * @param timeZone Pointer to an array of characters indicating the time zone ID. On success, the string indicates the + * current system time zone ID. On failure, the string is empty. The string is terminated using '\0'. + * @param len Size of the memory allocated for the time zone ID character array. There is no upper limit for the length + * of the time zone ID. It is recommended to allocate sufficient memory, at least not less than 31 bytes. + * @return Returns {@link TIMESERVICE_ERR_OK} if the operation is successful. + * Returns {@link TIMESERVICE_ERR_INTERNAL_ERROR} if obtaining the system parameters fails. + * Returns {@link TIMESERVICE_ERR_INVALID_PARAMETER} if timeZone is a null pointer or the length of the + * time zone ID (excluding the terminating character ('\0')) is greater than or equal to len. + * @syscap SystemCapability.MiscServices.Time + * @since 12 + */ +TimeService_ErrCode OH_TimeService_GetTimeZone(char *timeZone, uint32_t len); + +#ifdef __cplusplus +} +#endif + +/** @} */ + +#endif /* TIME_SERVICE_H */ \ No newline at end of file -- Gitee From 8ddcb056970cb9e02e9af10b779c36595e505be9 Mon Sep 17 00:00:00 2001 From: zhangwuf Date: Tue, 20 Aug 2024 14:33:59 +0800 Subject: [PATCH 105/620] =?UTF-8?q?check=E5=B7=A5=E5=85=B7=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AF=B9=E9=9D=9E=E5=85=BC=E5=AE=B9=E6=80=A7=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangwuf --- .../capi_parser/src/coreImpl/check/check.py | 11 +- .../src/coreImpl/check/check_compatibility.py | 49 +++++ .../src/coreImpl/check/check_doc.py | 2 +- .../src/coreImpl/diff/diff_file.py | 19 +- .../src/coreImpl/diff/diff_processor_node.py | 91 +++++---- .../diff/diff_processor_permission.py | 4 +- .../capi_parser/src/coreImpl/parser/parser.py | 3 +- .../src/typedef/check/check_compatibility.py | 177 ++++++++++++++++++ .../capi_parser/src/typedef/diff/diff.py | 36 ++-- 9 files changed, 334 insertions(+), 58 deletions(-) create mode 100644 build-tools/capi_parser/src/coreImpl/check/check_compatibility.py create mode 100644 build-tools/capi_parser/src/typedef/check/check_compatibility.py diff --git a/build-tools/capi_parser/src/coreImpl/check/check.py b/build-tools/capi_parser/src/coreImpl/check/check.py index db91aeb04..02c062c63 100644 --- a/build-tools/capi_parser/src/coreImpl/check/check.py +++ b/build-tools/capi_parser/src/coreImpl/check/check.py @@ -18,9 +18,11 @@ import os.path import openpyxl as op from pathlib import Path from typedef.check.check import FileDocInfo, check_command_message, CheckErrorMessage +from typedef.check.check_compatibility import check_compatibility_command_message from coreImpl.check.check_doc import process_comment, process_file_doc_info from coreImpl.check.check_name import check_file_name, check_api_name from coreImpl.parser.parser import parser_include_ast +from coreImpl.check.check_compatibility import check_compatibility_entrance def process_api_json(api_info, file_doc_info, api_result_info_list, parent_kind, command_list): @@ -112,7 +114,7 @@ def write_in_txt(check_result, output_path): def result_to_json(check_result): - return json.dumps(check_result, default=lambda obj: obj.__dict__, indent=4) + return json.dumps(check_result, default=lambda obj: obj.__dict__, indent=4, ensure_ascii=False) def get_file_path(txt_file): # 路径装在txt文件用的--获取.h文件路径 @@ -134,8 +136,10 @@ def curr_entry(files_path, command: str, output): return if command == 'all': command_list = check_command_message + command_of_compatibility_list = check_compatibility_command_message else: command_list = command.split(',') + command_of_compatibility_list = command_list check_result_list = [] if len(file_list) > 0: check_result_list = get_check_result_list(file_list, root_path, command_list) @@ -146,6 +150,11 @@ def curr_entry(files_path, command: str, output): result_list.append(result) else: result_list = check_result_list + old_dir = r'' + new_dir = r'' + if old_dir and new_dir: + compatibility_data = check_compatibility_entrance(old_dir, new_dir, command_of_compatibility_list) + result_list.extend(compatibility_data) write_in_txt(result_list, output) diff --git a/build-tools/capi_parser/src/coreImpl/check/check_compatibility.py b/build-tools/capi_parser/src/coreImpl/check/check_compatibility.py new file mode 100644 index 000000000..fb9e70f7b --- /dev/null +++ b/build-tools/capi_parser/src/coreImpl/check/check_compatibility.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from coreImpl.diff.diff_file import check_diff_entrance +from typedef.check.check import CheckOutPut +from typedef.check.check_compatibility import match_diff_and_check_scene_dict, CheckCompatibilityErrorMessage + + +def process_each_diff_data(diff_data: list, compatibility_rule: list): + check_compatibility_result_list = [] + for element in diff_data: + diff_type_message = element.diff_type.name + match_check_rule = match_diff_and_check_scene_dict.get(diff_type_message) + if (not element.is_compatible) and match_check_rule and match_check_rule in compatibility_rule: + old_different_content = str(element.old_differ_content) + new_different_content = str(element.new_differ_content) + match_check_message = (CheckCompatibilityErrorMessage.get_rule_message(match_check_rule) + .replace('$$', old_different_content).replace('&&', new_different_content)) + old_declara = element.old_api_declara + new_declara = element.new_api_declara + content_line = element.api_line + if element.file_doc_line != 0: + content_line = element.file_doc_line + main_buggy_code = 'Old since:{}\nNew since:{}'.format(old_declara, new_declara) + result_obj = CheckOutPut(element.api_file_path, content_line, match_check_rule, match_check_message, + main_buggy_code, content_line) + check_compatibility_result_list.append(result_obj) + + return check_compatibility_result_list + + +def check_compatibility_entrance(old_dir, new_dir, compatibility_rule: list): + diff_data = check_diff_entrance(old_dir, new_dir) + check_compatibility_data_list = process_each_diff_data(diff_data, compatibility_rule) + + return check_compatibility_data_list diff --git a/build-tools/capi_parser/src/coreImpl/check/check_doc.py b/build-tools/capi_parser/src/coreImpl/check/check_doc.py index 99fbee693..cf966259f 100644 --- a/build-tools/capi_parser/src/coreImpl/check/check_doc.py +++ b/build-tools/capi_parser/src/coreImpl/check/check_doc.py @@ -447,7 +447,7 @@ def process_comment(comment: str, file_doc_info: FileDocInfo, api_info) -> list: comment_start_line = api_info['location']['location_line'] - comment.count('\n') - 1 for index, item in enumerate(result_json): if api_info['kind'] == CursorKind.TRANSLATION_UNIT.name and len(item['tags']) > 0 and\ - item['tags'][0]['tag'] == '}' and index <= len(api_info['line_list']) - 1: + item['tags'][0]['tag'] == '}' and 'line_list' in api_info and index <= len(api_info['line_list']) - 1: comment_start_line = api_info['line_list'][index] api_result_info_list.extend(process_each_comment(item, file_doc_info, api_info, comment_start_line)) if index == len(result_json) - 1: diff --git a/build-tools/capi_parser/src/coreImpl/diff/diff_file.py b/build-tools/capi_parser/src/coreImpl/diff/diff_file.py index 2c4c0fb16..202841f38 100644 --- a/build-tools/capi_parser/src/coreImpl/diff/diff_file.py +++ b/build-tools/capi_parser/src/coreImpl/diff/diff_file.py @@ -17,6 +17,7 @@ import filecmp import json import os import stat +import re from collections import OrderedDict import openpyxl as op from coreImpl.parser.parser import diff_parser_include_ast @@ -175,6 +176,12 @@ def start_diff_file(old_dir, new_dir, output_path): write_in_txt(result_json, output_path_txt) +def check_diff_entrance(old_dir, new_dir): + result_info_list = global_assignment(old_dir, new_dir) + + return result_info_list + + def disposal_result_data(result_info_list): data = [] for diff_info in result_info_list: @@ -252,10 +259,14 @@ def get_file_ext(file_name): def filter_ignore_file(file_path): - ignore_dict = IgnoreFileDirectory.ignore_file_dict - for key in ignore_dict.keys(): - if key in file_path: - return False + norm_file_path = os.path.normpath(file_path) + if os.name == 'nt': # Windows + pattern = re.compile(IgnoreFileDirectory.IGNORE_FILE_DIR_wd.value) + else: # Linux / macOS + pattern = re.compile(IgnoreFileDirectory.IGNORE_FILE_DIR_lx.value) + # 检查匹配 + if pattern.search(norm_file_path): + return False return True diff --git a/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py b/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py index c4c1b6a3a..8d48a2641 100644 --- a/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py +++ b/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py @@ -68,6 +68,8 @@ def wrap_diff_info(old_info, new_info, diff_info: DiffInfo): else: api_declare = old_info['name'] + if old_info['kind'] != 'TRANSLATION_UNIT': + diff_info.set_old_api_declara(api_declare) old_content = '类名:{};\nAPI声明:{};\n差异内容:{}\n'.format(diff_info.class_name, api_declare, diff_info.old_differ_content) diff_info.set_old_api_full_text(old_content) @@ -87,6 +89,8 @@ def wrap_diff_info(old_info, new_info, diff_info: DiffInfo): api_declare = new_info['node_content']['content'] else: api_declare = new_info['name'] + if new_info['kind'] != 'TRANSLATION_UNIT': + diff_info.set_new_api_declara(api_declare) new_content = '类名:{};\nAPI声明:{};\n差异内容:{}\n'.format(diff_info.class_name, api_declare, diff_info.new_differ_content) @@ -423,7 +427,7 @@ def process_union_name(old, new, diff_union_list): if old['name'] != new['name']: old_union_name = old['name'] new_union_name = new['name'] - result_message_obj = get_initial_result_obj(DiffType.STRUCT_MEMBER_NAME_CHANGE, + result_message_obj = get_initial_result_obj(DiffType.UNION_NAME_CHANGE, old_union_name, new_union_name) diff_info = wrap_diff_info(old, new, result_message_obj) diff_union_list.append(diff_info) @@ -437,7 +441,7 @@ def process_union_member(old, new, diff_union_list): if old_member_result.get(key) is None: old_member_content = 'NA' new_member_content = new_member_result.get(key)['node_content']['content'] - result_message_obj = get_initial_result_obj(DiffType.STRUCT_MEMBER_NAME_CHANGE, + result_message_obj = get_initial_result_obj(DiffType.UNION_MEMBER_ADD, old_member_content, new_member_content) diff_info = wrap_diff_info(old_member_result.get(key), new_member_result.get(key), @@ -446,7 +450,7 @@ def process_union_member(old, new, diff_union_list): elif new_member_result.get(key) is None: old_member_content = old_member_result.get(key)['node_content']['content'] new_member_content = 'NA' - result_message_obj = get_initial_result_obj(DiffType.STRUCT_MEMBER_NAME_CHANGE, + result_message_obj = get_initial_result_obj(DiffType.UNION_MEMBER_REDUCE, old_member_content, new_member_content) diff_info = wrap_diff_info(old_member_result.get(key), new_member_result.get(key), @@ -978,17 +982,19 @@ def process_tag_file(old_tag, new_tag, old_info, new_info): def process_tag_library(old_tag, new_tag, old_info, new_info): diff_info_list = [] if old_tag is None: - diff_info_list.append( - wrap_diff_info(old_info, new_info, DiffInfo(DiffType.DOC_TAG_LIBRARY_NA_TO_HAVE, 'NA', new_tag['name']))) + library_result_obj = DiffInfo(DiffType.DOC_TAG_LIBRARY_NA_TO_HAVE, 'NA', new_tag['name']) + set_file_doc_content_snippet(old_tag, new_tag, library_result_obj) + diff_info_list.append(wrap_diff_info(old_info, new_info, library_result_obj)) return diff_info_list if new_tag is None: - diff_info_list.append( - wrap_diff_info(old_info, new_info, DiffInfo(DiffType.DOC_TAG_LIBRARY_HAVE_TO_NA, old_tag['name'], "NA"))) + library_result_obj = DiffInfo(DiffType.DOC_TAG_LIBRARY_HAVE_TO_NA, old_tag['name'], "NA") + set_file_doc_content_snippet(old_tag, new_tag, library_result_obj) + diff_info_list.append(wrap_diff_info(old_info, new_info, library_result_obj)) return diff_info_list if old_tag['name'] != new_tag['name']: - diff_info_list.append(wrap_diff_info(old_info, new_info, - DiffInfo(DiffType.DOC_TAG_LIBRARY_A_TO_B, old_tag['name'], - new_tag['name']))) + library_result_obj = DiffInfo(DiffType.DOC_TAG_LIBRARY_A_TO_B, old_tag['name'], new_tag['name']) + set_file_doc_content_snippet(old_tag, new_tag, library_result_obj) + diff_info_list.append(wrap_diff_info(old_info, new_info, library_result_obj)) return diff_info_list @@ -1013,35 +1019,47 @@ def process_tag_param(old_tag, new_tag, old_info, new_info): return diff_info_list +def set_file_doc_content_snippet(old_tag, new_tag, diff_obj): + if old_tag is not None: + if old_tag.get('source'): + diff_obj.set_file_doc_line(old_tag.get('source')[0].get('number')) + diff_obj.set_old_api_declara(old_tag.get('source')[0].get('source')) + if new_tag is not None: + if new_tag.get('source'): + diff_obj.set_file_doc_line(new_tag.get('source')[0].get('number')) + diff_obj.set_new_api_declara(new_tag.get('source')[0].get('source')) + + def process_tag_permission(old_tag, new_tag, old_info, new_info): diff_info_list = [] if old_tag is None: - diff_info_list.append(wrap_diff_info(old_info, new_info, DiffInfo(DiffType.DOC_TAG_PERMISSION_NA_TO_HAVE, - 'NA', - f'{new_tag["name"]} ' - f'{new_tag["description"]}'))) + permission_result_obj = DiffInfo(DiffType.DOC_TAG_PERMISSION_NA_TO_HAVE, 'NA', f'{new_tag["name"]} ' + f'{new_tag["description"]}') + set_file_doc_content_snippet(old_tag, new_tag, permission_result_obj) + diff_info_list.append(wrap_diff_info(old_info, new_info, permission_result_obj)) return diff_info_list if new_tag is None: - diff_info_list.append(wrap_diff_info(old_info, new_info, DiffInfo(DiffType.DOC_TAG_PERMISSION_HAVE_TO_NA, - f'{old_tag["name"]} ' - f'{old_tag["description"]}', - 'NA'))) + permission_result_obj = DiffInfo(DiffType.DOC_TAG_PERMISSION_HAVE_TO_NA, f'{old_tag["name"]} ' + f'{old_tag["description"]}', 'NA') + set_file_doc_content_snippet(old_tag, new_tag, permission_result_obj) + diff_info_list.append(wrap_diff_info(old_info, new_info, permission_result_obj)) return diff_info_list old_permission = f'{old_tag["name"]} {old_tag["description"]}' new_permission = f'{new_tag["name"]} {new_tag["description"]}' if old_permission != new_permission: compare_value = compare_permission(old_permission, new_permission) if compare_value.state_range == RangeChange.DOWN.value: - diff_info_list.append(wrap_diff_info(old_info, new_info, - DiffInfo(DiffType.DOC_TAG_PERMISSION_RANGE_SMALLER, old_permission, - new_permission))) + permission_result_obj = DiffInfo(DiffType.DOC_TAG_PERMISSION_RANGE_SMALLER, old_permission, new_permission) + set_file_doc_content_snippet(old_tag, new_tag, permission_result_obj) + diff_info_list.append(wrap_diff_info(old_info, new_info, permission_result_obj)) elif compare_value.state_range == RangeChange.UP.value: - diff_info_list.append(wrap_diff_info(old_info, new_info, DiffInfo( - DiffType.DOC_TAG_PERMISSION_RANGE_BIGGER, old_permission, new_permission))) + permission_result_obj = DiffInfo(DiffType.DOC_TAG_PERMISSION_RANGE_BIGGER, old_permission, new_permission) + set_file_doc_content_snippet(old_tag, new_tag, permission_result_obj) + diff_info_list.append(wrap_diff_info(old_info, new_info, permission_result_obj)) elif compare_value.state_range == RangeChange.CHANGE.value: - diff_info_list.append(wrap_diff_info(old_info, new_info, - DiffInfo(DiffType.DOC_TAG_PERMISSION_RANGE_CHANGE, old_permission, - new_permission))) + permission_result_obj = DiffInfo(DiffType.DOC_TAG_PERMISSION_RANGE_CHANGE, old_permission, new_permission) + set_file_doc_content_snippet(old_tag, new_tag, permission_result_obj) + diff_info_list.append(wrap_diff_info(old_info, new_info, permission_result_obj)) return diff_info_list @@ -1075,22 +1093,23 @@ def process_tag_since(old_tag, new_tag, old_info, new_info): def process_tag_syscap(old_tag, new_tag, old_info, new_info): diff_info_list = [] if old_tag is None: - diff_info_list.append(wrap_diff_info(old_info, new_info, DiffInfo(DiffType.DOC_TAG_SYSCAP_NA_TO_HAVE, - 'NA', - f'{new_tag["name"]} ' - f'{new_tag["description"]}'))) + syscap_result_obj = DiffInfo(DiffType.DOC_TAG_SYSCAP_NA_TO_HAVE, 'NA', f'{new_tag["name"]} ' + f'{new_tag["description"]}') + set_file_doc_content_snippet(old_tag, new_tag, syscap_result_obj) + diff_info_list.append(wrap_diff_info(old_info, new_info, syscap_result_obj)) return diff_info_list if new_tag is None: - diff_info_list.append(wrap_diff_info(old_info, new_info, DiffInfo(DiffType.DOC_TAG_SYSCAP_HAVE_TO_NA, - f'{old_tag["name"]} ' - f'{old_tag["description"]}', - 'NA'))) + syscap_result_obj = DiffInfo(DiffType.DOC_TAG_SYSCAP_HAVE_TO_NA, f'{old_tag["name"]} ' + f'{old_tag["description"]}', 'NA') + set_file_doc_content_snippet(old_tag, new_tag, syscap_result_obj) + diff_info_list.append(wrap_diff_info(old_info, new_info, syscap_result_obj)) return diff_info_list old_syscap = f'{old_tag["name"]} {old_tag["description"]}' new_syscap = f'{new_tag["name"]} {new_tag["description"]}' if old_syscap != new_syscap: - diff_info_list.append( - wrap_diff_info(old_info, new_info, DiffInfo(DiffType.DOC_TAG_SYSCAP_A_TO_B, old_syscap, new_syscap))) + syscap_result_obj = DiffInfo(DiffType.DOC_TAG_SYSCAP_A_TO_B, old_syscap, new_syscap) + set_file_doc_content_snippet(old_tag, new_tag, syscap_result_obj) + diff_info_list.append(wrap_diff_info(old_info, new_info, syscap_result_obj)) return diff_info_list diff --git a/build-tools/capi_parser/src/coreImpl/diff/diff_processor_permission.py b/build-tools/capi_parser/src/coreImpl/diff/diff_processor_permission.py index b30825902..8b7c2f852 100644 --- a/build-tools/capi_parser/src/coreImpl/diff/diff_processor_permission.py +++ b/build-tools/capi_parser/src/coreImpl/diff/diff_processor_permission.py @@ -49,7 +49,7 @@ class DiffProcessorPermission: variable_list = [] # 命题集合 @staticmethod - def get_bool_in_list(self, number_list, bin_len): + def get_bool_in_list(number_list, bin_len): state_list = [bin(i) for i in number_list] state_list = [x[2:] for x in state_list] state_list = ['0' * (bin_len - len(x)) + x for x in state_list] @@ -57,7 +57,7 @@ class DiffProcessorPermission: return tuple(state_list) @staticmethod - def process_value(self, state_value): + def process_value(state_value): calculate = CalculateValue() for state in state_value: if state_value[state]: diff --git a/build-tools/capi_parser/src/coreImpl/parser/parser.py b/build-tools/capi_parser/src/coreImpl/parser/parser.py index a0ecee8d2..a7a04019e 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/parser.py +++ b/build-tools/capi_parser/src/coreImpl/parser/parser.py @@ -295,7 +295,6 @@ def parser(directory_path): # 目录路径 def parser_include_ast(dire_file_path, include_path: list): # 对于单独的.h解析接口 correct_include_path = [] link_include_path = [dire_file_path] - copy_std_lib(link_include_path, dire_file_path) copy_self_include(link_include_path, dire_file_path) for item in include_path: split_path = os.path.splitext(item) @@ -333,7 +332,7 @@ def get_dir_file_path(dir_path): link_include_path.append(dir_path) for file in filenames: if 'build-tools' not in dir_path and 'sysroot_myself' not in dir_path and file.endswith('.h'): - file_path_list.append(os.path.join(dir_path, file)) + file_path_list.append(os.path.normpath(os.path.join(dir_path, file))) return file_path_list, link_include_path diff --git a/build-tools/capi_parser/src/typedef/check/check_compatibility.py b/build-tools/capi_parser/src/typedef/check/check_compatibility.py new file mode 100644 index 000000000..9b06a9a12 --- /dev/null +++ b/build-tools/capi_parser/src/typedef/check/check_compatibility.py @@ -0,0 +1,177 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import enum +from typedef.diff.diff import DiffType + + +class CheckCompatibilityErrorMessage(enum.Enum): + API_CHANGE_INCOMPATIBLE_01 = ('API check error of [api compatibility errors]:Deleting [$$] API is prohibited.' + 'Please resolve it.') + API_CHANGE_INCOMPATIBLE_02 = ('API check error of [api compatibility errors]:Changing API name [$$] to API name ' + '[&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_03 = ('API check error of [api compatibility errors]:Deleting [$$] file is prohibited.' + 'Please resolve it.') + API_CHANGE_INCOMPATIBLE_04 = ('API check error of [api compatibility errors]:Changing [$$] file path is prohibited.' + 'Please resolve it.') + API_CHANGE_INCOMPATIBLE_05 = ('API check error of [api compatibility errors]:Changing function name [$$] to ' + 'function name [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_06 = ('API check error of [api compatibility errors]:Changing function return type [$$] ' + 'to function return type [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_07 = ('API check error of [api compatibility errors]:Changing function param location [$$] ' + 'to function param location [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_08 = ('API check error of [api compatibility errors]:Adding new function param [&&] is ' + 'prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_09 = ('API check error of [api compatibility errors]:Deleting function param [$$] is ' + 'prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_10 = ('API check error of [api compatibility errors]:Changing function param type [$$] ' + 'to function param type [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_11 = ('API check error of [api compatibility errors]:Changing variable name [$$] to ' + 'variable name [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_12 = ('API check error of [api compatibility errors]:Changing const name [$$] to const ' + 'name [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_13 = ('API check error of [api compatibility errors]:Changing variable type [$$] to ' + 'variable type [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_14 = ('API check error of [api compatibility errors]:Changing const type [$$] to const ' + 'type [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_15 = ('API check error of [api compatibility errors]:Changing variable [$$] to const [&&] ' + 'is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_16 = ('API check error of [api compatibility errors]:Changing const [$$] to variable [&&] ' + 'is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_17 = ('API check error of [api compatibility errors]:Changing variable value [$$] to ' + 'variable value [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_18 = ('API check error of [api compatibility errors]:Changing const value [$$] to const ' + 'value [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_19 = ('API check error of [api compatibility errors]:Deleting variable [$$] is prohibited.' + 'Please resolve it.') + API_CHANGE_INCOMPATIBLE_20 = ('API check error of [api compatibility errors]:Deleting const [$$] is prohibited.' + 'Please resolve it.') + API_CHANGE_INCOMPATIBLE_21 = ('API check error of [api compatibility errors]:Changing macro name [$$] to macro ' + 'name [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_22 = ('API check error of [api compatibility errors]:Changing macro value [$$] to macro ' + 'value [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_23 = ('API check error of [api compatibility errors]:Deleting macro define [$$] is ' + 'prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_24 = ('API check error of [api compatibility errors]:Changing enum name [$$] to enum name ' + '[&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_25 = ('API check error of [api compatibility errors]:Changing enum member name [$$] to ' + 'enum member name [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_26 = ('API check error of [api compatibility errors]:Changing enum member value [$$] to ' + 'enum member name [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_27 = ('API check error of [api compatibility errors]:Deleting enum [$$] is prohibited.' + 'Please resolve it.') + API_CHANGE_INCOMPATIBLE_28 = ('API check error of [api compatibility errors]:Deleting enum member [$$] is ' + 'prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_29 = ('API check error of [api compatibility errors]:Changing struct name [$$] to struct ' + 'name [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_30 = ('API check error of [api compatibility errors]:Adding struct member [&&] is ' + 'prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_31 = ('API check error of [api compatibility errors]:Deleting struct member [$$] is ' + 'prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_32 = ('API check error of [api compatibility errors]:Changing struct member type [$$] to ' + 'struct member type [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_33 = ('API check error of [api compatibility errors]:Changing struct member name [$$] to ' + 'struct member name [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_34 = ('API check error of [api compatibility errors]:Deleting struct [$$] is prohibited.' + 'Please resolve it.') + API_CHANGE_INCOMPATIBLE_35 = ('API check error of [api compatibility errors]:Changing struct since [$$] to ' + 'struct since [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_36 = ('API check error of [api compatibility errors]:Changing union name [$$] to ' + 'union name [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_37 = ('API check error of [api compatibility errors]:Adding union member [&&] is ' + 'prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_38 = ('API check error of [api compatibility errors]:Deleting union member [$$] is ' + 'prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_39 = ('API check error of [api compatibility errors]:Changing union member type [$$] to ' + 'union member type [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_40 = ('API check error of [api compatibility errors]:Changing union member name [$$] to ' + 'union member name [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_41 = ('API check error of [api compatibility errors]:Deleting union [$$] is prohibited.' + 'Please resolve it.') + API_CHANGE_INCOMPATIBLE_42 = ('API check error of [api compatibility errors]:Changing union since [$$] to union ' + 'since [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_43 = ('API check error of [api compatibility errors]:Changing the @library in comments ' + 'from no to [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_44 = ('API check error of [api compatibility errors]:Changing the @library in comments ' + 'from [$$] to no is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_45 = ('API check error of [api compatibility errors]:Changing the @library in comments ' + 'from [$$] to [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_46 = ('API check error of [api compatibility errors]:Changing the @permission in comments ' + 'is prohibited.Add and relation permission.Please resolve it.') + API_CHANGE_INCOMPATIBLE_47 = ('API check error of [api compatibility errors]:Changing the @permission in comments ' + 'is prohibited.Reduce or relation permission.Please resolve it.') + API_CHANGE_INCOMPATIBLE_48 = ('API check error of [api compatibility errors]:Changing the @permission in comments ' + 'is prohibited.Permission value change.Please resolve it.') + API_CHANGE_INCOMPATIBLE_49 = ('API check error of [api compatibility errors]:Changing the @syscap in comments ' + 'from no to [&&] is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_50 = ('API check error of [api compatibility errors]:Changing the @syscap in comments ' + 'from [$$] to no is prohibited.Please resolve it.') + API_CHANGE_INCOMPATIBLE_51 = ('API check error of [api compatibility errors]:Changing the @syscap in comments ' + 'from [$$] to [&&] is prohibited.Please resolve it.') + + @classmethod + def get_rule_message(cls, rule): + return cls[rule].value if rule in cls.__members__ else 'None' + + +check_compatibility_command_message = [ + member.name for name_compatibility_tool, + member in CheckCompatibilityErrorMessage.__members__.items() +] + + +match_diff_and_check_scene_dict = { + DiffType.REDUCE_API.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_01.name, + DiffType.REDUCE_FILE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_03.name, + DiffType.FUNCTION_NAME_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_05.name, + DiffType.FUNCTION_RETURN_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_06.name, + DiffType.FUNCTION_PARAM_POS_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_07.name, + DiffType.FUNCTION_PARAM_ADD.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_08.name, + DiffType.FUNCTION_PARAM_REDUCE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_09.name, + DiffType.FUNCTION_PARAM_TYPE_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_10.name, + DiffType.VARIABLE_NAME_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_11.name, + DiffType.CONSTANT_NAME_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_12.name, + DiffType.VARIABLE_TYPE_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_13.name, + DiffType.CONSTANT_TYPE_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_14.name, + DiffType.VARIABLE_CHANGE_TO_CONSTANT.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_15.name, + DiffType.CONSTANT_CHANGE_TO_VARIABLE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_16.name, + DiffType.VARIABLE_VALUE_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_17.name, + DiffType.CONSTANT_VALUE_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_18.name, + DiffType.DEFINE_NAME_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_21.name, + DiffType.DEFINE_TEXT_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_22.name, + DiffType.ENUM_NAME_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_24.name, + DiffType.ENUM_MEMBER_NAME_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_25.name, + DiffType.ENUM_MEMBER_VALUE_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_26.name, + DiffType.ENUM_MEMBER_REDUCE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_28.name, + DiffType.STRUCT_NAME_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_29.name, + DiffType.STRUCT_MEMBER_ADD.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_30.name, + DiffType.STRUCT_MEMBER_REDUCE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_31.name, + DiffType.STRUCT_MEMBER_TYPE_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_32.name, + DiffType.STRUCT_MEMBER_NAME_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_33.name, + DiffType.UNION_NAME_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_36.name, + DiffType.UNION_MEMBER_ADD.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_37.name, + DiffType.UNION_MEMBER_REDUCE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_38.name, + DiffType.UNION_MEMBER_TYPE_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_39.name, + DiffType.UNION_MEMBER_NAME_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_40.name, + DiffType.DOC_TAG_LIBRARY_NA_TO_HAVE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_43.name, + DiffType.DOC_TAG_LIBRARY_HAVE_TO_NA.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_44.name, + DiffType.DOC_TAG_LIBRARY_A_TO_B.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_45.name, + DiffType.DOC_TAG_PERMISSION_RANGE_SMALLER: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_47.name, + DiffType.DOC_TAG_PERMISSION_RANGE_CHANGE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_48.name, + DiffType.DOC_TAG_SYSCAP_NA_TO_HAVE.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_49.name, + DiffType.DOC_TAG_SYSCAP_HAVE_TO_NA.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_50.name, + DiffType.DOC_TAG_SYSCAP_A_TO_B.name: CheckCompatibilityErrorMessage.API_CHANGE_INCOMPATIBLE_51.name, +} diff --git a/build-tools/capi_parser/src/typedef/diff/diff.py b/build-tools/capi_parser/src/typedef/diff/diff.py index d9a7b4b3d..adb97275c 100644 --- a/build-tools/capi_parser/src/typedef/diff/diff.py +++ b/build-tools/capi_parser/src/typedef/diff/diff.py @@ -391,6 +391,9 @@ class DiffInfo: open_close_api: str = '' is_third_party_api = False current_api_type: str = '' + old_api_declara: str = '' + new_api_declara: str = '' + file_doc_line: int = 0 def __init__(self, diff_type: DiffType, old_differ_content, new_differ_content): self.diff_type = diff_type @@ -563,6 +566,24 @@ class DiffInfo: def get_current_api_type(self): return self.current_api_type + def set_old_api_declara(self, old_api_declara): + self.old_api_declara = old_api_declara + + def get_old_api_declara(self): + return self.old_api_declara + + def set_new_api_declara(self, new_api_declara): + self.new_api_declara = new_api_declara + + def get_new_api_declara(self): + return self.new_api_declara + + def set_file_doc_line(self, file_doc_line): + self.file_doc_line = file_doc_line + + def get_file_doc_line(self): + return self.file_doc_line + class OutputJson: api_name: str = '' @@ -732,15 +753,6 @@ class ApiChangeData: return self.current_api_type -class IgnoreFileDirectory: - ignore_file_dict = { - 'arm-linux-ohos': '', - 'aarch64-linux-ohos': '', - 'x86_64-linux-ohos': '', - 'i686-linux-ohos': '', - 'tee': '', - 'linux': '' - } - - def get_ignore_file_dict(self): - return self.ignore_file_dict +class IgnoreFileDirectory(enum.Enum): + IGNORE_FILE_DIR_lx = r'/(arm-linux-ohos|aarch64-linux-ohos|x86_64-linux-ohos|i686-linux-ohos|linux|tee|)(/|$)' + IGNORE_FILE_DIR_wd = r'\\(arm-linux-ohos|aarch64-linux-ohos|x86_64-linux-ohos|i686-linux-ohos|linux|tee|)(\\|$)' -- Gitee From 0775c53e26afd84ca14b71537cfac7085fe0ea4a Mon Sep 17 00:00:00 2001 From: jiang-qunchao Date: Wed, 21 Aug 2024 09:32:02 +0800 Subject: [PATCH 106/620] add libjsvm.ndk.json Signed-off-by: jiang-qunchao --- ark_runtime/jsvm/libjsvm.ndk.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ark_runtime/jsvm/libjsvm.ndk.json b/ark_runtime/jsvm/libjsvm.ndk.json index a9a775724..e0157b772 100644 --- a/ark_runtime/jsvm/libjsvm.ndk.json +++ b/ark_runtime/jsvm/libjsvm.ndk.json @@ -730,5 +730,9 @@ { "first_introduced": "12", "name": "OH_JSVM_CreateWasmCache" + }, + { + "first_introduced": "12", + "name": "OH_JSVM_ReleaseCache" } ] -- Gitee From e7195ff15d14922af10a2ea6e6516740cf6d441a Mon Sep 17 00:00:00 2001 From: yangxuguang-huawei Date: Sun, 18 Aug 2024 15:16:06 +0800 Subject: [PATCH 107/620] feat: add StartNativeChildProcess Signed-off-by: yangxuguang-huawei --- .../child_process/libchild_process.ndk.json | 9 +- .../child_process/native_child_process.h | 99 +++++++++++++++++++ .../coreImpl/check/rules/perssion_rule.json | 9 ++ 3 files changed, 116 insertions(+), 1 deletion(-) diff --git a/ability/ability_runtime/child_process/libchild_process.ndk.json b/ability/ability_runtime/child_process/libchild_process.ndk.json index 6206b6310..e42bbbc44 100644 --- a/ability/ability_runtime/child_process/libchild_process.ndk.json +++ b/ability/ability_runtime/child_process/libchild_process.ndk.json @@ -1,3 +1,10 @@ [ - { "name": "OH_Ability_CreateNativeChildProcess" } + { + "first_introduced": "12", + "name": "OH_Ability_CreateNativeChildProcess" + }, + { + "first_introduced": "12", + "name": "OH_Ability_StartNativeChildProcess" + } ] \ No newline at end of file diff --git a/ability/ability_runtime/child_process/native_child_process.h b/ability/ability_runtime/child_process/native_child_process.h index 5cce2512a..821456513 100644 --- a/ability/ability_runtime/child_process/native_child_process.h +++ b/ability/ability_runtime/child_process/native_child_process.h @@ -54,6 +54,11 @@ typedef enum Ability_NativeChildProcess_ErrCode { */ NCP_NO_ERROR = 0, + /** + * @error Operation not permitted. + */ + NCP_ERR_NO_PERMISSION = 201, + /** * @error Invalid parameter. */ @@ -173,6 +178,100 @@ typedef void (*OH_Ability_OnNativeChildProcessStarted)(int errCode, OHIPCRemoteP int OH_Ability_CreateNativeChildProcess(const char* libName, OH_Ability_OnNativeChildProcessStarted onProcessStarted); +/** + * @brief The info of the file descriptors passed to child process. + * @since 12 + */ +typedef struct NativeChildProcess_Fd { + /** the key of the file descriptor. */ + char* fdName; + + /** the value of the file descriptor. */ + int32_t fd; + + /** the next pointer of the linked list. */ + struct NativeChildProcess_Fd* next; +} NativeChildProcess_Fd; + +/** + * @brief The list of the info of the file descriptors passed to child process. + * @since 12 + */ +typedef struct NativeChildProcess_FdList { + /** the head of the list. + * For details, see {@link NativeChildProcess_Fd}. + */ + struct NativeChildProcess_Fd* head; +} NativeChildProcess_FdList; + +/** + * @brief Enumerates the isolation modes used by the native child process module. + * @since 12 + */ +typedef enum NativeChildProcess_IsolationMode { + /** + * Normal isolation mode, parent process shares the same sandbox or internet with the child process. + */ + NCP_ISOLATION_MODE_NORMAL = 0, + + /** + * Isolated mode, parent process does not share the same sandbox or internet with the child process. + */ + NCP_ISOLATION_MODE_ISOLATED = 1, +} NativeChildProcess_IsolationMode; + +/** + * @brief The options used by the child process. + * @since 12 + */ +typedef struct NativeChildProcess_Options { + /** the isolation mode used by the child process. + * For details, see {@link NativeChildProcess_IsolationMode}. + */ + NativeChildProcess_IsolationMode isolationMode; + + /** reserved field for future extension purposes */ + int64_t reserved; +} NativeChildProcess_Options; + +/** + * @brief The arguments passed to the child process. + * @since 12 + */ +typedef struct NativeChildProcess_Args { + /** the entry parameter. */ + char* entryParams; + + /** the list of the info of the file descriptors passed to child process. + * For details, see {@link NativeChildProcess_FdList}. + */ + struct NativeChildProcess_FdList fdList; +} NativeChildProcess_Args; + +/** + * @brief Starts a child process, loads the specified dynamic library file. + * + * @permission {@code ohos.permission.START_NATIVE_CHILD_PROCESS} + * @param entry Name of the entry of the dynamic library file loaded in the child process. The value cannot be nullptr. + * @param args The arguments passed to the child process. + * For details, see {@link NativeChildProcess_Args}. + * @param options The child process options. + * For details, see {@link NativeChildProcess_Options}. + * @param pid The started child process id. + * @return Returns {@link NCP_NO_ERROR} if the call is successful.\n + * Returns {@link NCP_ERR_NO_PERMISSION} if the operation is not permitted. + * The permission {@code ohos.permission.START_NATIVE_CHILD_PROCESS} is needed.\n + * Returns {@link NCP_ERR_INVALID_PARAM} if the dynamic library name or callback function pointer is invalid.\n + * Returns {@link NCP_ERR_NOT_SUPPORTED} if the device does not support the creation of native child processes.\n + * Returns {@link NCP_ERR_ALREADY_IN_CHILD} if it is not allowed to create another child process in the child process.\n + * Returns {@link NCP_ERR_MAX_CHILD_PROCESSES_REACHED} if the maximum number of native child processes is reached.\n + * For details, see {@link Ability_NativeChildProcess_ErrCode}. + * @see OH_Ability_OnNativeChildProcessStarted + * @since 12 + */ +Ability_NativeChildProcess_ErrCode OH_Ability_StartNativeChildProcess( + const char* entry, NativeChildProcess_Args args, + NativeChildProcess_Options options, int32_t *pid); #ifdef __cplusplus } // extern "C" diff --git a/build-tools/capi_parser/src/coreImpl/check/rules/perssion_rule.json b/build-tools/capi_parser/src/coreImpl/check/rules/perssion_rule.json index 86ddddeac..1f24bce79 100644 --- a/build-tools/capi_parser/src/coreImpl/check/rules/perssion_rule.json +++ b/build-tools/capi_parser/src/coreImpl/check/rules/perssion_rule.json @@ -2581,6 +2581,15 @@ "availableLevel": "system_basic", "provisionEnable": true, "distributedSceneEnable": false + }, + { + "name": "ohos.permission.START_NATIVE_CHILD_PROCESS", + "grantMode": "system_grant", + "since": 12, + "deprecated": "", + "availableLevel": "system_basic", + "provisionEnable": true, + "distributedSceneEnable": false } ] } -- Gitee From 19dc8e50b88db0b52dcab385831775e7d3119006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=8D=9A=E6=98=8E?= Date: Wed, 21 Aug 2024 08:16:46 +0000 Subject: [PATCH 108/620] restore h dep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 罗博明 --- third_party/icu4c/ndk_headers/unicode/ubrk.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/third_party/icu4c/ndk_headers/unicode/ubrk.h b/third_party/icu4c/ndk_headers/unicode/ubrk.h index f8454beb9..9724bcf56 100644 --- a/third_party/icu4c/ndk_headers/unicode/ubrk.h +++ b/third_party/icu4c/ndk_headers/unicode/ubrk.h @@ -30,6 +30,8 @@ typedef struct UBreakIterator UBreakIterator; #endif +#include "unicode/parseerr.h" + #if !UCONFIG_NO_BREAK_ITERATION /** * \file -- Gitee From 30373ab1873f258528e833637d453c0e3f89d142 Mon Sep 17 00:00:00 2001 From: wuchengwen Date: Wed, 21 Aug 2024 16:23:23 +0800 Subject: [PATCH 109/620] add inputmethod capi Signed-off-by: wuchengwen --- inputmethod/BUILD.gn | 48 ++ .../include/inputmethod_attach_options_capi.h | 62 ++ .../include/inputmethod_controller_capi.h | 82 +++ .../include/inputmethod_cursor_info_capi.h | 86 +++ .../inputmethod_inputmethod_proxy_capi.h | 136 ++++ .../inputmethod_private_command_capi.h | 170 +++++ .../inputmethod_text_avoid_info_capi.h | 98 +++ .../include/inputmethod_text_config_capi.h | 207 ++++++ .../inputmethod_text_editor_proxy_capi.h | 680 ++++++++++++++++++ inputmethod/include/inputmethod_types_capi.h | 283 ++++++++ inputmethod/libohinputmethodndk.json | 80 +++ 11 files changed, 1932 insertions(+) create mode 100644 inputmethod/BUILD.gn create mode 100644 inputmethod/include/inputmethod_attach_options_capi.h create mode 100644 inputmethod/include/inputmethod_controller_capi.h create mode 100644 inputmethod/include/inputmethod_cursor_info_capi.h create mode 100644 inputmethod/include/inputmethod_inputmethod_proxy_capi.h create mode 100644 inputmethod/include/inputmethod_private_command_capi.h create mode 100644 inputmethod/include/inputmethod_text_avoid_info_capi.h create mode 100644 inputmethod/include/inputmethod_text_config_capi.h create mode 100644 inputmethod/include/inputmethod_text_editor_proxy_capi.h create mode 100644 inputmethod/include/inputmethod_types_capi.h create mode 100644 inputmethod/libohinputmethodndk.json diff --git a/inputmethod/BUILD.gn b/inputmethod/BUILD.gn new file mode 100644 index 000000000..ab36bb5c3 --- /dev/null +++ b/inputmethod/BUILD.gn @@ -0,0 +1,48 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") + +ohos_ndk_library("libohinputmethod") { + output_name = "ohinputmethod" + output_extension = "so" + ndk_description_file = "./libohinputmethodndk.json" + min_compact_version = "12" + system_capability = "SystemCapability.MiscServices.InputMethodFramework" + system_capability_headers = [ + "./include/inputmethod_controller_capi.h", + "./include/inputmethod_attach_options_capi.h", + "./include/inputmethod_cursor_info_capi.h", + "./include/inputmethod_inputmethod_proxy_capi.h", + "./include/inputmethod_private_command_capi.h", + "./include/inputmethod_text_avoid_info_capi.h", + "./include/inputmethod_text_config_capi.h", + "./include/inputmethod_text_editor_proxy_capi.h", + "./include/inputmethod_types_capi.h", + ] +} + +ohos_ndk_headers("libohinputmethod_header") { + dest_dir = "$ndk_headers_out_dir/inputmethod" + sources = [ + "./include/inputmethod_attach_options_capi.h", + "./include/inputmethod_controller_capi.h", + "./include/inputmethod_cursor_info_capi.h", + "./include/inputmethod_inputmethod_proxy_capi.h", + "./include/inputmethod_private_command_capi.h", + "./include/inputmethod_text_avoid_info_capi.h", + "./include/inputmethod_text_config_capi.h", + "./include/inputmethod_text_editor_proxy_capi.h", + "./include/inputmethod_types_capi.h", + ] +} diff --git a/inputmethod/include/inputmethod_attach_options_capi.h b/inputmethod/include/inputmethod_attach_options_capi.h new file mode 100644 index 000000000..0519caa3c --- /dev/null +++ b/inputmethod/include/inputmethod_attach_options_capi.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H +#define OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H +#include "inputmethod_types_capi.h" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +/** + * @brief Define the InputMethod_AttachOptions structure type. + * + * The options when attaching input method. + * + * @since 12 + */ +typedef struct InputMethod_AttachOptions InputMethod_AttachOptions; + +/** + * @brief Create a new {@link InputMethod_AttachOptions} instance. + * + * @param showKeyboard Represents whether to show the keyboard. + * @return Returns a pointer to the newly created {@link InputMethod_AttachOptions} instance. + * @since 12 + */ +InputMethod_AttachOptions *OH_AttachOptions_New(bool showKeyboard); +/** + * @brief Delete a {@link InputMethod_AttachOptions} instance. + * + * @param options Represents a pointer to an {@link InputMethod_AttachOptions} instance which will be deleted. + * @since 12 + */ +void OH_AttachOptions_Delete(InputMethod_AttachOptions *options); +/** + * @brief Get showKeyboard value from {@link InputMethod_AttachOptions}. + * + * @param options Represents a pointer to an {@link InputMethod_AttachOptions} instance which will be get value from. + * @param showKeyboard Represents showKeyboard value. + * true - need to show keyboard. + * false - no need to show keyboard. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_AttachOptions_IsShowKeyboard(InputMethod_AttachOptions *options, bool *showKeyboard); +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif // OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_controller_capi.h b/inputmethod/include/inputmethod_controller_capi.h new file mode 100644 index 000000000..230c7ffd4 --- /dev/null +++ b/inputmethod/include/inputmethod_controller_capi.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_INPUTMETHOD_CONTROLLER_CAPI_H +#define OHOS_INPUTMETHOD_CONTROLLER_CAPI_H +/** + * @addtogroup InputMethod + * @{ + * + * @brief InputMethod provides functions to use input methods and develop input methods. + * + * @since 12 + */ + +/** + * @file inputmethod_controller_capi.h + * + * @brief Provides the functions for using input method. + * + * @library libohinputmethod.so + * @kit IMEKit + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 12 + * @version 1.0 + */ + +#include +#include + +#include "inputmethod_text_editor_proxy_capi.h" +#include "inputmethod_inputmethod_proxy_capi.h" +#include "inputmethod_attach_options_capi.h" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +/** + * @brief Attach application to the input method service. + * + * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance. + * The caller needs to manage the lifecycle of textEditorProxy. + * If the call succeeds, caller cannot release textEditorProxy until the next attach or detach call. + * @param options Represents a pointer to an {@link InputMethod_AttachOptions} instance. + * The options when attaching input method. + * @param inputMethodProxy Represents a pointer to an {@link OH_InputMethod_InputMethodProxy} instance. + * Lifecycle is mantianed until the next attach or detach call. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_PARAMCHECK} - The error code for common invalid args. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_InputMethodController_Attach(InputMethod_TextEditorProxy *textEditorProxy, + InputMethod_AttachOptions *options, InputMethod_InputMethodProxy **inputMethodProxy); + +/** + * @brief Detach application from the input method service. + * + * @param inputMethodProxy Represents a pointer to an {@link OH_InputMethod_InputMethodProxy} instance. + * The inputMethodProxy is obtained from {@link OH_InputMethodController_Attach}. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_PARAMCHECK} - The error code for common invalid args. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_InputMethodController_Detach(InputMethod_InputMethodProxy *inputMethodProxy); +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif // OHOS_INPUTMETHOD_CONTROLLER_CAPI_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_cursor_info_capi.h b/inputmethod/include/inputmethod_cursor_info_capi.h new file mode 100644 index 000000000..b456c5d0f --- /dev/null +++ b/inputmethod/include/inputmethod_cursor_info_capi.h @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2024 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +#ifndef OHOS_INPUTMETHOD_CURSOR_INFO_CAPI_H +#define OHOS_INPUTMETHOD_CURSOR_INFO_CAPI_H +#include "inputmethod_types_capi.h" +#ifdef __cplusplus +extern "C"{ +#endif /* __cplusplus */ +/** + * @brief Define the InputMethod_CursorInfo structure type. + * + * The coordinates and width and height information of the cursor. + * + * @since 12 + */ +typedef struct InputMethod_CursorInfo InputMethod_CursorInfo; + +/** + * @brief Create a new {@link InputMethod_CursorInfo} instance. + * + * @param left The left point of the cursor and must be absolute coordinate of the physical screen. + * @param top The top point of the cursor and must be absolute coordinate of the physical screen. + * @param width The width of the cursor. + * @param height The height of the cursor. + * @return Returns a pointer to the newly created {@link InputMethod_CursorInfo} instance. + * @since 12 + */ +InputMethod_CursorInfo *OH_CursorInfo_New(double left, double top, double width, double height); + +/** + * @brief Delete a {@link InputMethod_CursorInfo} instance. + * + * @param cursorInfo Represents a pointer to an {@link InputMethod_CursorInfo} instance which will be deleted. + * @since 12 + */ +void OH_CursorInfo_Delete(InputMethod_CursorInfo *cursorInfo); + +/** + * @brief Set cursor info. + * + * @param cursorInfo Represents a pointer to an {@link InputMethod_CursorInfo} instance. + * @param left The left point of the cursor and must be absolute coordinate of the physical screen. + * @param top The top point of the cursor and must be absolute coordinate of the physical screen. + * @param width The width of the cursor. + * @param height The height of the cursor. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_CursorInfo_SetRect( + InputMethod_CursorInfo *cursorInfo, double left, double top, double width, double height); + +/** + * @brief Get cursor info. + * + * @param cursorInfo Represents a pointer to an {@link InputMethod_CursorInfo} instance. + * @param left The left point of the cursor and must be absolute coordinate of the physical screen. + * @param top The top point of the cursor and must be absolute coordinate of the physical screen. + * @param width The width of the cursor. + * @param height The height of the cursor. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_CursorInfo_GetRect( + InputMethod_CursorInfo *cursorInfo, double *left, double *top, double *width, double *height); +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif // OHOS_INPUTMETHOD_CURSOR_INFO_CAPI_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h new file mode 100644 index 000000000..2a2e85ba9 --- /dev/null +++ b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h @@ -0,0 +1,136 @@ +/* +* Copyright (c) 2024 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +#ifndef OHOS_INPUTMETHOD_INPUTMETHOD_PROXY_CAPI_H +#define OHOS_INPUTMETHOD_INPUTMETHOD_PROXY_CAPI_H +#include + +#include "inputmethod_types_capi.h" +#include "inputmethod_cursor_info_capi.h" +#include "inputmethod_private_command_capi.h" +#ifdef __cplusplus +extern "C"{ +#endif /* __cplusplus */ +/** + * @brief Define the InputMethod_InputMethodProxy structure type. + * + * Provides methods for controlling input method. + * + * @since 12 + */ +typedef struct InputMethod_InputMethodProxy InputMethod_InputMethodProxy; + +/** + * @brief Show keyboard. + * + * @param inputMethodProxy Represents a pointer to an {@link InputMethod_InputMethodProxy} instance. + * The inputMethodProxy is obtained from {@link OH_InputMethodController_Attach}. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_DETACHED} - input method client is detached. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_InputMethodProxy_ShowKeyboard(InputMethod_InputMethodProxy *inputMethodProxy); + +/** + * @brief Hide keyboard. + * + * @param inputMethodProxy Represents a pointer to an {@link InputMethod_InputMethodProxy} instance. + * The inputMethodProxy is obtained from {@link OH_InputMethodController_Attach}. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_DETACHED} - input method client is detached. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_InputMethodProxy_HideKeyboard(InputMethod_InputMethodProxy *inputMethodProxy); + +/** + * @brief Notify selection change. + * + * Notify selection change when text or cursor position or selected text changed. + * + * @param inputMethodProxy Represents a pointer to an {@link InputMethod_InputMethodProxy} instance. + * The inputMethodProxy is obtained from {@link OH_InputMethodController_Attach}. + * @param text The whole input text. + * @param length The length of text. Max 8K bytes. + * @param start The start position of selected text. + * @param end The end position of selected text. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_DETACHED} - input method client is detached. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_InputMethodProxy_NotifySelectionChange( + InputMethod_InputMethodProxy *inputMethodProxy, char16_t text[], size_t length, int start, int end); + +/** + * @brief Notify text editor configuration change. + * + * @param inputMethodProxy Represents a pointer to an {@link InputMethod_InputMethodProxy} instance. + * The inputMethodProxy is obtained from {@link OH_InputMethodController_Attach}. + * @param enterKey The enter key type. + * @param textType The text input type. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_DETACHED} - input method client is detached. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_InputMethodProxy_NotifyConfigurationChange(InputMethod_InputMethodProxy *inputMethodProxy, + InputMethod_EnterKeyType enterKey, InputMethod_TextInputType textType); + +/** + * @brief Notify cursor update. + * + * @param inputMethodProxy Represents a pointer to an {@link InputMethod_InputMethodProxy} instance. + * The inputMethodProxy is obtained from {@link OH_InputMethodController_Attach}. + * @param cursorInfo Represents a pointer to an {@link InputMethod_CursorInfo} instance. + * The cursor information. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_DETACHED} - input method client is detached. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_InputMethodProxy_NotifyCursorUpdate( + InputMethod_InputMethodProxy *inputMethodProxy, InputMethod_CursorInfo *cursorInfo); + +/** + * @brief Send private command. + * + * @param inputMethodProxy Represents a pointer to an {@link OH_InputMethod_InputMethodProxy} instance. + * The inputMethodProxy is obtained from {@link OH_InputMethodController_Attach}. + * @param privateCommand The private commands, which is defined in {@link InputMethod_PrivateCommand}. Max size 32KB. + * @param size The size of privateCommand. Max is 5. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_PARAMCHECK} - parameter check failed. + * {@link IME_ERR_DETACHED} - input method client is detached. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_InputMethodProxy_SendPrivateCommand(InputMethod_PrivateCommand *privateCommand[], size_t size); +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif // INPUTMETHOD_INPUTMETHOD_PROXY_CAP_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_private_command_capi.h b/inputmethod/include/inputmethod_private_command_capi.h new file mode 100644 index 000000000..c056589c7 --- /dev/null +++ b/inputmethod/include/inputmethod_private_command_capi.h @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef OHOS_INPUTMETHOD_PRIVATE_COMMAND_CAPI_H +#define OHOS_INPUTMETHOD_PRIVATE_COMMAND_CAPI_H +#include +#include + +#include "inputmethod_types_capi.h" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +/** + * @brief Define the InputMethod_PrivateCommand structure type. + * + * The private command between text editor and input method. + * + * @since 12 + */ +typedef struct InputMethod_PrivateCommand InputMethod_PrivateCommand; + +/** + * @brief Create a new {@link InputMethod_PrivateCommand} instance. + * + * @param key The key of the private command. + * @param keyLength The length of the key. + * @return Returns a pointer to the newly created {@link InputMethod_PrivateCommand} instance. + * @since 12 + */ +InputMethod_PrivateCommand *OH_PrivateCommand_New(char key[], size_t keyLength); +/** + * @brief Delete a {@link InputMethod_PrivateCommand} instance. + * + * @param command Represents a pointer to an {@link InputMethod_PrivateCommand} instance which will be deleted. + * @since 12 + */ +void OH_PrivateCommand_Delete(InputMethod_PrivateCommand *command); +/** + * @brief Set key value into {@link InputMethod_PrivateCommand}. + * + * @param command Represents a pointer to an {@link InputMethod_PrivateCommand} instance which will be set value. + * @param key Represents key value. + * @param keyLength Represents key length. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_PrivateCommand_SetKey(InputMethod_PrivateCommand *command, char key[], size_t keyLength); +/** + * @brief Set bool data value into {@link InputMethod_PrivateCommand}. + * + * @param command Represents a pointer to an {@link InputMethod_PrivateCommand} instance which will be set value. + * @param value Represents bool data value. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_PrivateCommand_SetBoolValue(InputMethod_PrivateCommand *command, bool value); +/** + * @brief Set integer data value into {@link InputMethod_PrivateCommand}. + * + * @param command Represents a pointer to an {@link InputMethod_PrivateCommand} instance which will be set value. + * @param value Represents integer data value. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_PrivateCommand_SetIntValue(InputMethod_PrivateCommand *command, int32_t value); +/** + * @brief Set string data value into {@link InputMethod_PrivateCommand}. + * + * @param command Represents a pointer to an {@link InputMethod_PrivateCommand} instance which will be set value. + * @param value Represents string data value. + * @param valueLength Represents the length of string data value. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_PrivateCommand_SetStrValue( + InputMethod_PrivateCommand *command, char value[], size_t valueLength); + +/** + * @brief Get key value from {@link InputMethod_PrivateCommand}. + * + * @param command Represents a pointer to an {@link InputMethod_PrivateCommand} instance which will be get value from. + * @param key Represents key value. + * @param keyLength Represents key length. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_PrivateCommand_GetKey( + InputMethod_PrivateCommand *command, const char **key, size_t *keyLength); +/** + * @brief Get value type from {@link InputMethod_PrivateCommand}. + * + * @param command Represents a pointer to an {@link InputMethod_PrivateCommand} instance which will be get value from. + * @param type Represents a pointer to a {@link InputMethod_CommandValueType} instance. Indicates the data type of the + * value. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_PrivateCommand_GetValueType( + InputMethod_PrivateCommand *command, InputMethod_CommandValueType *type); +/** + * @brief Get bool data value from {@link InputMethod_PrivateCommand}. + * + * @param command Represents a pointer to an {@link InputMethod_PrivateCommand} instance which will be get value from. + * @param value Represents bool data value. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_PrivateCommand_GetBoolValue(InputMethod_PrivateCommand *command, bool *value); +/** + * @brief Get integer data value from {@link InputMethod_PrivateCommand}. + * + * @param command Represents a pointer to an {@link InputMethod_PrivateCommand} instance which will be get value from. + * @param value Represents integer data value. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_PrivateCommand_GetIntValue(InputMethod_PrivateCommand *command, int32_t *value); +/** + * @brief Get string data value from {@link InputMethod_PrivateCommand}. + * + * @param command Represents a pointer to an {@link InputMethod_PrivateCommand} instance which will be get value from. + * @param value Represents string data value. + * @param valueLength Represents the length of string data value. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_PrivateCommand_GetStrValue( + InputMethod_PrivateCommand *command, const char **value, size_t *valueLength); +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif // OHOS_INPUTMETHOD_PRIVATE_COMMAND_CAPI_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_text_avoid_info_capi.h b/inputmethod/include/inputmethod_text_avoid_info_capi.h new file mode 100644 index 000000000..02b451626 --- /dev/null +++ b/inputmethod/include/inputmethod_text_avoid_info_capi.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef OHOS_INPUTMETHOD_TEXT_AVOID_INFO_CAPI_H +#define OHOS_INPUTMETHOD_TEXT_AVOID_INFO_CAPI_H +#include "inputmethod_types_capi.h" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @brief Define the InputMethod_TextAvoidInfo structure type. + * + * Information for text editor to avoid the keyboard. + * + * @since 12 + */ +typedef struct InputMethod_TextAvoidInfo InputMethod_TextAvoidInfo; + +/** + * @brief Create a new {@link InputMethod_TextAvoidInfo} instance. + * + * @param positionY The y-coordinate of the avoid area. + * @param height The height of the avoid area. + * @return Returns a pointer to the newly created {@link InputMethod_TextAvoidInfo} instance. + * @since 12 + */ +InputMethod_TextAvoidInfo *OH_TextAvoidInfo_New(double positionY, double height); +/** + * @brief Delete a {@link InputMethod_TextAvoidInfo} instance. + * + * @param options Represents a pointer to an {@link InputMethod_TextAvoidInfo} instance which will be deleted. + * @since 12 + */ +void OH_TextAvoidInfo_Delete(InputMethod_TextAvoidInfo *info); +/** + * @brief Set positionY value into {@link InputMethod_TextAvoidInfo}. + * + * @param info Represents a pointer to an {@link InputMethod_TextAvoidInfo} instance which will be set value. + * @param positionY Represents positionY value. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextAvoidInfo_SetPositionY(InputMethod_TextAvoidInfo *info, double positionY); +/** + * @brief Set height value into {@link InputMethod_TextAvoidInfo}. + * + * @param info Represents a pointer to an {@link InputMethod_TextAvoidInfo} instance which will be set value. + * @param height Represents height value. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextAvoidInfo_SetHeight(InputMethod_TextAvoidInfo *info, double height); +/** + * @brief Get positionY value from {@link InputMethod_TextAvoidInfo}. + * + * @param info Represents a pointer to an {@link InputMethod_TextAvoidInfo} instance which will be get value from. + * @param positionY Represents positionY value. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextAvoidInfo_GetPositionY(InputMethod_TextAvoidInfo *info, double *positionY); +/** + * @brief Get height value into {@link InputMethod_TextAvoidInfo}. + * + * @param info Represents a pointer to an {@link InputMethod_TextAvoidInfo} instance which will be get value from. + * @param height Represents height value. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextAvoidInfo_GetHeight(InputMethod_TextAvoidInfo *info, double *height); +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif // OHOS_INPUTMETHOD_TEXT_AVOID_INFO_CAP_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h new file mode 100644 index 000000000..8a6bfbf9d --- /dev/null +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef OHOS_INPUTMETHOD_TEXT_CONFIG_CAPI_H +#define OHOS_INPUTMETHOD_TEXT_CONFIG_CAPI_H +#include + +#include "inputmethod_cursor_info_capi.h" +#include "inputmethod_text_avoid_info_capi.h" +#include "inputmethod_types_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +/** + * @brief Define the InputMethod_TextConfig structure type. + * + * The configuration of the text editor. + * + * @since 12 + */ +typedef struct InputMethod_TextConfig InputMethod_TextConfig; + +/** + * @brief Create a new {@link InputMethod_TextConfig} instance. + * + * @return Returns a pointer to the newly created {@link InputMethod_TextConfig} instance. + * @since 12 + */ +InputMethod_TextConfig *OH_TextConfig_New(); +/** + * @brief Delete a {@link InputMethod_TextConfig} instance. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be deleted. + * @since 12 + */ +void OH_TextConfig_Delete(InputMethod_TextConfig *config); + +/** + * @brief Set input type into TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. + * @param inputType The text input type of text Editor, which is defined in {@link InputMethod_TextInputType}. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextConfig_SetInputType(InputMethod_TextConfig *config, InputMethod_TextInputType inputType); +/** + * @brief Set enter key type into TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. + * @param enterKeyType The enter key type of text Editor, which is defined in {@link InputMethod_EnterKeyType}. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextConfig_SetEnterKeyType( + InputMethod_TextConfig *config, InputMethod_EnterKeyType enterKeyType); +/** + * @brief Set is preview text supported into TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. + * @param supported Indicates whether the preview text is supported. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextConfig_SetIsPreviewTextSupported(InputMethod_TextConfig *config, bool supported); +/** + * @brief Set selection into TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. + * @param start The start position of selection. + * @param end The end position of selection. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextConfig_SetSelection(InputMethod_TextConfig *config, int32_t start, int32_t end); +/** + * @brief Set window id into TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. + * @param windowId The window ID of the application currently bound to the input method. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextConfig_SetWindowId(InputMethod_TextConfig *config, int32_t windowId); + +/** + * @brief Get input type from TextConfig + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be get from. + * @param inputType Represents a pointer to an {@link InputMethod_TextInputType} instance. + * The text input type of text Editor + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextConfig_GetInputType(InputMethod_TextConfig *config, InputMethod_TextInputType *inputType); +/** + * @brief Get enter key type from TextConfig + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be get from. + * @param enterKeyType Represents a pointer to an {@link InputMethod_EnterKeyType} instance. + * Indicates the enter key type of text Editor + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextConfig_GetEnterKeyType( + InputMethod_TextConfig *config, InputMethod_EnterKeyType *enterKeyType); +/** + * @brief Get is preview text supported from TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be get from. + * @param supported Indicates whether the preview text is supported. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextConfig_IsPreviewTextSupported(InputMethod_TextConfig *config, bool *supported); +/** + * @brief Get cursor info from TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be get from. + * @param cursorInfo Represents a pointer to an {@link InputMethod_CursorInfo} instance. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextConfig_GetCursorInfo(InputMethod_TextConfig *config, InputMethod_CursorInfo **cursorInfo); + +/** + * @brief Get text avoid information from text configuration. + * + * @param config Indicates the text configuration. + * @param avoidInfo Indicates the text avoid information. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + *@since 12 + */ +InputMethod_ErrorCode OH_TextConfig_GetTextAvoidInfo( + InputMethod_TextConfig *config, InputMethod_TextAvoidInfo **avoidInfo); + +/** + * @brief Get selection from TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be get from. + * @param start Represents selection start position. + * @param end Represents selection end position. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextConfig_GetSelection(InputMethod_TextConfig *config, int32_t *start, int32_t *end); +/** + * @brief Get window id from TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be get from. + * @param windowId The window ID of the application currently bound to the input method. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextConfig_GetWindowId(InputMethod_TextConfig *config, int32_t *windowId); +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif // OHOS_INPUTMETHOD_TEXT_CONFIG_CAPI_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_text_editor_proxy_capi.h b/inputmethod/include/inputmethod_text_editor_proxy_capi.h new file mode 100644 index 000000000..e76116940 --- /dev/null +++ b/inputmethod/include/inputmethod_text_editor_proxy_capi.h @@ -0,0 +1,680 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef OHOS_INPUTMETHOD_TEXT_EDITOR_PROXY_CAPI_H +#define OHOS_INPUTMETHOD_TEXT_EDITOR_PROXY_CAPI_H +#include + +#include "inputmethod_private_command_capi.h" +#include "inputmethod_text_config_capi.h" +#include "inputmethod_types_capi.h" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +/** + * @brief Define the InputMethod_TextEditorProxy structure type. + * + * Provides methods for getting requests and notifications from input method.\n + * When input method sends request or notification to editor, the methods will be called.\n + * + * @since 12 + */ +typedef struct InputMethod_TextEditorProxy InputMethod_TextEditorProxy; + +/** + * @brief Defines the function called when input method getting text config. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetGetTextConfigFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance. + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance. + * @since 12 + */ +typedef void (*OH_TextEditorProxy_GetTextConfigFunc)( + InputMethod_TextEditorProxy *textEditorProxy, InputMethod_TextConfig *config); +/** + * @brief Defines the function called when input method inserting text. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetInsertTextFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to the {@link InputMethod_TextEditorProxy} instance which will be set + * in. + * @param text Represents a pointer to the text to be inserted. + * @param length Represents the length of the text to be inserted. + * @since 12 + */ +typedef void (*OH_TextEditorProxy_InsertTextFunc)( + InputMethod_TextEditorProxy *textEditorProxy, const char16_t *text, size_t length); +/** + * @brief Defines the function called when input method deleting text forward. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetDeleteForwardFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to the {@link InputMethod_TextEditorProxy} instance which will be set + * in. + * @param length Represents the length of the text to be deleted. + * @since 12 + */ +typedef void (*OH_TextEditorProxy_DeleteForwardFunc)(InputMethod_TextEditorProxy *textEditorProxy, int32_t length); +/** + * @brief Defines the function called when input method deleting text backward. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetDeleteForwardFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to the {@link InputMethod_TextEditorProxy} instance which will be set + * in. + * @param length Represents the length of the text to be deleted. + * @since 12 + */ +typedef void (*OH_TextEditorProxy_DeleteBackwardFunc)(InputMethod_TextEditorProxy *textEditorProxy, int32_t length); +/** + * @brief Called when input method notifying keyboard status. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetSendKeyboardStatusFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. + * @param keyboardStatus Keyboard status, which is defined in {@link InputMethod_KeyboardStatus}. + * @since 12 + */ +typedef void (*OH_TextEditorProxy_SendKeyboardStatusFunc)( + InputMethod_TextEditorProxy *textEditorProxy, InputMethod_KeyboardStatus keyboardStatus); +/** + * @brief Called when input method sending enter key. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetSendEnterKeyFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. + * @param enterKeyType Enter key type, which is defined in {@link InputMethod_EnterKeyType}. + * @since 12 + */ +typedef void (*OH_TextEditorProxy_SendEnterKeyFunc)( + InputMethod_TextEditorProxy *textEditorProxy, InputMethod_EnterKeyType enterKeyType); +/** + * @brief Called when input method requesting to move cursor. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetMoveCursorFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. + * @param direction Represents the direction of the cursor movement, which is defined in {@link InputMethod_Direction}. + * @since 12 + */ +typedef void (*OH_TextEditorProxy_MoveCursorFunc)( + InputMethod_TextEditorProxy *textEditorProxy, InputMethod_Direction direction); +/** + * @brief Called when input method requesting to set selection. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetHandleSetSelectionFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. + * @param start Represents the start position of the selection. + * @param end Represents the end position of the selection. + * @since 12 + */ +typedef void (*OH_TextEditorProxy_HandleSetSelectionFunc)( + InputMethod_TextEditorProxy *textEditorProxy, int32_t start, int32_t end); +/** + * @brief Called when input method sending extend action. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetHandleExtendActionFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. + * @param action Represents the extend action, which is defined in {@link InputMethod_ExtendAction}. + * @since 12 + */ +typedef void (*OH_TextEditorProxy_HandleExtendActionFunc)( + InputMethod_TextEditorProxy *textEditorProxy, InputMethod_ExtendAction action); +/** + * @brief Called when input method requesting to get left text of cursor. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetGetLeftTextOfCursorFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. + * @param number Represents the number of characters to be get. + * @param text Represents the left text of cursor, you need to assing this parameter. + * @param length Represents the length of the left text of cursor, you need to assing this parameter. + * @since 12 + */ +typedef void (*OH_TextEditorProxy_GetLeftTextOfCursorFunc)( + InputMethod_TextEditorProxy *textEditorProxy, int32_t number, char16_t text[], size_t *length); +/** + * @brief Called when input method requesting to get right text of cursor. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetGetRightTextOfCursorFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. + * @param number Represents the number of characters to be get. + * @param text Represents the right text of cursor, you need to assing this parameter. + * @param length Represents the length of the right text of cursor. + * @since 12 + */ +typedef void (*OH_TextEditorProxy_GetRightTextOfCursorFunc)( + InputMethod_TextEditorProxy *textEditorProxy, int32_t number, char16_t text[], size_t *length); +/** + * @brief Called when input method requesting to get text index at cursor. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetGetTextIndexAtCursorFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. + * @return Returns the index of text at cursor. + * @since 12 + */ +typedef int32_t (*OH_TextEditorProxy_GetTextIndexAtCursorFunc)(InputMethod_TextEditorProxy *textEditorProxy); +/** + * @brief Called when input method sending private command. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetReceivePrivateCommandFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. + * @param privateCommand Private command from input method. + * @param size Size of private command. + * @return Returns the result of handling private command. + * @since 12 + */ +typedef int32_t (*OH_TextEditorProxy_ReceivePrivateCommandFunc)( + InputMethod_TextEditorProxy *textEditorProxy, InputMethod_PrivateCommand *privateCommand[], size_t size); +/** + * @brief Called when input method setting preview text. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetReceivePrivateCommandFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. + * @param text Represents text to be previewd. + * @param length Length of preview text. + * @param start Start position of preview text. + * @param end End position of preview text. + * @return Returns the result of setting preview text. + * @since 12 + */ +typedef int32_t (*OH_TextEditorProxy_SetPreviewTextFunc)( + InputMethod_TextEditorProxy *textEditorProxy, const char16_t text[], size_t length, int32_t start, int32_t end); +/** + * @brief Called when input method finishing preview text. + * + * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link + * OH_TextEditorProxy_SetReceivePrivateCommandFunc}, and use {@link OH_InputMethodController_Attach} to complete the + * registration.\n + * + * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. + * @since 12 + */ +typedef void (*OH_TextEditorProxy_FinishTextPreviewFunc)(InputMethod_TextEditorProxy *textEditorProxy); + +/** + * @brief Create a new {@link InputMethod_TextEditorProxy} instance. + * + * @return Returns a pointer to the newly created {@link InputMethod_TextEditorProxy} instance. + * @since 12 + */ +InputMethod_TextEditorProxy *OH_TextEditorProxy_New(); +/** + * @brief Delete a {@link InputMethod_TextEditorProxy} instance. + * + * @param proxy The {@link InputMethod_TextEditorProxy} instance to be deleted. + * @since 12 + */ +void OH_TextEditorProxy_Delete(InputMethod_TextEditorProxy *proxy); +/** + * @brief Set function {@link OH_TextEditorProxy_GetTextConfigFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param getTextConfigFunc Represents function {@link OH_TextEditorProxy_GetTextConfigFunc} which will be set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextConfigFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextConfigFunc getTextConfigFunc); +/** + * @brief Set function {@link OH_TextEditorProxy_InsertTextFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param insertTextFunc Represents function {@link OH_TextEditorProxy_InsertTextFunc} which will be set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetInsertTextFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_InsertTextFunc insertTextFunc); +/** + * @brief Set function {@link OH_TextEditorProxy_SetDeleteForwardFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param deleteForwardFunc Represents function {@link OH_TextEditorProxy_DeleteForwardFunc} which will be set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteForwardFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteForwardFunc deleteForwardFunc); +/** + * @brief Set function {@link OH_TextEditorProxy_DeleteBackwardFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param deleteBackwardFunc Represents function {@link OH_TextEditorProxy_DeleteBackwardFunc} which will be set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteBackwardFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteBackwardFunc deleteBackwardFunc); +/** + * @brief Set function {@link OH_TextEditorProxy_SendKeyboardStatusFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param sendKeyboardStatusFunc Represents function {@link OH_TextEditorProxy_SendKeyboardStatusFunc} which will be + * set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetSendKeyboardStatusFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendKeyboardStatusFunc sendKeyboardStatusFunc); +/** + * @brief Set function {@link OH_TextEditorProxy_SendEnterKeyFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param sendEnterKeyFunc Represents function {@link OH_TextEditorProxy_SendEnterKeyFunc} which will be set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetSendEnterKeyFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendEnterKeyFunc sendEnterKeyFunc); +/** + * @brief Set function {@link OH_TextEditorProxy_MoveCursorFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param moveCursorFunc Represents function {@link OH_TextEditorProxy_MoveCursorFunc} which will be set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetMoveCursorFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_MoveCursorFunc moveCursorFunc); +/** + * @brief Set function {@link OH_TextEditorProxy_HandleSetSelectionFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param handleSetSelectionFunc Represents function {@link OH_TextEditorProxy_HandleSetSelectionFunc} which will be + * set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetHandleSetSelectionFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleSetSelectionFunc handleSetSelectionFunc); +/** + * @brief Set function {@link OH_TextEditorProxy_HandleExtendActionFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param handleExtendActionFunc Represents function {@link OH_TextEditorProxy_HandleExtendActionFunc} which will be + * set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetHandleExtendActionFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleExtendActionFunc handleExtendActionFunc); +/** + * @brief Set function {@link OH_TextEditorProxy_GetLeftTextOfCursorFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param getLeftTextOfCursorFunc Represents function {@link OH_TextEditorProxy_GetLeftTextOfCursorFunc} which will + * be set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetGetLeftTextOfCursorFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetLeftTextOfCursorFunc getLeftTextOfCursorFunc); +/** + * @brief Set function {@link OH_TextEditorProxy_GetRightTextOfCursorFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param getRightTextOfCursorFunc Represents function {@link OH_TextEditorProxy_GetRightTextOfCursorFunc} which + * will be set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetGetRightTextOfCursorFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetRightTextOfCursorFunc getRightTextOfCursorFunc); +/** + * @brief Set function {@link OH_TextEditorProxy_GetTextIndexAtCursorFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param getTextIndexAtCursorFunc Represents function {@link OH_TextEditorProxy_GetTextIndexAtCursorFunc} which + * will be set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextIndexAtCursorFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextIndexAtCursorFunc getTextIndexAtCursorFunc); +/** + * @brief Set function {@link OH_TextEditorProxy_ReceivePrivateCommandFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param receivePrivateCommandFunc Represents function {@link OH_TextEditorProxy_ReceivePrivateCommandFunc} which + * will be set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetReceivePrivateCommandFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_ReceivePrivateCommandFunc receivePrivateCommandFunc); +/** + * @brief Set function {@link OH_TextEditorProxy_SetPreviewTextFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param setPreviewTextFunc Represents function {@link OH_TextEditorProxy_SetPreviewTextFunc} which will be set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetSetPreviewTextFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SetPreviewTextFunc setPreviewTextFunc); +/** + * @brief Set function {@link OH_TextEditorProxy_FinishTextPreviewFunc} into {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. + * @param finishTextPreviewFunc Represents function {@link OH_TextEditorProxy_FinishTextPreviewFunc} which will be + * set. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_SetFinishTextPreviewFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_FinishTextPreviewFunc finishTextPreviewFunc); + +/** + * @brief Get function {@link OH_TextEditorProxy_GetTextConfigFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param getTextConfigFunc Represents function {@link OH_TextEditorProxy_GetTextConfigFunc} which will be get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextConfigFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextConfigFunc *getTextConfigFunc); +/** + * @brief Get function {@link OH_TextEditorProxy_InsertTextFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param insertTextFunc Represents function {@link OH_TextEditorProxy_InsertTextFunc} which will be get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetInsertTextFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_InsertTextFunc *insertTextFunc); +/** + * @brief Get function {@link OH_TextEditorProxy_DeleteForwardFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param deleteForwardFunc Represents function {@link OH_TextEditorProxy_DeleteForwardFunc} which will be get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteForwardFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteForwardFunc *deleteForwardFunc); +/** + * @brief Get function {@link OH_TextEditorProxy_DeleteBackwardFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param deleteBackwardFunc Represents function {@link OH_TextEditorProxy_DeleteBackwardFunc} which will be get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteBackwardFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteBackwardFunc *deleteBackwardFunc); +/** + * @brief Get function {@link OH_TextEditorProxy_SendKeyboardStatusFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param sendKeyboardStatusFunc Represents function {@link OH_TextEditorProxy_SendKeyboardStatusFunc} which will be + * get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetSendKeyboardStatusFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendKeyboardStatusFunc *sendKeyboardStatusFunc); +/** + * @brief Get function {@link OH_TextEditorProxy_SendEnterKeyFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param sendEnterKeyFunc Represents function {@link OH_TextEditorProxy_SendEnterKeyFunc} which will be get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetSendEnterKeyFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendEnterKeyFunc *sendEnterKeyFunc); +/** + * @brief Get function {@link OH_TextEditorProxy_MoveCursorFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param moveCursorFunc Represents function {@link OH_TextEditorProxy_MoveCursorFunc} which will be get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetMoveCursorFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_MoveCursorFunc *moveCursorFunc); +/** + * @brief Get function {@link OH_TextEditorProxy_HandleSetSelectionFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param handleSetSelectionFunc Represents function {@link OH_TextEditorProxy_HandleSetSelectionFunc} which will be + * get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetHandleSetSelectionFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleSetSelectionFunc *handleSetSelectionFunc); +/** + * @brief Get function {@link OH_TextEditorProxy_HandleExtendActionFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param handleExtendActionFunc Represents function {@link OH_TextEditorProxy_HandleExtendActionFunc} which will be + * get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetHandleExtendActionFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleExtendActionFunc *handleExtendActionFunc); +/** + * @brief Get function {@link OH_TextEditorProxy_GetLeftTextOfCursorFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param getLeftTextOfCursorFunc Represents function {@link OH_TextEditorProxy_GetLeftTextOfCursorFunc} which will + * be get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetGetLeftTextOfCursorFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetLeftTextOfCursorFunc *getLeftTextOfCursorFunc); +/** + * @brief Get function {@link OH_TextEditorProxy_GetRightTextOfCursorFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param getRightTextOfCursorFunc Represents function {@link OH_TextEditorProxy_GetRightTextOfCursorFunc} which + * will be get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetGetRightTextOfCursorFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetRightTextOfCursorFunc *getRightTextOfCursorFunc); +/** + * @brief Get function {@link OH_TextEditorProxy_GetTextIndexAtCursorFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param getTextIndexAtCursorFunc Represents function {@link OH_TextEditorProxy_GetTextIndexAtCursorFunc} which + * will be get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextIndexAtCursorFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextIndexAtCursorFunc *getTextIndexAtCursorFunc); +/** + * @brief Get function {@link OH_TextEditorProxy_ReceivePrivateCommandFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param receivePrivateCommandFunc Represents function {@link OH_TextEditorProxy_ReceivePrivateCommandFunc} which + * will be get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetReceivePrivateCommandFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_ReceivePrivateCommandFunc *receivePrivateCommandFunc); +/** + * @brief Get function {@link OH_TextEditorProxy_SetPreviewTextFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param setPreviewTextFunc Represents function {@link OH_TextEditorProxy_SetPreviewTextFunc} which will be get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetSetPreviewTextFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SetPreviewTextFunc *setPreviewTextFunc); +/** + * @brief Get function {@link OH_TextEditorProxy_FinishTextPreviewFunc} from {@link InputMethod_TextEditorProxy}. + * + * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function + * from. + * @param finishTextPreviewFunc Represents function {@link OH_TextEditorProxy_FinishTextPreviewFunc} which will be + * get. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 12 + */ +InputMethod_ErrorCode OH_TextEditorProxy_GetFinishTextPreviewFunc( + InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_FinishTextPreviewFunc *finishTextPreviewFunc); +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif // OHOS_INPUTMETHOD_TEXT_EDITOR_PROXY_CAP_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_types_capi.h b/inputmethod/include/inputmethod_types_capi.h new file mode 100644 index 000000000..2cd71d846 --- /dev/null +++ b/inputmethod/include/inputmethod_types_capi.h @@ -0,0 +1,283 @@ +/* +* Copyright (c) 2024 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +#ifndef OHOS_INPUTMETHOD_TYPES_CAPI_H +#define OHOS_INPUTMETHOD_TYPES_CAPI_H +#ifdef __cplusplus +extern "C"{ +#endif /* __cplusplus */ +/** + * @brief Keyboard status. + * + * @since 12 + */ +typedef enum { + /** + * The keyboard status is none. + */ + IME_KEYBOARD_STATUS_NONE = 0, + /** + * The keyboard status is hide. + */ + IME_KEYBOARD_STATUS_HIDE = 1, + /** + * The keyboard status is show. + */ + IME_KEYBOARD_STATUS_SHOW = 2, +} InputMethod_KeyboardStatus; + +/** + * @brief Enter key type. + * + * @since 12 + */ +typedef enum { + /** + * The enter key type is UNSPECIFIED. + */ + IME_ENTER_KEY_UNSPECIFIED = 0, + /** + * The enter key type is NONE. + */ + IME_ENTER_KEY_NONE = 1, + /** + * The enter key type is GO. + */ + IME_ENTER_KEY_GO = 2, + /** + * The enter key type is SEARCH. + */ + IME_ENTER_KEY_SEARCH = 3, + /** + * The enter key type is SEND. + */ + IME_ENTER_KEY_SEND = 4, + /** + * The enter key type is NEXT. + */ + IME_ENTER_KEY_NEXT = 5, + /** + * The enter key type is DONE. + */ + IME_ENTER_KEY_DONE = 6, + /** + * The enter key type is PREVIOUS. + */ + IME_ENTER_KEY_PREVIOUS = 7, + /** + * The enter key type is NEWLINE. + */ + IME_ENTER_KEY_NEWLINE = 8, +} InputMethod_EnterKeyType; + +/** + * @brief Direction. + * + * @since 12 + */ +typedef enum { + /** + * The direction is NONE. + */ + IME_DIRECTION_NONE = 0, + /** + * The direction is UP. + */ + IME_DIRECTION_UP = 1, + /** + * The direction is DOWN. + */ + IME_DIRECTION_DOWN = 2, + /** + * The direction is LEFT. + */ + IME_DIRECTION_LEFT = 3, + /** + * The direction is RIGHT. + */ + IME_DIRECTION_RIGHT = 4, +} InputMethod_Direction; + +/** + * @brief The extend action. + * + * @since 12 + */ +typedef enum { + /** + * Select all text. + */ + IME_EXTEND_ACTION_SELECT_ALL = 0, + /** + * Cut selected text. + */ + IME_EXTEND_ACTION_CUT = 3, + /** + * Copy selected text. + */ + IME_EXTEND_ACTION_COPY = 4, + /** + * Paste from paste board. + */ + IME_EXTEND_ACTION_PASTE = 5, +} InputMethod_ExtendAction; + +/** + * @brief The text input type. + * + * @since 12 + */ +typedef enum { + /** + * The text input type is NONE. + */ + IME_TEXT_INPUT_TYPE_NONE = -1, + /** + * The text input type is TEXT. + */ + IME_TEXT_INPUT_TYPE_TEXT = 0, + /** + * The text input type is MULTILINE. + */ + IME_TEXT_INPUT_TYPE_MULTILINE = 1, + /** + * The text input type is NUMBER. + */ + IME_TEXT_INPUT_TYPE_NUMBER = 2, + /** + * The text input type is PHONE. + */ + IME_TEXT_INPUT_TYPE_PHONE = 3, + /** + * The text input type is DATETIME. + */ + IME_TEXT_INPUT_TYPE_DATETIME = 4, + /** + * The text input type is EMAIL ADDRESS. + */ + IME_TEXT_INPUT_TYPE_EMAIL_ADDRESS = 5, + /** + * The text input type is URL. + */ + IME_TEXT_INPUT_TYPE_URL = 6, + /** + * The text input type is VISIBLE PASSWORD. + */ + IME_TEXT_INPUT_TYPE_VISIBLE_PASSWORD = 7, + /** + * The text input type is NUMBER PASSWORD. + */ + IME_TEXT_INPUT_TYPE_NUMBER_PASSWORD = 8, + /** + * The text input type is SCREEN LOCK PASSWORD. + */ + IME_TEXT_INPUT_TYPE_SCREEN_LOCK_PASSWORD = 9, + /** + * The text input type is USER NAME. + */ + IME_TEXT_INPUT_TYPE_USER_NAME = 10, + /** + * The text input type is NEW PASSWORD. + */ + IME_TEXT_INPUT_TYPE_NEW_PASSWORD = 11, + /** + * The text input type is NUMBER DECIMAL. + */ + IME_TEXT_INPUT_TYPE_NUMBER_DECIMAL = 12, +} InputMethod_TextInputType; + +/** + * @brief The value type of command data. + * + * @since 12 + */ +typedef enum { + /** + * Value type is NONE. + */ + IME_COMMAND_VALUE_TYPE_NONE = 0, + /** + * Value type is STRING. + */ + IME_COMMAND_VALUE_TYPE_STRING = 1, + /** + * Value type is BOOL. + */ + IME_COMMAND_VALUE_TYPE_BOOL = 2, + /** + * Value type is INT32. + */ + IME_COMMAND_VALUE_TYPE_INT32 = 3, +} InputMethod_CommandValueType; + +/** + * @brief The value type of command data. + * + * @since 12 + */ +typedef enum { + /** + * The error code in the correct case. + */ + IME_ERR_OK = 0, + + /** + * The error code when query failed. + */ + IME_ERR_QUERY_FAILED = 1, + /** + * The error code when parameter check failed. + */ + IME_ERR_PARAMCHECK = 401, + /** + * The error code when the package manager error. + */ + IME_ERR_PACKAGEMANAGER = 12800001, + /** + * The error code when input method engine error. + */ + IME_ERR_IMENGINE = 12800002, + /** + * The error code when input method client error. + */ + IME_ERR_IMCLIENT = 12800003, + /** + * The error code when configuration persisting error. + */ + IME_ERR_CONFIG_PERSIST = 12800005, + /** + * The error code when input method controller error. + */ + IME_ERR_CONTROLLER = 12800006, + /** + * The error code when input method setting error. + */ + IME_ERR_SETTINGS = 12800007, + /** + * The error code when input method manager service error. + */ + IME_ERR_IMMS = 12800008, + /** + * The error code when input method client is detached. + */ + IME_ERR_DETACHED = 12800009, + /** + * The error code when unexpected null pointer. + */ + IME_ERR_NULL_POINTER = 12800010, +} InputMethod_ErrorCode; +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif // OHOS_INPUTMETHOD_TYPES_CAPI_H \ No newline at end of file diff --git a/inputmethod/libohinputmethodndk.json b/inputmethod/libohinputmethodndk.json new file mode 100644 index 000000000..a20dda473 --- /dev/null +++ b/inputmethod/libohinputmethodndk.json @@ -0,0 +1,80 @@ +[ + { "name": "OH_InputMethodController_Attach" }, + { "name": "OH_InputMethodController_Detach" }, + { "name": "OH_InputMethodProxy_ShowKeyboard" }, + { "name": "OH_InputMethodProxy_HideKeyboard" }, + { "name": "OH_InputMethodProxy_NotifySelectionChange" }, + { "name": "OH_InputMethodProxy_NotifyConfigurationChange" }, + { "name": "OH_InputMethodProxy_NotifyCursorUpdate" }, + { "name": "OH_InputMethodProxy_SendPrivateCommand" }, + { "name": "OH_CursorInfo_New" }, + { "name": "OH_CursorInfo_Delete" }, + { "name": "OH_CursorInfo_SetRect" }, + { "name": "OH_CursorInfo_GetRect" }, + { "name": "OH_TextConfig_New" }, + { "name": "OH_TextConfig_Delete" }, + { "name": "OH_TextConfig_SetInputType" }, + { "name": "OH_TextConfig_SetEnterKeyType" }, + { "name": "OH_TextConfig_SetIsPreviewTextSupported" }, + { "name": "OH_TextConfig_SetSelection" }, + { "name": "OH_TextConfig_SetWindowId" }, + { "name": "OH_TextConfig_GetInputType" }, + { "name": "OH_TextConfig_GetEnterKeyType" }, + { "name": "OH_TextConfig_IsPreviewTextSupported" }, + { "name": "OH_TextConfig_GetCursorInfo" }, + { "name": "OH_TextConfig_GetTextAvoidInfo" }, + { "name": "OH_TextConfig_GetSelection" }, + { "name": "OH_TextConfig_GetWindowId" }, + { "name": "OH_TextEditorProxy_New" }, + { "name": "OH_TextEditorProxy_Delete" }, + { "name": "OH_TextEditorProxy_SetGetTextConfigFunc" }, + { "name": "OH_TextEditorProxy_SetInsertTextFunc" }, + { "name": "OH_TextEditorProxy_SetDeleteForwardFunc" }, + { "name": "OH_TextEditorProxy_SetDeleteBackwardFunc" }, + { "name": "OH_TextEditorProxy_SetSendKeyboardStatusFunc" }, + { "name": "OH_TextEditorProxy_SetSendEnterKeyFunc" }, + { "name": "OH_TextEditorProxy_SetMoveCursorFunc" }, + { "name": "OH_TextEditorProxy_SetHandleSetSelectionFunc" }, + { "name": "OH_TextEditorProxy_SetHandleExtendActionFunc" }, + { "name": "OH_TextEditorProxy_SetGetLeftTextOfCursorFunc" }, + { "name": "OH_TextEditorProxy_SetGetRightTextOfCursorFunc" }, + { "name": "OH_TextEditorProxy_SetGetTextIndexAtCursorFunc" }, + { "name": "OH_TextEditorProxy_SetReceivePrivateCommandFunc" }, + { "name": "OH_TextEditorProxy_SetSetPreviewTextFunc" }, + { "name": "OH_TextEditorProxy_SetFinishTextPreviewFunc" }, + { "name": "OH_TextEditorProxy_GetGetTextConfigFunc" }, + { "name": "OH_TextEditorProxy_GetInsertTextFunc" }, + { "name": "OH_TextEditorProxy_GetDeleteForwardFunc" }, + { "name": "OH_TextEditorProxy_GetDeleteBackwardFunc" }, + { "name": "OH_TextEditorProxy_GetSendKeyboardStatusFunc" }, + { "name": "OH_TextEditorProxy_GetSendEnterKeyFunc" }, + { "name": "OH_TextEditorProxy_GetMoveCursorFunc" }, + { "name": "OH_TextEditorProxy_GetHandleSetSelectionFunc" }, + { "name": "OH_TextEditorProxy_GetHandleExtendActionFunc" }, + { "name": "OH_TextEditorProxy_GetGetLeftTextOfCursorFunc" }, + { "name": "OH_TextEditorProxy_GetGetRightTextOfCursorFunc" }, + { "name": "OH_TextEditorProxy_GetGetTextIndexAtCursorFunc" }, + { "name": "OH_TextEditorProxy_GetReceivePrivateCommandFunc" }, + { "name": "OH_TextEditorProxy_GetSetPreviewTextFunc" }, + { "name": "OH_TextEditorProxy_GetFinishTextPreviewFunc" }, + { "name": "OH_AttachOptions_New" }, + { "name": "OH_AttachOptions_Delete" }, + { "name": "OH_AttachOptions_IsShowKeyboard" }, + { "name": "OH_TextAvoidInfo_New" }, + { "name": "OH_TextAvoidInfo_Delete" }, + { "name": "OH_TextAvoidInfo_SetPositionY" }, + { "name": "OH_TextAvoidInfo_SetHeight" }, + { "name": "OH_TextAvoidInfo_GetPositionY" }, + { "name": "OH_TextAvoidInfo_GetHeight" }, + { "name": "OH_PrivateCommand_New" }, + { "name": "OH_PrivateCommand_Delete" }, + { "name": "OH_PrivateCommand_SetKey" }, + { "name": "OH_PrivateCommand_SetBoolValue" }, + { "name": "OH_PrivateCommand_SetIntValue" }, + { "name": "OH_PrivateCommand_SetStrValue" }, + { "name": "OH_PrivateCommand_GetKey" }, + { "name": "OH_PrivateCommand_GetValueType" }, + { "name": "OH_PrivateCommand_GetBoolValue" }, + { "name": "OH_PrivateCommand_GetIntValue" }, + { "name": "OH_PrivateCommand_GetStrValue" } +] \ No newline at end of file -- Gitee From 311a10153a18d12413dc136abb1194aff1a36a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Wed, 21 Aug 2024 18:19:00 +0800 Subject: [PATCH 110/620] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20GetNativeBuffer=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../include/image/image_common.h | 2 ++ .../include/image/pixelmap_native.h | 22 +++++++++++++++++++ .../image_framework/libpixelmap.ndk.json | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index 590b69dac..a09b75f33 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -141,6 +141,8 @@ typedef enum { IMAGE_TOO_LARGE = 7600103, /** @error DMA memory does not exist */ IMAGE_DMA_NOT_EXIST = 7600173, + /** @error DMA operation failed */ + IMAGE_DMA_OPERATION_FAILED = 7600174, /** unsupported operations */ IMAGE_UNSUPPORTED_OPERATION = 7600201, /** unsupported metadata */ diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 5b4f40317..fd631b98e 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -51,6 +51,14 @@ extern "C" { struct OH_PixelmapNative; typedef struct OH_PixelmapNative OH_PixelmapNative; +/** + * @brief Define a native buffer type, used for retrieving a native buffer. + * + * @since 12 + */ +struct OH_NativeBuffer; +typedef struct OH_NativeBuffer OH_NativeBuffer; + /** * @brief Define a pixelmap alpha type. * @@ -809,6 +817,20 @@ Image_ErrorCode OH_PixelmapNative_GetMetadata(OH_PixelmapNative *pixelmap, OH_Pi Image_ErrorCode OH_PixelmapNative_SetMetadata(OH_PixelmapNative *pixelmap, OH_Pixelmap_HdrMetadataKey key, OH_Pixelmap_HdrMetadataValue *value); +/** + * @brief Get the native buffer from the PixelMap. + * + * @param pixelmap The PixelMap to get the native buffer from. + * @param nativeBuffer The native buffer to retrieve. + * @return Returns {@link Image_ErrorCode} IMAGE_RESULT_SUCCESS - if the operation is successful. + * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if invalid parameter, pixelmap or nativeBuffer is null. + * returns {@link Image_ErrorCode} IMAGE_DMA_NOT_EXIST - if DMA memory dose not exist. + * returns {@link Image_ErrorCode} IMAGE_DMA_OPERATION_FAILED - if operations related to DMA memory has failed. + * @see OH_PixelmapNative + * @since 12 + */ +Image_ErrorCode OH_PixelmapNative_GetNativeBuffer(OH_PixelmapNative *pixelmap, OH_NativeBuffer **nativeBuffer); + #ifdef __cplusplus }; #endif diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index 248078f3e..78c1a0235 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -155,6 +155,10 @@ "first_introduced": "12", "name": "OH_PixelmapNative_SetMetadata" }, + { + "first_introduced": "12", + "name": "OH_PixelmapNative_GetNativeBuffer" + }, { "first_introduced": "12", "name": "OH_PixelmapNative_ConvertPixelmapNativeToNapi" -- Gitee From ce6ff2276b13ed4545ff217406f7c5f077d6a411 Mon Sep 17 00:00:00 2001 From: xiyupeng Date: Thu, 22 Aug 2024 09:22:00 +0800 Subject: [PATCH 111/620] =?UTF-8?q?NDK=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiyupeng --- web/webview/interfaces/native/arkweb_scheme_handler.h | 1 + web/webview/interfaces/native/native_interface_arkweb.h | 1 + 2 files changed, 2 insertions(+) diff --git a/web/webview/interfaces/native/arkweb_scheme_handler.h b/web/webview/interfaces/native/arkweb_scheme_handler.h index 1b3dd4bea..4ab4b8b94 100644 --- a/web/webview/interfaces/native/arkweb_scheme_handler.h +++ b/web/webview/interfaces/native/arkweb_scheme_handler.h @@ -32,6 +32,7 @@ #ifndef ARKWEB_SCHEME_HANDLER_H #define ARKWEB_SCHEME_HANDLER_H +#include #include "stdint.h" #include "arkweb_error_code.h" diff --git a/web/webview/interfaces/native/native_interface_arkweb.h b/web/webview/interfaces/native/native_interface_arkweb.h index 42a95a67e..48c114fce 100644 --- a/web/webview/interfaces/native/native_interface_arkweb.h +++ b/web/webview/interfaces/native/native_interface_arkweb.h @@ -32,6 +32,7 @@ #ifndef NATIVE_INTERFACE_ARKWEB_H #define NATIVE_INTERFACE_ARKWEB_H +#include #include #ifdef __cplusplus -- Gitee From af295c116e19c9372761ccebfa4566ba3f119a15 Mon Sep 17 00:00:00 2001 From: wangyongzhong2 Date: Tue, 20 Aug 2024 14:33:19 +0800 Subject: [PATCH 112/620] add ndk for dlp Signed-off-by: wangyongzhong2 --- DataProtectionKit/BUILD.gn | 28 ++++ DataProtectionKit/dlp_permission_api.h | 172 ++++++++++++++++++++ DataProtectionKit/libdlppermission.ndk.json | 26 +++ 3 files changed, 226 insertions(+) create mode 100644 DataProtectionKit/BUILD.gn create mode 100644 DataProtectionKit/dlp_permission_api.h create mode 100644 DataProtectionKit/libdlppermission.ndk.json diff --git a/DataProtectionKit/BUILD.gn b/DataProtectionKit/BUILD.gn new file mode 100644 index 000000000..b6f4d3b5e --- /dev/null +++ b/DataProtectionKit/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright (C) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_headers("dlppermission_capi_header") { + dest_dir = "$ndk_headers_out_dir/DataProtectionKit" + sources = [ "./dlp_permission_api.h" ] +} + +ohos_ndk_library("libohdlp_permission") { + output_name = "ohdlp_permission" + output_extension = "so" + ndk_description_file = "./libdlppermission.ndk.json" + system_capability = "SystemCapability.Security.DataLossPrevention" + system_capability_headers = [ "DataProtectionKit/dlp_permission_api.h" ] +} diff --git a/DataProtectionKit/dlp_permission_api.h b/DataProtectionKit/dlp_permission_api.h new file mode 100644 index 000000000..057c0fd32 --- /dev/null +++ b/DataProtectionKit/dlp_permission_api.h @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup DlpPermissionApi + * @{ + * + * @brief Provides the capability to access the data loss prevention (DLP) files. + * + * @since 13 + */ + +/** + * @file dlp_permission_api.h + * + * @brief Declares the APIs for accessing the data loss prevention (DLP) files. + * + * @library libohdlp_permission.so + * @kit DataProtectionKit + * @syscap SystemCapability.Security.DataLossPrevention + * @since 13 + */ + +#ifndef DLP_PERMISSION_API_H +#define DLP_PERMISSION_API_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the error codes. + * + * @since 13 + */ +typedef enum { + /** @error The operation is successful. */ + ERR_OH_SUCCESS = 0, + /** @error Invalid parameter value. */ + ERR_OH_INVALID_PARAMETER = 19100001, + /** @error No permission to call this API, which is available only for DLP sandbox applications. */ + ERR_OH_API_ONLY_FOR_SANDBOX = 19100006, + /** @error No permission to call this API, which is available only for non-DLP sandbox applications. */ + ERR_OH_API_NOT_FOR_SANDBOX = 19100007, + /** @error The system ability works abnormally. */ + ERR_OH_SYSTEM_SERVICE_EXCEPTION = 19100011, + /** @error Indicates the memory error. */ + ERR_OH_OUT_OF_MEMORY = 19100012, + /** @error DisplayName missing in want. */ + ERR_OH_APPLICATION_NOT_AUTHORIZED = 19100018 +} DLP_ErrCode; + +/** + * @brief Enumerates the access permissions for a DLP file. + * + * @since 13 + */ +typedef enum { + /** No permission. */ + NO_PERMISSION = 0, + /** Read-only. */ + READ_ONLY = 1, + /** Edit. */ + CONTENT_EDIT = 2, + /** Full control. */ + FULL_CONTROL = 3 +} DLP_FileAccess; + +/** + * @brief Obtains the permission info of this DLP file. + * + * @param dlpFileAccess - Indicates the access permission for the DLP file. + * @param flags - Indicates the actions allowed for the DLP file. + * @return {@link DLP_ErrCode#ERR_OH_SUCCESS} 0 - If the operation is successful. + * {@link DLP_ErrCode#ERR_OH_INVALID_PARAMETER} 19100001 - If the parameter value is invalid. + * {@link DLP_ErrCode#ERR_OH_API_ONLY_FOR_SANDBOX} 19100006 - If no permission to + * call this API, which is available only for DLP sandbox applications. + * {@link DLP_ErrCode#ERR_OH_SYSTEM_SERVICE_EXCEPTION} 19100011 - If the system ability + * works abnormally. + * {@link DLP_ErrCode#ERR_OH_OUT_OF_MEMORY} 19100012 - If the memory error. + * @since 13 + */ +DLP_ErrCode OH_DLP_GetDlpPermissionInfo(DLP_FileAccess *dlpFileAccess, uint32_t *flags); + +/** + * @brief Obtains the original file name from a DLP file name. + * This method removes the DLP file name extension from the DLP file name. + * + * @param fileName - Indicates the DLP file name. + * @param originalFileName - Indicates the original file name obtained. + * @return {@link DLP_ErrCode#ERR_OH_SUCCESS} 0 - If the operation is successful. + * {@link DLP_ErrCode#ERR_OH_INVALID_PARAMS} 19100001 - If the parameter value is invalid. + * {@link DLP_ErrCode#ERR_OH_OUT_OF_MEMORY} 19100012 - If the memory error. + * @since 13 + */ +DLP_ErrCode OH_DLP_GetOriginalFileName(const char *fileName, char **originalFileName); + +/** + * @brief Checks whether current application is in the DLP sandbox. + * + * @param isInSandbox - Indicates output parameter, + * {@code true} if current application is in a DLP sandbox, {@code false} otherwise. + * @return {@link DLP_ErrCode#ERR_OH_SUCCESS} 0 - If the operation is successful. + * {@link DLP_ErrCode#ERR_OH_SYSTEM_SERVICE_EXCEPTION} 19100011 - If the system ability + * works abnormally. + * {@link DLP_ErrCode#ERR_OH_OUT_OF_MEMORY} 19100012 - If the memory error. + * @since 13 + */ +DLP_ErrCode OH_DLP_IsInSandbox(bool *isInSandbox); + +/** + * @brief Sets sandbox application configuration. + * + * @param configInfo - Configuration of the sandbox application. + * @return {@link DLP_ErrCode#ERR_OH_SUCCESS} 0 - If the operation is successful. + * {@link DLP_ErrCode#ERR_OH_INVALID_PARAMETER} 19100001 - If the parameter value is invalid. + * {@link DLP_ErrCode#ERR_OH_API_NOT_FOR_SANDBOX} 19100007 - If no permission to + * call this API, which is available only for non-DLP sandbox applications. + * {@link DLP_ErrCode#ERR_OH_SYSTEM_SERVICE_EXCEPTION} 19100011 - If the system ability + * works abnormally. + * {@link DLP_ErrCode#ERR_OH_APPLICATION_NOT_AUTHORIZED} 19100018 - If not authorized application. + * @since 13 + */ +DLP_ErrCode OH_DLP_SetSandboxAppConfig(const char *configInfo); + +/** + * @brief Obtains sandbox application configuration. + * + * @param configInfo - Configuration of the sandbox application. + * @return {@link DLP_ErrCode#ERR_OH_SUCCESS} 0 - If the operation is successful. + * {@link DLP_ErrCode#ERR_OH_SYSTEM_SERVICE_EXCEPTION} 19100011 - If the system ability + * works abnormally. + * {@link DLP_ErrCode#ERR_OH_OUT_OF_MEMORY} 19100012 - If the memory error. + * {@link DLP_ErrCode#ERR_OH_APPLICATION_NOT_AUTHORIZED} 19100018 - If not authorized application. + * @since 13 + */ +DLP_ErrCode OH_DLP_GetSandboxAppConfig(char **configInfo); + +/** + * @brief Cleans sandbox application configuration. + * + * @return {@link DLP_ErrCode#ERR_OH_SUCCESS} 0 - If the operation is successful. + * {@link DLP_ErrCode#ERR_OH_API_NOT_FOR_SANDBOX} 19100007 - If no permission to + * call this API, which is available only for non-DLP sandbox applications. + * {@link DLP_ErrCode#ERR_OH_SYSTEM_SERVICE_EXCEPTION} 19100011 - If the system ability + * works abnormally. + * {@link DLP_ErrCode#ERR_OH_APPLICATION_NOT_AUTHORIZED} 19100018 - If not authorized application. + * @since 13 + */ +DLP_ErrCode OH_DLP_CleanSandboxAppConfig(); + +#ifdef __cplusplus +} +#endif + +/** @} */ +#endif /* DLP_PERMISSION_API_H */ \ No newline at end of file diff --git a/DataProtectionKit/libdlppermission.ndk.json b/DataProtectionKit/libdlppermission.ndk.json new file mode 100644 index 000000000..6de2fcd87 --- /dev/null +++ b/DataProtectionKit/libdlppermission.ndk.json @@ -0,0 +1,26 @@ +[ + { + "first_introduced": "13", + "name": "OH_DLP_GetDlpPermissionInfo" + }, + { + "first_introduced": "13", + "name": "OH_DLP_GetOriginalFileName" + }, + { + "first_introduced": "13", + "name": "OH_DLP_IsInSandbox" + }, + { + "first_introduced": "13", + "name": "OH_DLP_SetSandboxAppConfig" + }, + { + "first_introduced": "13", + "name": "OH_DLP_GetSandboxAppConfig" + }, + { + "first_introduced": "13", + "name": "OH_DLP_CleanSandboxAppConfig" + } +] \ No newline at end of file -- Gitee From 19ca6c7d268355d9421870216d1a9b4baba41131 Mon Sep 17 00:00:00 2001 From: wisdom Date: Thu, 22 Aug 2024 10:02:28 +0800 Subject: [PATCH 113/620] Description: Update interface JSON Signed-off-by: wisdom --- .../native_audio_session_manager.h | 1 + multimedia/audio_framework/ohaudio.ndk.json | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 34898557e..08ae35748 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -36,6 +36,7 @@ * * @library libohaudio.so * @syscap SystemCapability.Multimedia.Audio.Core + * @kit AudioKit * @since 12 * @version 1.0 */ diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 165dc8631..a4c82abf9 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -322,5 +322,29 @@ { "first_introduced": "12", "name":"OH_AudioRenderer_GetSilentModeAndMixWithOthers" + }, + { + "first_introduced": "12", + "name":"OH_AudioManager_GetAudioSessionManager" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_ActivateAudioSession" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_DeactivateAudioSession" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_IsAudioSessionActivated" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_RegisterSessionDeactivatedCallback" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_UnregisterSessionDeactivatedCallback" } ] -- Gitee From cb611d06d5fa538009e3474e7aeb3f49b585559f Mon Sep 17 00:00:00 2001 From: wangchuanxia Date: Thu, 22 Aug 2024 10:07:03 +0800 Subject: [PATCH 114/620] fix capi Signed-off-by: wangchuanxia --- ai/neural_network_runtime/neural_network_runtime_type.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ai/neural_network_runtime/neural_network_runtime_type.h b/ai/neural_network_runtime/neural_network_runtime_type.h index 26d4babc2..414fa872c 100644 --- a/ai/neural_network_runtime/neural_network_runtime_type.h +++ b/ai/neural_network_runtime/neural_network_runtime_type.h @@ -39,8 +39,13 @@ #ifndef NEURAL_NETWORK_RUNTIME_TYPE_H #define NEURAL_NETWORK_RUNTIME_TYPE_H +#ifdef __cplusplus #include #include +#else +#include +#include +#endif #ifdef __cplusplus extern "C" { -- Gitee From e9ba0522ac72bccbe390e6c04bad6ce65efdaba5 Mon Sep 17 00:00:00 2001 From: sqwlly Date: Thu, 22 Aug 2024 02:29:11 +0000 Subject: [PATCH 115/620] add hdi error code Signed-off-by: s30029175 Signed-off-by: sqwlly Change-Id: I658538eb487701a43b6f9694f0a1b40453af4e73 --- graphic/graphic_2d/native_window/graphic_error_code.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphic/graphic_2d/native_window/graphic_error_code.h b/graphic/graphic_2d/native_window/graphic_error_code.h index 8a2419681..1b5e9deb0 100644 --- a/graphic/graphic_2d/native_window/graphic_error_code.h +++ b/graphic/graphic_2d/native_window/graphic_error_code.h @@ -80,6 +80,8 @@ typedef enum OHNativeErrorCode { NATIVE_ERROR_UNSUPPORTED = 50102000, /** @error unknown error, please check log */ NATIVE_ERROR_UNKNOWN = 50002000, + /** @error hdi interface error */ + NATIVE_ERROR_HDI_ERROR = 50007000, /** @error ipc send failed */ NATIVE_ERROR_BINDER_ERROR = 50401000, /** @error the egl environment is abnormal */ -- Gitee From d675aae67602ca95ba877511636872a861a667ec Mon Sep 17 00:00:00 2001 From: Tiga Ultraman Date: Tue, 20 Aug 2024 15:41:22 +0800 Subject: [PATCH 116/620] add interface for new proxy ndk functions Signed-off-by: Tiga Ultraman --- network/netmanager/include/net_connection.h | 93 +++++++++++++++ .../netmanager/include/net_connection_type.h | 108 ++++++++++++++++++ network/netmanager/libnet_connection.ndk.json | 26 ++++- 3 files changed, 226 insertions(+), 1 deletion(-) diff --git a/network/netmanager/include/net_connection.h b/network/netmanager/include/net_connection.h index 9446b979f..76d12d406 100644 --- a/network/netmanager/include/net_connection.h +++ b/network/netmanager/include/net_connection.h @@ -219,6 +219,99 @@ int32_t OHOS_NetConn_UnregisterDnsResolver(void); */ int32_t OH_NetConn_BindSocket(int32_t socketFd, NetConn_NetHandle *netHandle); +/** + * @brief Sets http proxy information to current application. + * + * @param httpProxy Information about the proxy that needs to be set. + * @return 0 - Success. + * 401 - Parameter error. + * @syscap SystemCapability.Communication.NetManager.Core + * @since 12 + * @version 1.0 + */ +int32_t OH_NetConn_SetAppHttpProxy(NetConn_HttpProxy *httpProxy); + +/** + * @brief Registers callback to listen for changes to the application-level http proxy. + * + * @param appHttpProxyChange Callback that need to be registered to listen for changes to the http proxy. + * @param callbackId Callback id returned after registration, associated with a registered callback. + * @return 0 - Success. + * 401 - Parameter error. + * @syscap SystemCapability.Communication.NetManager.Core + * @since 12 + * @version 1.0 + */ +int32_t OH_NetConn_RegisterAppHttpProxyCallback(OH_NetConn_AppHttpProxyChange appHttpProxyChange, uint32_t *callbackId); + +/** + * @brief Unregisters a callback function that listens for application-level proxy changes. + * + * @param callbackId Id of the callback function that needs to be deregistered. + * @syscap SystemCapability.Communication.NetManager.Core + * @since 12 + * @version 1.0 + */ +void OH_NetConn_UnregisterAppHttpProxyCallback(uint32_t callbackId); + +/** + * @brief Registers callback, used to monitor specific network status. + * + * @param netSpecifier specifier information. + * @param callback The callback needed to be registered. + * @param timeout The timeout period in milliseconds. + * @param callbackId out param, corresponding to a registered callback. + * @return 0 - Success. + * 201 - Permission denied. + * 401 - Parameter error. + * 2100002 - Failed to connect to the service. + * 2100003 - System internal error. + * 2101008 - The callback already exists. + * 2101022 - The number of requests exceeded the maximum allowed. + * @permission ohos.permission.GET_NETWORK_INFO + * @syscap SystemCapability.Communication.NetManager.Core + * @since 12 + * @version 1.0 + */ +int32_t OH_NetConn_RegisterNetConnCallback(NetConn_NetSpecifier *specifier, NetConn_NetConnCallback *netConnCallback, + uint32_t timeout, uint32_t *callbackId); + +/** + * @brief Registers a callback to listen default network's status changed. + * + * @param callback The callback needed to be registered. + * @param callbackId out param, corresponding to a registered callback. + * @return 0 - Success. + * 201 - Permission denied. + * 401 - Parameter error. + * 2100002 - Failed to connect to the service. + * 2100003 - System internal error. + * 2101008 - The callback already exists. + * 2101022 - The number of requests exceeded the maximum allowed. + * @permission ohos.permission.GET_NETWORK_INFO + * @syscap SystemCapability.Communication.NetManager.Core + * @since 12 + * @version 1.0 + */ +int32_t OH_NetConn_RegisterDefaultNetConnCallback(NetConn_NetConnCallback *netConnCallback, uint32_t *callbackId); + +/** + * @brief Unregisters network status callback. + * + * @param callBackId the id corresponding to a registered callback. + * @return 0 - Success. + * 201 - Permission denied. + * 401 - Parameter error. + * 2100002 - Failed to connect to the service. + * 2100003 - System internal error. + * 2101007 - The callback does not exists. + * @permission ohos.permission.GET_NETWORK_INFO + * @syscap SystemCapability.Communication.NetManager.Core + * @since 12 + * @version 1.0 + */ +int32_t OH_NetConn_UnregisterNetConnCallback(uint32_t callBackId); + #ifdef __cplusplus } #endif diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index 36f68e874..436698c29 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -248,6 +248,114 @@ typedef struct NetConn_NetHandleList { */ typedef int (*OH_NetConn_CustomDnsResolver)(const char *host, const char *serv, const struct addrinfo *hint, struct addrinfo **res); + +/** + * @brief Callback for application’s http proxy information changed. + * + * @param proxy The changed proxy information, may be a null pointer. + * + * @since 12 + * @version 1.0 + */ +typedef void (*OH_NetConn_AppHttpProxyChange)(NetConn_HttpProxy *proxy); + +/** + * @brief Definition of network specifier. + * + * @since 12 + * @version 1.0 + */ +typedef struct NetConn_NetSpecifier { + /** Network capabilities. */ + NetConn_NetCapabilities caps; + /** Network identifier */ + char *bearerPrivateIdentifier; +} NetConn_NetSpecifier; + +/** + * @brief Callback for network available. + * + * @param netHandle The network handle. + * + * @since 12 + * @version 1.0 + */ +typedef void (*OH_NetConn_NetworkAvailable)(NetConn_NetHandle *netHandle); + +/** + * @brief Callback for network capabilities changed. + * + * @param netHandle The network handle. + * @param netCapabilities The network capabilities. + * + * @since 12 + * @version 1.0 + */ +typedef void (*OH_NetConn_NetCapabilitiesChange)(NetConn_NetHandle *netHandle, + NetConn_NetCapabilities *netCapabilities); + +/** + * @brief Callback for network connection properties changed. + * + * @param netHandle The network handle. + * @param connConnetionProperties The network connection properties. + * + * @since 12 + * @version 1.0 + */ +typedef void (*OH_NetConn_NetConnectionPropertiesChange)(NetConn_NetHandle *netHandle, + NetConn_ConnectionProperties *connConnetionProperties); + +/** + * @brief Callback for network lost. + * + * @param netHandle The network handle. + * + * @since 12 + * @version 1.0 + */ +typedef void (*OH_NetConn_NetLost)(NetConn_NetHandle *netHandle); + +/** + * @brief Callback for network unavailable, this function invoked while network can not be available in given timeout. + * + * @since 12 + * @version 1.0 + */ +typedef void (*OH_NetConn_NetUnavailable)(void); + +/** + * @brief Callback for network blocked status changed. + * + * @param netHandle The network handle. + * @param blocked The flag used to indicate whether the network will be blocked. + * + * @since 12 + * @version 1.0 + */ +typedef void (*OH_NetConn_NetBlockStatusChange)(NetConn_NetHandle *netHandle, bool blocked); + +/** + * @brief Defines the network connection callbacks. + * + * @since 12 + * @version 1.0 + */ +typedef struct NetConn_NetConnCallback { + /** Callback for network available */ + OH_NetConn_NetworkAvailable onNetworkAvailable; + /** Callback for network capabilities changed */ + OH_NetConn_NetCapabilitiesChange onNetCapabilitiesChange; + /** Callback for network connection properties changed */ + OH_NetConn_NetConnectionPropertiesChange onConnetionProperties; + /** Callback for network lost */ + OH_NetConn_NetLost onNetLost; + /** Callback for network unavailable, this function invoked while network can not be available in given timeout */ + OH_NetConn_NetUnavailable onNetUnavailable; + /** Callback for network blocked status changed */ + OH_NetConn_NetBlockStatusChange onNetBlockStatusChange; +} NetConn_NetConnCallback; + #ifdef __cplusplus } #endif diff --git a/network/netmanager/libnet_connection.ndk.json b/network/netmanager/libnet_connection.ndk.json index 67993dd38..792eff18e 100644 --- a/network/netmanager/libnet_connection.ndk.json +++ b/network/netmanager/libnet_connection.ndk.json @@ -46,5 +46,29 @@ { "first_introduced": "12", "name": "OH_NetConn_BindSocket" + }, + { + "first_introduced": "12", + "name": "OH_NetConn_SetAppHttpProxy" + }, + { + "first_introduced": "12", + "name": "OH_NetConn_RegisterAppHttpProxyCallback" + }, + { + "first_introduced": "12", + "name": "OH_NetConn_UnregisterAppHttpProxyCallback" + }, + { + "first_introduced": "12", + "name": "OH_NetConn_RegisterNetConnCallback" + }, + { + "first_introduced": "12", + "name": "OH_NetConn_RegisterDefaultNetConnCallback" + }, + { + "first_introduced": "12", + "name": "OH_NetConn_UnregisterNetConnCallback" } -] +] \ No newline at end of file -- Gitee From 633caf0e597339c5a6a922c493a3e04d07eb6d0f Mon Sep 17 00:00:00 2001 From: s00659936 <282229496@qq.com> Date: Tue, 20 Aug 2024 11:22:26 +0800 Subject: [PATCH 117/620] =?UTF-8?q?netstack=E6=B7=BB=E5=8A=A0=E8=AF=81?= =?UTF-8?q?=E4=B9=A6=E7=9B=B8=E5=85=B3=E7=9A=84NDK=E6=8E=A5=E5=8F=A3.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SJH <282229496@qq.com> --- network/netssl/include/net_ssl_c.h | 39 +++++++++++++++++++ network/netssl/include/net_ssl_c_type.h | 52 +++++++++++++++++++++++++ network/netssl/libnet_ssl_c.json | 12 ++++++ 3 files changed, 103 insertions(+) diff --git a/network/netssl/include/net_ssl_c.h b/network/netssl/include/net_ssl_c.h index 43c46ca6c..779ccab79 100644 --- a/network/netssl/include/net_ssl_c.h +++ b/network/netssl/include/net_ssl_c.h @@ -70,6 +70,45 @@ extern "C" { * @version 1.0 */ uint32_t OH_NetStack_CertVerification(const struct NetStack_CertBlob *cert, const struct NetStack_CertBlob *caCert); + +/** + * @brief Gets pin set for hostname. + * + * @param hostname Hostname. + * @param pin Certificate lock information. + * @return 0 - Success. + * 401 - Parameter error. + * 2305999 - Out of memory. + * @syscap SystemCapability.Communication.NetStack + * @since 12 + * @version 1.0 + */ +int32_t OH_NetStack_GetPinSetForHostName(const char *hostname, NetStack_CertificatePinning *pin); + +/** + * @brief Gets certificates for hostname. + * + * @param hostname Hostname. + * @param certs Certificate Information. + * @return 0 - Success. + * 401 - Parameter error. + * 2305999 - Out of memory. + * @syscap SystemCapability.Communication.NetStack + * @since 12 + * @version 1.0 + */ +int32_t OH_NetStack_GetCertificatesForHostName(const char *hostname, NetStack_Certificates *certs); + +/** + * @brief Frees content of the certificates. + * + * @param certs Certificate. + * @syscap SystemCapability.Communication.NetStack + * @since 12 + * @version 1.0 + */ +void OH_Netstack_DestroyCertificatesContent(NetStack_Certificates *certs); + #ifdef __cplusplus } #endif diff --git a/network/netssl/include/net_ssl_c_type.h b/network/netssl/include/net_ssl_c_type.h index 2241bb54a..fcc9b6fd5 100644 --- a/network/netssl/include/net_ssl_c_type.h +++ b/network/netssl/include/net_ssl_c_type.h @@ -73,6 +73,58 @@ struct NetStack_CertBlob { uint8_t *data; }; +/** + * @brief Defines the certificate lock type. + * + * @since 12 + * @version 1.0 + */ +typedef enum NetStack_CertificatePinningKind { + /** Public key pinning */ + PUBLIC_KEY, +} NetStack_CertificatePinningKind; + +/** + * @brief Defines the hash algorithm. + * + * @since 12 + * @version 1.0 + */ +typedef enum NetStack_HashAlgorithm { + /** Sha256 */ + SHA_256, +} NetStack_HashAlgorithm; + +/** + * @brief Defines the certificate lock information. + * + * @since 12 + * @version 1.0 + */ +typedef struct NetStack_CertificatePinning { + /** Certificate lock type */ + NetStack_CertificatePinningKind kind; + /** Hash algorithm */ + NetStack_HashAlgorithm hashAlgorithm; + /** Hash value */ + union { + char *publicKeyHash; + }; +} NetStack_CertificatePinning; + +/** + * @brief Defines the certificate information. + * + * @since 12 + * @version 1.0 + */ +typedef struct NetStack_Certificates { + /** PEM content of the certificates */ + char **content; + /** Number of certificates */ + size_t length; +} NetStack_Certificates; + #ifdef __cplusplus } #endif diff --git a/network/netssl/libnet_ssl_c.json b/network/netssl/libnet_ssl_c.json index bd17ed3fb..af49f5a35 100644 --- a/network/netssl/libnet_ssl_c.json +++ b/network/netssl/libnet_ssl_c.json @@ -2,5 +2,17 @@ { "first_introduced":"11", "name": "OH_NetStack_CertVerification" + }, + { + "first_introduced":"12", + "name": "OH_NetStack_GetPinSetForHostName" + }, + { + "first_introduced":"12", + "name": "OH_NetStack_GetCertificatesForHostName" + }, + { + "first_introduced":"12", + "name": "OH_Netstack_DestroyCertificatesContent" } ] -- Gitee From df6baafd7a68bee5dfc19c87011c21d9862e9c03 Mon Sep 17 00:00:00 2001 From: wuchengwen Date: Thu, 22 Aug 2024 11:17:47 +0800 Subject: [PATCH 118/620] add addgroup and file Signed-off-by: wuchengwen --- .../include/inputmethod_attach_options_capi.h | 20 +++++++++++++++++++ .../include/inputmethod_cursor_info_capi.h | 20 +++++++++++++++++++ .../inputmethod_inputmethod_proxy_capi.h | 20 +++++++++++++++++++ .../inputmethod_private_command_capi.h | 20 +++++++++++++++++++ .../inputmethod_text_avoid_info_capi.h | 20 +++++++++++++++++++ .../include/inputmethod_text_config_capi.h | 20 +++++++++++++++++++ .../inputmethod_text_editor_proxy_capi.h | 20 +++++++++++++++++++ inputmethod/include/inputmethod_types_capi.h | 20 +++++++++++++++++++ 8 files changed, 160 insertions(+) diff --git a/inputmethod/include/inputmethod_attach_options_capi.h b/inputmethod/include/inputmethod_attach_options_capi.h index 0519caa3c..491174372 100644 --- a/inputmethod/include/inputmethod_attach_options_capi.h +++ b/inputmethod/include/inputmethod_attach_options_capi.h @@ -14,6 +14,26 @@ */ #ifndef OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H #define OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H +/** + * @addtogroup InputMethod + * @{ + * + * @brief InputMethod provides functions to use input methods and develop input methods. + * + * @since 12 + */ + +/** + * @file inputmethod_attach_options_capi.h + * + * @brief Provides the input method attach options. + * + * @library libohinputmethod.so + * @kit IMEKit + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 12 + * @version 1.0 + */ #include "inputmethod_types_capi.h" #ifdef __cplusplus extern "C" { diff --git a/inputmethod/include/inputmethod_cursor_info_capi.h b/inputmethod/include/inputmethod_cursor_info_capi.h index b456c5d0f..d081e38d1 100644 --- a/inputmethod/include/inputmethod_cursor_info_capi.h +++ b/inputmethod/include/inputmethod_cursor_info_capi.h @@ -14,6 +14,26 @@ */ #ifndef OHOS_INPUTMETHOD_CURSOR_INFO_CAPI_H #define OHOS_INPUTMETHOD_CURSOR_INFO_CAPI_H +/** + * @addtogroup InputMethod + * @{ + * + * @brief InputMethod provides functions to use input methods and develop input methods. + * + * @since 12 + */ + +/** + * @file inputmethod_cursor_info_capi.h + * + * @brief Provides interfaces to manage the cursor information. + * + * @library libohinputmethod.so + * @kit IMEKit + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 12 + * @version 1.0 + */ #include "inputmethod_types_capi.h" #ifdef __cplusplus extern "C"{ diff --git a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h index 2a2e85ba9..fc2dc3b3d 100644 --- a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h +++ b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h @@ -14,6 +14,26 @@ */ #ifndef OHOS_INPUTMETHOD_INPUTMETHOD_PROXY_CAPI_H #define OHOS_INPUTMETHOD_INPUTMETHOD_PROXY_CAPI_H +/** + * @addtogroup InputMethod + * @{ + * + * @brief InputMethod provides functions to use input methods and develop input methods. + * + * @since 12 + */ + +/** + * @file inputmethod_inputmethod_proxy_capi.h + * + * @brief Provides functions to use input methods. + * + * @library libohinputmethod.so + * @kit IMEKit + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 12 + * @version 1.0 + */ #include #include "inputmethod_types_capi.h" diff --git a/inputmethod/include/inputmethod_private_command_capi.h b/inputmethod/include/inputmethod_private_command_capi.h index c056589c7..df904f8a7 100644 --- a/inputmethod/include/inputmethod_private_command_capi.h +++ b/inputmethod/include/inputmethod_private_command_capi.h @@ -14,6 +14,26 @@ */ #ifndef OHOS_INPUTMETHOD_PRIVATE_COMMAND_CAPI_H #define OHOS_INPUTMETHOD_PRIVATE_COMMAND_CAPI_H +/** + * @addtogroup InputMethod + * @{ + * + * @brief InputMethod provides functions to use input methods and develop input methods. + * + * @since 12 + */ + +/** + * @file inputmethod_private_command_capi.h + * + * @brief Provides functions to manage private commands. + * + * @library libohinputmethod.so + * @kit IMEKit + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 12 + * @version 1.0 + */ #include #include diff --git a/inputmethod/include/inputmethod_text_avoid_info_capi.h b/inputmethod/include/inputmethod_text_avoid_info_capi.h index 02b451626..0e74eb350 100644 --- a/inputmethod/include/inputmethod_text_avoid_info_capi.h +++ b/inputmethod/include/inputmethod_text_avoid_info_capi.h @@ -14,6 +14,26 @@ */ #ifndef OHOS_INPUTMETHOD_TEXT_AVOID_INFO_CAPI_H #define OHOS_INPUTMETHOD_TEXT_AVOID_INFO_CAPI_H +/** + * @addtogroup InputMethod + * @{ + * + * @brief InputMethod provides functions to use input methods and develop input methods. + * + * @since 12 + */ + +/** + * @file inputmethod_text_avoid_info_capi.h + * + * @brief Provides functions to manage text editor to avoid the keyboard. + * + * @library libohinputmethod.so + * @kit IMEKit + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 12 + * @version 1.0 + */ #include "inputmethod_types_capi.h" #ifdef __cplusplus extern "C" { diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index 8a6bfbf9d..5d6feff67 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -14,6 +14,26 @@ */ #ifndef OHOS_INPUTMETHOD_TEXT_CONFIG_CAPI_H #define OHOS_INPUTMETHOD_TEXT_CONFIG_CAPI_H +/** + * @addtogroup InputMethod + * @{ + * + * @brief InputMethod provides functions to use input methods and develop input methods. + * + * @since 12 + */ + +/** + * @file inputmethod_text_config_capi.h + * + * @brief Provides functions to manage the text configuration. + * + * @library libohinputmethod.so + * @kit IMEKit + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 12 + * @version 1.0 + */ #include #include "inputmethod_cursor_info_capi.h" diff --git a/inputmethod/include/inputmethod_text_editor_proxy_capi.h b/inputmethod/include/inputmethod_text_editor_proxy_capi.h index e76116940..038cec2a0 100644 --- a/inputmethod/include/inputmethod_text_editor_proxy_capi.h +++ b/inputmethod/include/inputmethod_text_editor_proxy_capi.h @@ -14,6 +14,26 @@ */ #ifndef OHOS_INPUTMETHOD_TEXT_EDITOR_PROXY_CAPI_H #define OHOS_INPUTMETHOD_TEXT_EDITOR_PROXY_CAPI_H +/** + * @addtogroup InputMethod + * @{ + * + * @brief InputMethod provides functions to use input methods and develop input methods. + * + * @since 12 + */ + +/** + * @file inputmethod_text_editor_proxy_capi.h + * + * @brief Provides functions for getting requests and notifications from input method. + * + * @library libohinputmethod.so + * @kit IMEKit + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 12 + * @version 1.0 + */ #include #include "inputmethod_private_command_capi.h" diff --git a/inputmethod/include/inputmethod_types_capi.h b/inputmethod/include/inputmethod_types_capi.h index 2cd71d846..e88aa8837 100644 --- a/inputmethod/include/inputmethod_types_capi.h +++ b/inputmethod/include/inputmethod_types_capi.h @@ -14,6 +14,26 @@ */ #ifndef OHOS_INPUTMETHOD_TYPES_CAPI_H #define OHOS_INPUTMETHOD_TYPES_CAPI_H +/** + * @addtogroup InputMethod + * @{ + * + * @brief InputMethod provides functions to use input methods and develop input methods. + * + * @since 12 + */ + +/** + * @file inputmethod_types_capi.h + * + * @brief Provides the input method types. + * + * @library libohinputmethod.so + * @kit IMEKit + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 12 + * @version 1.0 + */ #ifdef __cplusplus extern "C"{ #endif /* __cplusplus */ -- Gitee From 0d16d73521780764a76bbedb87367956c91e0fc6 Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Thu, 22 Aug 2024 11:50:15 +0800 Subject: [PATCH 119/620] modify image native parameter Signed-off-by: kerongfeng --- multimedia/camera_framework/photo_native.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/camera_framework/photo_native.h b/multimedia/camera_framework/photo_native.h index 216883119..bb42601a3 100644 --- a/multimedia/camera_framework/photo_native.h +++ b/multimedia/camera_framework/photo_native.h @@ -62,13 +62,13 @@ typedef struct OH_PhotoNative OH_PhotoNative; * @brief Get main image. * * @param photo the {@link OH_PhotoNative} instance. - * @param main the {@link OH_ImageNative} which use to get main image. + * @param mainImage the {@link OH_ImageNative} which use to get main image. * @return {@link #CAMERA_OK} if the method call succeeds. * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. * @since 12 * @version 1.0 */ -Camera_ErrorCode OH_PhotoNative_GetMainImage(OH_PhotoNative* photo, OH_ImageNative* mainImage); +Camera_ErrorCode OH_PhotoNative_GetMainImage(OH_PhotoNative* photo, OH_ImageNative** mainImage); /** * @brief Release camera photo. -- Gitee From be21343d3ec9cca3806b09565d1bdff32f84ed97 Mon Sep 17 00:00:00 2001 From: zhaolinglan Date: Thu, 22 Aug 2024 15:10:46 +0800 Subject: [PATCH 120/620] modify capi Signed-off-by: zhaolinglan --- .../include/inputmethod_controller_capi.h | 9 +++++-- .../inputmethod_inputmethod_proxy_capi.h | 15 ++++++++++++ .../inputmethod_private_command_capi.h | 3 +++ inputmethod/include/inputmethod_types_capi.h | 24 +++++++++++-------- 4 files changed, 39 insertions(+), 12 deletions(-) diff --git a/inputmethod/include/inputmethod_controller_capi.h b/inputmethod/include/inputmethod_controller_capi.h index 230c7ffd4..b362e897e 100644 --- a/inputmethod/include/inputmethod_controller_capi.h +++ b/inputmethod/include/inputmethod_controller_capi.h @@ -57,7 +57,10 @@ extern "C" { * Lifecycle is mantianed until the next attach or detach call. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. - * {@link IME_ERR_PARAMCHECK} - The error code for common invalid args. + * {@link IME_ERR_PARAMCHECK} - parameter check failed. + * {@link IME_ERR_IMCLIENT} - input method client error. + * {@link IME_ERR_IMMS} - input method manager service error. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 12 */ @@ -71,7 +74,9 @@ InputMethod_ErrorCode OH_InputMethodController_Attach(InputMethod_TextEditorProx * The inputMethodProxy is obtained from {@link OH_InputMethodController_Attach}. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. - * {@link IME_ERR_PARAMCHECK} - The error code for common invalid args. + * {@link IME_ERR_IMCLIENT} - input method client error. + * {@link IME_ERR_IMMS} - input method manager service error. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 12 */ diff --git a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h index fc2dc3b3d..3660300b4 100644 --- a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h +++ b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h @@ -58,6 +58,8 @@ typedef struct InputMethod_InputMethodProxy InputMethod_InputMethodProxy; * The inputMethodProxy is obtained from {@link OH_InputMethodController_Attach}. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. + * {@link IME_ERR_IMCLIENT} - input method client error. + * {@link IME_ERR_IMMS} - input method manager service error. * {@link IME_ERR_DETACHED} - input method client is detached. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. @@ -72,6 +74,8 @@ InputMethod_ErrorCode OH_InputMethodProxy_ShowKeyboard(InputMethod_InputMethodPr * The inputMethodProxy is obtained from {@link OH_InputMethodController_Attach}. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. + * {@link IME_ERR_IMCLIENT} - input method client error. + * {@link IME_ERR_IMMS} - input method manager service error. * {@link IME_ERR_DETACHED} - input method client is detached. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. @@ -92,6 +96,9 @@ InputMethod_ErrorCode OH_InputMethodProxy_HideKeyboard(InputMethod_InputMethodPr * @param end The end position of selected text. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. + * {@link IME_ERR_PARAMCHECK} - parameter check failed. + * {@link IME_ERR_IMCLIENT} - input method client error. + * {@link IME_ERR_IMMS} - input method manager service error. * {@link IME_ERR_DETACHED} - input method client is detached. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. @@ -109,6 +116,9 @@ InputMethod_ErrorCode OH_InputMethodProxy_NotifySelectionChange( * @param textType The text input type. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. + * {@link IME_ERR_PARAMCHECK} - parameter check failed. + * {@link IME_ERR_IMCLIENT} - input method client error. + * {@link IME_ERR_IMMS} - input method manager service error. * {@link IME_ERR_DETACHED} - input method client is detached. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. @@ -126,6 +136,9 @@ InputMethod_ErrorCode OH_InputMethodProxy_NotifyConfigurationChange(InputMethod_ * The cursor information. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. + * {@link IME_ERR_PARAMCHECK} - parameter check failed. + * {@link IME_ERR_IMCLIENT} - input method client error. + * {@link IME_ERR_IMMS} - input method manager service error. * {@link IME_ERR_DETACHED} - input method client is detached. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. @@ -144,6 +157,8 @@ InputMethod_ErrorCode OH_InputMethodProxy_NotifyCursorUpdate( * @return Returns a specific error code. * {@link IME_ERR_OK} - success. * {@link IME_ERR_PARAMCHECK} - parameter check failed. + * {@link IME_ERR_IMCLIENT} - input method client error. + * {@link IME_ERR_IMMS} - input method manager service error. * {@link IME_ERR_DETACHED} - input method client is detached. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. diff --git a/inputmethod/include/inputmethod_private_command_capi.h b/inputmethod/include/inputmethod_private_command_capi.h index df904f8a7..c3113aab7 100644 --- a/inputmethod/include/inputmethod_private_command_capi.h +++ b/inputmethod/include/inputmethod_private_command_capi.h @@ -154,6 +154,7 @@ InputMethod_ErrorCode OH_PrivateCommand_GetValueType( * @return Returns a specific error code. * {@link IME_ERR_OK} - success. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * {@link IME_ERR_QUERY_FAILED} - query failed, no bool value in command. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 12 */ @@ -166,6 +167,7 @@ InputMethod_ErrorCode OH_PrivateCommand_GetBoolValue(InputMethod_PrivateCommand * @return Returns a specific error code. * {@link IME_ERR_OK} - success. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * {@link IME_ERR_QUERY_FAILED} - query failed, no integer value in command. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 12 */ @@ -179,6 +181,7 @@ InputMethod_ErrorCode OH_PrivateCommand_GetIntValue(InputMethod_PrivateCommand * * @return Returns a specific error code. * {@link IME_ERR_OK} - success. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * {@link IME_ERR_QUERY_FAILED} - query failed, no string value in command. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 12 */ diff --git a/inputmethod/include/inputmethod_types_capi.h b/inputmethod/include/inputmethod_types_capi.h index e88aa8837..53844e2e0 100644 --- a/inputmethod/include/inputmethod_types_capi.h +++ b/inputmethod/include/inputmethod_types_capi.h @@ -42,7 +42,7 @@ extern "C"{ * * @since 12 */ -typedef enum { +typedef enum InputMethod_KeyboardStatus { /** * The keyboard status is none. */ @@ -62,7 +62,7 @@ typedef enum { * * @since 12 */ -typedef enum { +typedef enum InputMethod_EnterKeyType { /** * The enter key type is UNSPECIFIED. */ @@ -106,7 +106,7 @@ typedef enum { * * @since 12 */ -typedef enum { +typedef enum InputMethod_Direction { /** * The direction is NONE. */ @@ -134,7 +134,7 @@ typedef enum { * * @since 12 */ -typedef enum { +typedef enum InputMethod_ExtendAction { /** * Select all text. */ @@ -158,7 +158,7 @@ typedef enum { * * @since 12 */ -typedef enum { +typedef enum InputMethod_TextInputType { /** * The text input type is NONE. */ @@ -222,7 +222,7 @@ typedef enum { * * @since 12 */ -typedef enum { +typedef enum InputMethod_CommandValueType { /** * Value type is NONE. */ @@ -246,16 +246,16 @@ typedef enum { * * @since 12 */ -typedef enum { +typedef enum InputMethod_ErrorCode { /** * The error code in the correct case. */ IME_ERR_OK = 0, /** - * The error code when query failed. + * The error code when error is undefined. */ - IME_ERR_QUERY_FAILED = 1, + IME_ERR_UNDEFINED = 1, /** * The error code when parameter check failed. */ @@ -295,7 +295,11 @@ typedef enum { /** * The error code when unexpected null pointer. */ - IME_ERR_NULL_POINTER = 12800010, + IME_ERR_NULL_POINTER = 12802000, + /** + * The error code when query failed. + */ + IME_ERR_QUERY_FAILED = 12802001, } InputMethod_ErrorCode; #ifdef __cplusplus } -- Gitee From c8270c301efd7c744cc13c14017b86e1aea65251 Mon Sep 17 00:00:00 2001 From: PengKejie Date: Thu, 22 Aug 2024 15:57:54 +0800 Subject: [PATCH 121/620] code format Signed-off-by: PengKejie --- .../native_drawing/drawing_text_typography.h | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 521534ee1..66254efd5 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1031,19 +1031,19 @@ double OH_Drawing_TypographyGetHeight(OH_Drawing_Typography*); */ double OH_Drawing_TypographyGetLongestLine(OH_Drawing_Typography*); - /** - * @brief Obtains the width of the longest line with indent. You are advised to round up the return value in actual use. - * When the text content is empty, the minimum float value, - * that is, -340282346638528859811704183484516925440.000000, is returned. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Pointer to an OH_Drawing_Typography object, which is obtained by - * {@link OH_Drawing_CreateTypography}. - * @return Returns the width of the longest line with indent. - * @since 12 - * @version 1.1 - */ - double OH_Drawing_TypographyGetLongestLineWithIndent(OH_Drawing_Typography*); +/** + * @brief Obtains the width of the longest line with indent. You are advised to + * round up the return value in actual use. When the text content is empty, the + * minimum float value, that is, 0.0, is returned. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography Pointer to an OH_Drawing_Typography object, which is obtained by + * {@link OH_Drawing_CreateTypography}. + * @return Returns the width of the longest line with indent. + * @since 12 + * @version 1.1 + */ +double OH_Drawing_TypographyGetLongestLineWithIndent(OH_Drawing_Typography*); /** * @brief Gets the min intrinsic width. -- Gitee From bbc34c41667c98aa036978569c434c9d20419485 Mon Sep 17 00:00:00 2001 From: GuoLi Date: Thu, 22 Aug 2024 16:26:12 +0800 Subject: [PATCH 122/620] =?UTF-8?q?=E7=BD=91=E7=BB=9C=E7=AE=A1=E7=90=86NDK?= =?UTF-8?q?=E8=AF=AD=E6=B3=95=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: GuoLi --- network/netmanager/include/net_connection_type.h | 1 + 1 file changed, 1 insertion(+) diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index 36f68e874..6e27fa214 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -39,6 +39,7 @@ */ #include +#include #ifdef __cplusplus extern "C" { -- Gitee From 5bba20352d79f80b825cdf9304dd0de6d67b8c39 Mon Sep 17 00:00:00 2001 From: huangji731 Date: Thu, 22 Aug 2024 10:08:40 +0800 Subject: [PATCH 123/620] https://gitee.com/openharmony/interface_sdk_c/issues/IALLYK Signed-off-by: huangji731 --- arkui/display_manager/BUILD.gn | 35 +++ arkui/display_manager/libdm.ndk.json | 82 ++++++ arkui/display_manager/oh_display_info.h | 204 +++++++++++++ arkui/display_manager/oh_display_manager.h | 318 +++++++++++++++++++++ 4 files changed, 639 insertions(+) create mode 100644 arkui/display_manager/BUILD.gn create mode 100644 arkui/display_manager/libdm.ndk.json create mode 100644 arkui/display_manager/oh_display_info.h create mode 100644 arkui/display_manager/oh_display_manager.h diff --git a/arkui/display_manager/BUILD.gn b/arkui/display_manager/BUILD.gn new file mode 100644 index 000000000..bfdc284ac --- /dev/null +++ b/arkui/display_manager/BUILD.gn @@ -0,0 +1,35 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_headers("display_manager_header") { + dest_dir = "$ndk_headers_out_dir/window_manager" + sources = [ + "oh_display_info.h", + "oh_display_manager.h", + ] +} + +ohos_ndk_library("native_display_manager") { + output_name = "native_display_manager" + output_extension = "so" + ndk_description_file = "./libdm.ndk.json" + system_capability = "SystemCapability.Window.SessionManager" + system_capability_headers = [ + "oh_display_info.h", + "oh_display_manager.h", + ] + min_compact_version = "12" +} diff --git a/arkui/display_manager/libdm.ndk.json b/arkui/display_manager/libdm.ndk.json new file mode 100644 index 000000000..5efd53561 --- /dev/null +++ b/arkui/display_manager/libdm.ndk.json @@ -0,0 +1,82 @@ +[ + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_GetDefaultDisplayId" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_GetDefaultDisplayWidth" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_GetDefaultDisplayHeight" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_GetDefaultDisplayRotation" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_GetDefaultDisplayOrientation" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_GetDefaultDisplayVirtualPixelRatio" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_GetDefaultDisplayRefreshRate" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_GetDefaultDisplayDensityDpi" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_GetDefaultDisplayDensityPixels" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_GetDefaultDisplayScaledDensity" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_GetDefaultDisplayDensityXdpi" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_GetDefaultDisplayDensityYdpi" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_CreateDefaultDisplayCutoutInfo" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_DestroyDefaultDisplayCutoutInfo" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_IsFoldable" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_GetFoldDisplayMode" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_RegisterFoldDisplayModeChangeListener" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_UnregisterFoldDisplayModeChangeListener" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_RegisterDisplayChangeListener" + }, + { + "first_instroduced":"12", + "name":"OH_NativeDisplayManager_UnregisterDisplayChangeListener" + } +] \ No newline at end of file diff --git a/arkui/display_manager/oh_display_info.h b/arkui/display_manager/oh_display_info.h new file mode 100644 index 000000000..3b6175884 --- /dev/null +++ b/arkui/display_manager/oh_display_info.h @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OH_NATIVE_DISPLAY_INFO_H +#define OH_NATIVE_DISPLAY_INFO_H + +/** + * @addtogroup OH_DisplayInfo + * @{ + * + * @brief Defines the data structures for the C APIs of the display module. + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + * @version 1.0 + */ + +/** + * @file oh_display_info.h + * + * @brief Defines the data structures for the C APIs of the display module. + * + * @kit ArkUI + * @library libnative_display_manager.so + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + * @version 1.0 + */ + +#include "stdint.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates rotations. + * + * @since 12 + * @version 1.0 + */ +typedef enum { + /** device rotation 0 degree */ + DISPLAY_MANAGER_ROTATION_0, + + /** device rotation 90 degrees */ + DISPLAY_MANAGER_ROTATION_90, + + /** device rotation 180 degrees */ + DISPLAY_MANAGER_ROTATION_180, + + /** device rotation 270 degree */ + DISPLAY_MANAGER_ROTATION_270, +} NativeDisplayManager_Rotation; + +/** + * @brief Enumerates orientations. + * + * @since 12 + * @version 1.0 + */ +typedef enum { + /** device portrait show */ + DISPLAY_MANAGER_PORTRAIT = 0, + + /** device landscape show */ + DISPLAY_MANAGER_LANDSCAPE = 1, + + /** device portrait inverted show */ + DISPLAY_MANAGER_PORTRAIT_INVERTED = 2, + + /** device landscape inverted show */ + DISPLAY_MANAGER_LANDSCAPE_INVERTED = 3, + + /** device unknow show */ + DISPLAY_MANAGER_UNKNOWN, +} NativeDisplayManager_Orientation; + +/** + * @brief Enumerates the result types of the display manager interface. + * + * @since 12 + * @version 1.0 + */ +typedef enum { + /** @error Operation is successful */ + DISPLAY_MANAGER_OK = 0, + + /** @error Operation no permission */ + DISPLAY_MANAGER_ERROR_NO_PERMISSION = 201, + + /** @error Operation not system app */ + DISPLAY_MANAGER_ERROR_NOT_SYSTEM_APP = 202, + + /** @error Operation invalid param */ + DISPLAY_MANAGER_ERROR_INVALID_PARAM = 401, + + /** @error Operation device not supported */ + DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED = 801, + + /** @error Operation screen invalid */ + DISPLAY_MANAGER_ERROR_INVALID_SCREEN = 1400001, + + /** @error Operation invalid call */ + DISPLAY_MANAGER_ERROR_INVALID_CALL = 1400002, + + /** @error Operation system abnormal */ + DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL = 1400003, +} NativeDisplayManager_ErrorCode; + +/** + * @brief Enumerates the fold display mode. + * + * @since 12 + * @version 1.0 + */ +typedef enum { + /** display mode unknown */ + DISPLAY_MANAGER_FOLD_DISPLAY_MODE_UNKNOWN = 0, + + /** display mode full */ + DISPLAY_MANAGER_FOLD_DISPLAY_MODE_FULL = 1, + + /** display mode main */ + DISPLAY_MANAGER_FOLD_DISPLAY_MODE_MAIN = 2, + + /** display mode sub */ + DISPLAY_MANAGER_FOLD_DISPLAY_MODE_SUB = 3, + + /** display mode coordination */ + DISPLAY_MANAGER_FOLD_DISPLAY_MODE_COORDINATION = 4, +} NativeDisplayManager_FoldDisplayMode; + +/** + * @brief Defines the display rect data structure. + * + * @since 12 + * @version 1.0 + */ +typedef struct { + /* rect left */ + int32_t left; + /* rect top */ + int32_t top; + /* rect width */ + uint32_t width; + /* rect height */ + uint32_t height; +} NativeDisplayManager_Rect; + +/** + * @brief Defines the display waterfallDisplayAreaRects data structure. + * + * @since 12 + * @version 1.0 + */ +typedef struct { + /* waterfall left rect */ + NativeDisplayManager_Rect left; + + /* waterfall top rect */ + NativeDisplayManager_Rect top; + + /* waterfall right rect */ + NativeDisplayManager_Rect right; + + /* waterfall bottom rect */ + NativeDisplayManager_Rect bottom; +} NativeDisplayManager_WaterfallDisplayAreaRects; + +/** + * @brief Defines the display cutout info data structure. + * + * @since 12 + * @version 1.0 + */ +typedef struct { + /* boundingRects length */ + int32_t boundingRectsLength; + + /* boundingRects info pointer */ + NativeDisplayManager_Rect *boundingRects; + + /* waterfallDisplayAreaRects info */ + NativeDisplayManager_WaterfallDisplayAreaRects waterfallDisplayAreaRects; +} NativeDisplayManager_CutoutInfo; + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif // OH_NATIVE_DISPLAY_INFO_H \ No newline at end of file diff --git a/arkui/display_manager/oh_display_manager.h b/arkui/display_manager/oh_display_manager.h new file mode 100644 index 000000000..a3b9f3444 --- /dev/null +++ b/arkui/display_manager/oh_display_manager.h @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OH_NATIVE_DISPLAY_MANAGER_H +#define OH_NATIVE_DISPLAY_MANAGER_H + +/** + * @addtogroup OH_DisplayManager + * @{ + * + * @brief Defines the data structures for the C APIs of the display module. + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + * @version 1.0 + */ + +/** + * @file oh_display_manager.h + * + * @brief Defines the data structures for the C APIs of the display module. + * + * @kit ArkUI + * @library libnative_display_manager.so. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + * @version 1.0 + */ + +#include "oh_display_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Obtain the default display Id. + * + * @param { *displayId } Indicates the pointer to an uint64_t object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayId(uint64_t *displayId); + +/** + * @brief Obtain the default display width. + * + * @param { *displayWidth } Indicates the pointer to an int32_t object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayWidth(int32_t *displayWidth); + +/** + * @brief Obtain the default display height. + * + * @param { *displayHeight } Indicates the pointer to an int32_t object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayHeight(int32_t *displayHeight); + +/** + * @brief Obtain the default display rotation. + * + * @param { *displayRotation } Indicates the pointer to an NativeDisplayManager_Rotation object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayRotation( + NativeDisplayManager_Rotation *displayRotation); + +/** + * @brief Obtain the default display orientation. + * + * @param { *displayOrientation } Indicates the pointer to an NativeDisplayManager_Orientation object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayOrientation( + NativeDisplayManager_Orientation *displayOrientation); + +/** + * @brief Obtain the default display virtualPixels. + * + * @param { *virtualPixels } Indicates the pointer to an float object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayVirtualPixelRatio(float *virtualPixels); + +/** + * @brief Obtain the default display refreshRate. + * + * @param { *refreshRate } Indicates the pointer to an uint32_t object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayRefreshRate(uint32_t *refreshRate); + +/** + * @brief Obtain the default display densityDpi. + * + * @param { *densityDpi } Indicates the pointer to an int32_t object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityDpi(int32_t *densityDpi); + +/** + * @brief Obtain the default display densityPixels. + * + * @param { *densityPixels } Indicates the pointer to an float object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityPixels(float *densityPixels); + +/** + * @brief Obtain the default display scaledDensity. + * + * @param { *scaledDensity } Indicates the pointer to an float object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayScaledDensity(float *scaledDensity); + +/** + * @brief Obtain the default display xDpi. + * + * @param { *xDpi } Indicates the pointer to an float object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityXdpi(float *xDpi); + +/** + * @brief Obtain the default display yDpi. + * + * @param { *yDpi } Indicates the pointer to an float object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityYdpi(float *yDpi); + +/** + * @brief Create the cutout info of the device. + * + * @param { **cutoutInfo } Indicates the pointer to an NativeDisplayManager_CutoutInfo object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateDefaultDisplayCutoutInfo( + NativeDisplayManager_CutoutInfo **cutoutInfo); + +/** + * @brief Destroy an NativeDisplayManager_CutoutInfo object and reclaims the memory occupied by the object. + * + * @param { **cutoutInfo } Indicates the pointer to an NativeDisplayManager_CutoutInfo object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_DestroyDefaultDisplayCutoutInfo( + NativeDisplayManager_CutoutInfo *cutoutInfo); + +/** + * @brief Check whether the device is foldable. + * + * @return { bool } true means the device is foldable. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +bool OH_NativeDisplayManager_IsFoldable(); + +/** + * @brief Get the display mode of the foldable device. + * + * @param { *displayMode } Indicates the pointer to an NativeDisplayManager_FoldDisplayMode object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. + * @syscap SystemCapability.Window.SessionManager + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetFoldDisplayMode( + NativeDisplayManager_FoldDisplayMode *displayMode); + +/** + * @brief the callback function type when display change. + * + * @param { *displayId } change display id. + * @syscap SystemCapability.Window.SessionManager + * @since 12 + */ +typedef void (*OH_NativeDisplayManager_DisplayChangeCallback)(uint64_t displayId); + +/** + * @brief Register the callback for display change listener. + * + * @param { displayChangeCallback } display change callback. + * @param { *listenerIndex } Indicates the pointer to an uint32_t object. used in unregister call. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterDisplayChangeListener( + OH_NativeDisplayManager_DisplayChangeCallback displayChangeCallback, uint32_t *listenerIndex); + +/** + * @brief Unregister the callback for display changes listener. + * + * @param { listenerIndex } display changed listener index. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterDisplayChangeListener(uint32_t listenerIndex); + +/** + * @brief the callback function type when display fold change. + * + * @param { displayMode } current fold display mode. + * @syscap SystemCapability.Window.SessionManager + * @since 12 + */ +typedef void (*OH_NativeDisplayManager_FoldDisplayModeChangeCallback)( + NativeDisplayManager_FoldDisplayMode displayMode); + +/** + * @brief Register the callback for display mode change listener. + * + * @param { displayModeChangeCallback } display mode change callback. + * @param { *listenerIndex } Indicates the pointer to an uint32_t object. used in unregister call. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterFoldDisplayModeChangeListener( + OH_NativeDisplayManager_FoldDisplayModeChangeCallback displayModeChangeCallback, uint32_t *listenerIndex); + +/** + * @brief Unregister the callback for display mode change listener. + * + * @param { listenerIndex } display mode change listener index. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager + * @since 12 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterFoldDisplayModeChangeListener(uint32_t listenerIndex); + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif // OH_NATIVE_DISPLAY_MANAGER_H -- Gitee From 11852cfaed6bcf997e1f89e47c8e893384af357c Mon Sep 17 00:00:00 2001 From: wuchengwen Date: Thu, 22 Aug 2024 17:42:15 +0800 Subject: [PATCH 124/620] add param to OH_InputMethodProxy_SendPrivateCommand Signed-off-by: wuchengwen --- inputmethod/include/inputmethod_inputmethod_proxy_capi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h index 3660300b4..f0b82f3d9 100644 --- a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h +++ b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h @@ -164,7 +164,8 @@ InputMethod_ErrorCode OH_InputMethodProxy_NotifyCursorUpdate( * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 12 */ -InputMethod_ErrorCode OH_InputMethodProxy_SendPrivateCommand(InputMethod_PrivateCommand *privateCommand[], size_t size); +InputMethod_ErrorCode OH_InputMethodProxy_SendPrivateCommand( + InputMethod_InputMethodProxy *inputMethodProxy, InputMethod_PrivateCommand *privateCommand[], size_t size); #ifdef __cplusplus } #endif /* __cplusplus */ -- Gitee From 4c1fb0ecd39f2aea931ee5f29ec0f0b295964334 Mon Sep 17 00:00:00 2001 From: yuhaoqiang Date: Fri, 19 Jul 2024 14:55:45 +0800 Subject: [PATCH 125/620] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=98=BE=E5=AD=98=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuhaoqiang --- hiviewdfx/hidebug/include/hidebug/hidebug.h | 12 ++++++++++++ hiviewdfx/hidebug/libhidebug.ndk.json | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug.h b/hiviewdfx/hidebug/include/hidebug/hidebug.h index a5bfec7b6..cd9eaa828 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug.h @@ -138,6 +138,18 @@ HiDebug_ErrorCode OH_HiDebug_StartAppTraceCapture(HiDebug_TraceFlag flag, */ HiDebug_ErrorCode OH_HiDebug_StopAppTraceCapture(); +/** + * @brief Get the graphics memory of application. + * + * @param value Indicates value of graphics memory, in kibibytes. + * @return Result code + * {@link HIDEBUG_SUCCESS} Get graphics memory success. + * {@link HIDEBUG_INVALID_ARGUMENT} Invalid argument,value is null. + * {@link HIDEBUG_TRACE_ABNORMAL} Failed to get the application memory due to a remote exception. + * @since 13 + */ +HiDebug_ErrorCode OH_HiDebug_GetGraphicsMemory(uint32_t *value); + #ifdef __cplusplus } #endif // __cplusplus diff --git a/hiviewdfx/hidebug/libhidebug.ndk.json b/hiviewdfx/hidebug/libhidebug.ndk.json index 5569c806d..45be9500b 100644 --- a/hiviewdfx/hidebug/libhidebug.ndk.json +++ b/hiviewdfx/hidebug/libhidebug.ndk.json @@ -34,5 +34,9 @@ { "first_introduced": "12", "name": "OH_HiDebug_StopAppTraceCapture" + }, + { + "first_introduced": "13", + "name": "OH_HiDebug_GetGraphicsMemory" } ] \ No newline at end of file -- Gitee From c34bdec912db2e05d10f93cecee8a574831a03d6 Mon Sep 17 00:00:00 2001 From: zhaolinglan Date: Thu, 22 Aug 2024 20:10:01 +0800 Subject: [PATCH 126/620] modify annotation Signed-off-by: zhaolinglan --- .../include/inputmethod_attach_options_capi.h | 11 ++++---- .../include/inputmethod_cursor_info_capi.h | 9 ++++--- .../inputmethod_private_command_capi.h | 11 ++++---- .../inputmethod_text_avoid_info_capi.h | 11 ++++---- .../include/inputmethod_text_config_capi.h | 11 ++++---- .../inputmethod_text_editor_proxy_capi.h | 11 ++++---- inputmethod/include/inputmethod_types_capi.h | 26 +++++++++---------- 7 files changed, 48 insertions(+), 42 deletions(-) diff --git a/inputmethod/include/inputmethod_attach_options_capi.h b/inputmethod/include/inputmethod_attach_options_capi.h index 491174372..3592ea3c5 100644 --- a/inputmethod/include/inputmethod_attach_options_capi.h +++ b/inputmethod/include/inputmethod_attach_options_capi.h @@ -51,17 +51,18 @@ typedef struct InputMethod_AttachOptions InputMethod_AttachOptions; * @brief Create a new {@link InputMethod_AttachOptions} instance. * * @param showKeyboard Represents whether to show the keyboard. - * @return Returns a pointer to the newly created {@link InputMethod_AttachOptions} instance. + * @return If the creation is successful, a pointer to the newly created {@link InputMethod_AttachOptions} instance is returned, + * otherwise, NULL is returned. * @since 12 */ -InputMethod_AttachOptions *OH_AttachOptions_New(bool showKeyboard); +InputMethod_AttachOptions *OH_AttachOptions_Create(bool showKeyboard); /** - * @brief Delete a {@link InputMethod_AttachOptions} instance. + * @brief Destroy a {@link InputMethod_AttachOptions} instance. * - * @param options Represents a pointer to an {@link InputMethod_AttachOptions} instance which will be deleted. + * @param options Represents a pointer to an {@link InputMethod_AttachOptions} instance which will be destroyed. * @since 12 */ -void OH_AttachOptions_Delete(InputMethod_AttachOptions *options); +void OH_AttachOptions_Destroy(InputMethod_AttachOptions *options); /** * @brief Get showKeyboard value from {@link InputMethod_AttachOptions}. * diff --git a/inputmethod/include/inputmethod_cursor_info_capi.h b/inputmethod/include/inputmethod_cursor_info_capi.h index d081e38d1..c9f272d2f 100644 --- a/inputmethod/include/inputmethod_cursor_info_capi.h +++ b/inputmethod/include/inputmethod_cursor_info_capi.h @@ -54,18 +54,19 @@ typedef struct InputMethod_CursorInfo InputMethod_CursorInfo; * @param top The top point of the cursor and must be absolute coordinate of the physical screen. * @param width The width of the cursor. * @param height The height of the cursor. - * @return Returns a pointer to the newly created {@link InputMethod_CursorInfo} instance. + * @return If the creation is successful, a pointer to the newly created {@link InputMethod_CursorInfo} instance is returned, + * otherwise, NULL is returned. * @since 12 */ -InputMethod_CursorInfo *OH_CursorInfo_New(double left, double top, double width, double height); +InputMethod_CursorInfo *OH_CursorInfo_Create(double left, double top, double width, double height); /** - * @brief Delete a {@link InputMethod_CursorInfo} instance. + * @brief Destroy a {@link InputMethod_CursorInfo} instance. * * @param cursorInfo Represents a pointer to an {@link InputMethod_CursorInfo} instance which will be deleted. * @since 12 */ -void OH_CursorInfo_Delete(InputMethod_CursorInfo *cursorInfo); +void OH_CursorInfo_Destroy(InputMethod_CursorInfo *cursorInfo); /** * @brief Set cursor info. diff --git a/inputmethod/include/inputmethod_private_command_capi.h b/inputmethod/include/inputmethod_private_command_capi.h index c3113aab7..bb3871f52 100644 --- a/inputmethod/include/inputmethod_private_command_capi.h +++ b/inputmethod/include/inputmethod_private_command_capi.h @@ -55,17 +55,18 @@ typedef struct InputMethod_PrivateCommand InputMethod_PrivateCommand; * * @param key The key of the private command. * @param keyLength The length of the key. - * @return Returns a pointer to the newly created {@link InputMethod_PrivateCommand} instance. + * @return If the creation is successful, a pointer to the newly created {@link InputMethod_PrivateCommand} instance is returned, + * otherwise, NULL is returned. * @since 12 */ -InputMethod_PrivateCommand *OH_PrivateCommand_New(char key[], size_t keyLength); +InputMethod_PrivateCommand *OH_PrivateCommand_Create(char key[], size_t keyLength); /** - * @brief Delete a {@link InputMethod_PrivateCommand} instance. + * @brief Destroy a {@link InputMethod_PrivateCommand} instance. * - * @param command Represents a pointer to an {@link InputMethod_PrivateCommand} instance which will be deleted. + * @param command Represents a pointer to an {@link InputMethod_PrivateCommand} instance which will be destroyed. * @since 12 */ -void OH_PrivateCommand_Delete(InputMethod_PrivateCommand *command); +void OH_PrivateCommand_Destroy(InputMethod_PrivateCommand *command); /** * @brief Set key value into {@link InputMethod_PrivateCommand}. * diff --git a/inputmethod/include/inputmethod_text_avoid_info_capi.h b/inputmethod/include/inputmethod_text_avoid_info_capi.h index 0e74eb350..dd7f5e944 100644 --- a/inputmethod/include/inputmethod_text_avoid_info_capi.h +++ b/inputmethod/include/inputmethod_text_avoid_info_capi.h @@ -53,17 +53,18 @@ typedef struct InputMethod_TextAvoidInfo InputMethod_TextAvoidInfo; * * @param positionY The y-coordinate of the avoid area. * @param height The height of the avoid area. - * @return Returns a pointer to the newly created {@link InputMethod_TextAvoidInfo} instance. + * @return If the creation is successful, a pointer to the newly created {@link InputMethod_TextAvoidInfo} instance is returned, + * otherwise, NULL is returned. * @since 12 */ -InputMethod_TextAvoidInfo *OH_TextAvoidInfo_New(double positionY, double height); +InputMethod_TextAvoidInfo *OH_TextAvoidInfo_Create(double positionY, double height); /** - * @brief Delete a {@link InputMethod_TextAvoidInfo} instance. + * @brief Destroy a {@link InputMethod_TextAvoidInfo} instance. * - * @param options Represents a pointer to an {@link InputMethod_TextAvoidInfo} instance which will be deleted. + * @param options Represents a pointer to an {@link InputMethod_TextAvoidInfo} instance which will be destroyed. * @since 12 */ -void OH_TextAvoidInfo_Delete(InputMethod_TextAvoidInfo *info); +void OH_TextAvoidInfo_Destroy(InputMethod_TextAvoidInfo *info); /** * @brief Set positionY value into {@link InputMethod_TextAvoidInfo}. * diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index 5d6feff67..29c7059b0 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -55,17 +55,18 @@ typedef struct InputMethod_TextConfig InputMethod_TextConfig; /** * @brief Create a new {@link InputMethod_TextConfig} instance. * - * @return Returns a pointer to the newly created {@link InputMethod_TextConfig} instance. + * @return If the creation is successful, a pointer to the newly created {@link InputMethod_TextConfig} instance is returned, + * otherwise, NULL is returned. * @since 12 */ -InputMethod_TextConfig *OH_TextConfig_New(); +InputMethod_TextConfig *OH_TextConfig_Create(); /** - * @brief Delete a {@link InputMethod_TextConfig} instance. + * @brief Destroy a {@link InputMethod_TextConfig} instance. * - * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be deleted. + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be destroyed. * @since 12 */ -void OH_TextConfig_Delete(InputMethod_TextConfig *config); +void OH_TextConfig_Destroy(InputMethod_TextConfig *config); /** * @brief Set input type into TextConfig. diff --git a/inputmethod/include/inputmethod_text_editor_proxy_capi.h b/inputmethod/include/inputmethod_text_editor_proxy_capi.h index 038cec2a0..5d22bd37e 100644 --- a/inputmethod/include/inputmethod_text_editor_proxy_capi.h +++ b/inputmethod/include/inputmethod_text_editor_proxy_capi.h @@ -261,17 +261,18 @@ typedef void (*OH_TextEditorProxy_FinishTextPreviewFunc)(InputMethod_TextEditorP /** * @brief Create a new {@link InputMethod_TextEditorProxy} instance. * - * @return Returns a pointer to the newly created {@link InputMethod_TextEditorProxy} instance. + * @return If the creation is successful, a pointer to the newly created {@link InputMethod_TextEditorProxy} instance is returned, + * otherwise, NULL is returned. * @since 12 */ -InputMethod_TextEditorProxy *OH_TextEditorProxy_New(); +InputMethod_TextEditorProxy *OH_TextEditorProxy_Create(); /** - * @brief Delete a {@link InputMethod_TextEditorProxy} instance. + * @brief Destroy a {@link InputMethod_TextEditorProxy} instance. * - * @param proxy The {@link InputMethod_TextEditorProxy} instance to be deleted. + * @param proxy The {@link InputMethod_TextEditorProxy} instance to be destroyed. * @since 12 */ -void OH_TextEditorProxy_Delete(InputMethod_TextEditorProxy *proxy); +void OH_TextEditorProxy_Destroy(InputMethod_TextEditorProxy *proxy); /** * @brief Set function {@link OH_TextEditorProxy_GetTextConfigFunc} into {@link InputMethod_TextEditorProxy}. * diff --git a/inputmethod/include/inputmethod_types_capi.h b/inputmethod/include/inputmethod_types_capi.h index 53844e2e0..29abd4f41 100644 --- a/inputmethod/include/inputmethod_types_capi.h +++ b/inputmethod/include/inputmethod_types_capi.h @@ -248,56 +248,56 @@ typedef enum InputMethod_CommandValueType { */ typedef enum InputMethod_ErrorCode { /** - * The error code in the correct case. + * @error The error code in the correct case. */ IME_ERR_OK = 0, /** - * The error code when error is undefined. + * @error The error code when error is undefined. */ IME_ERR_UNDEFINED = 1, /** - * The error code when parameter check failed. + * @error The error code when parameter check failed. */ IME_ERR_PARAMCHECK = 401, /** - * The error code when the package manager error. + * @error The error code when the package manager error. */ IME_ERR_PACKAGEMANAGER = 12800001, /** - * The error code when input method engine error. + * @error The error code when input method engine error. */ IME_ERR_IMENGINE = 12800002, /** - * The error code when input method client error. + * @error The error code when input method client error. */ IME_ERR_IMCLIENT = 12800003, /** - * The error code when configuration persisting error. + * @error The error code when configuration persisting error. */ IME_ERR_CONFIG_PERSIST = 12800005, /** - * The error code when input method controller error. + * @error The error code when input method controller error. */ IME_ERR_CONTROLLER = 12800006, /** - * The error code when input method setting error. + * @error The error code when input method setting error. */ IME_ERR_SETTINGS = 12800007, /** - * The error code when input method manager service error. + * @error The error code when input method manager service error. */ IME_ERR_IMMS = 12800008, /** - * The error code when input method client is detached. + * @error The error code when input method client is detached. */ IME_ERR_DETACHED = 12800009, /** - * The error code when unexpected null pointer. + * @error The error code when unexpected null pointer. */ IME_ERR_NULL_POINTER = 12802000, /** - * The error code when query failed. + * @error The error code when query failed. */ IME_ERR_QUERY_FAILED = 12802001, } InputMethod_ErrorCode; -- Gitee From daa048af141e3ac1ae22905e5cd6109f3b648ef2 Mon Sep 17 00:00:00 2001 From: zhaolinglan Date: Thu, 22 Aug 2024 20:27:38 +0800 Subject: [PATCH 127/620] modify annotation Signed-off-by: zhaolinglan --- inputmethod/include/inputmethod_attach_options_capi.h | 4 ++-- inputmethod/include/inputmethod_cursor_info_capi.h | 4 ++-- inputmethod/include/inputmethod_private_command_capi.h | 4 ++-- inputmethod/include/inputmethod_text_avoid_info_capi.h | 4 ++-- inputmethod/include/inputmethod_text_config_capi.h | 4 ++-- inputmethod/include/inputmethod_text_editor_proxy_capi.h | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/inputmethod/include/inputmethod_attach_options_capi.h b/inputmethod/include/inputmethod_attach_options_capi.h index 3592ea3c5..7d6f13d0c 100644 --- a/inputmethod/include/inputmethod_attach_options_capi.h +++ b/inputmethod/include/inputmethod_attach_options_capi.h @@ -51,8 +51,8 @@ typedef struct InputMethod_AttachOptions InputMethod_AttachOptions; * @brief Create a new {@link InputMethod_AttachOptions} instance. * * @param showKeyboard Represents whether to show the keyboard. - * @return If the creation is successful, a pointer to the newly created {@link InputMethod_AttachOptions} instance is returned, - * otherwise, NULL is returned. + * @return If the creation is successful, a pointer to the newly created {@link InputMethod_AttachOptions} instance is returned. + * If the creation fails, NULL is returned, possible cause is insufficient memory. * @since 12 */ InputMethod_AttachOptions *OH_AttachOptions_Create(bool showKeyboard); diff --git a/inputmethod/include/inputmethod_cursor_info_capi.h b/inputmethod/include/inputmethod_cursor_info_capi.h index c9f272d2f..6d1796398 100644 --- a/inputmethod/include/inputmethod_cursor_info_capi.h +++ b/inputmethod/include/inputmethod_cursor_info_capi.h @@ -54,8 +54,8 @@ typedef struct InputMethod_CursorInfo InputMethod_CursorInfo; * @param top The top point of the cursor and must be absolute coordinate of the physical screen. * @param width The width of the cursor. * @param height The height of the cursor. - * @return If the creation is successful, a pointer to the newly created {@link InputMethod_CursorInfo} instance is returned, - * otherwise, NULL is returned. + * @return If the creation is successful, a pointer to the newly created {@link InputMethod_CursorInfo} instance is returned. + * If the creation fails, NULL is returned, possible cause is insufficient memory. * @since 12 */ InputMethod_CursorInfo *OH_CursorInfo_Create(double left, double top, double width, double height); diff --git a/inputmethod/include/inputmethod_private_command_capi.h b/inputmethod/include/inputmethod_private_command_capi.h index bb3871f52..189eaf2e1 100644 --- a/inputmethod/include/inputmethod_private_command_capi.h +++ b/inputmethod/include/inputmethod_private_command_capi.h @@ -55,8 +55,8 @@ typedef struct InputMethod_PrivateCommand InputMethod_PrivateCommand; * * @param key The key of the private command. * @param keyLength The length of the key. - * @return If the creation is successful, a pointer to the newly created {@link InputMethod_PrivateCommand} instance is returned, - * otherwise, NULL is returned. + * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_PrivateCommand} instance is returned. + * If the creation fails, NULL is returned, possible cause is insufficient memory. * @since 12 */ InputMethod_PrivateCommand *OH_PrivateCommand_Create(char key[], size_t keyLength); diff --git a/inputmethod/include/inputmethod_text_avoid_info_capi.h b/inputmethod/include/inputmethod_text_avoid_info_capi.h index dd7f5e944..dc17894b6 100644 --- a/inputmethod/include/inputmethod_text_avoid_info_capi.h +++ b/inputmethod/include/inputmethod_text_avoid_info_capi.h @@ -53,8 +53,8 @@ typedef struct InputMethod_TextAvoidInfo InputMethod_TextAvoidInfo; * * @param positionY The y-coordinate of the avoid area. * @param height The height of the avoid area. - * @return If the creation is successful, a pointer to the newly created {@link InputMethod_TextAvoidInfo} instance is returned, - * otherwise, NULL is returned. + * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_TextAvoidInfo} instance is returned. + * If the creation fails, NULL is returned, possible cause is insufficient memory. * @since 12 */ InputMethod_TextAvoidInfo *OH_TextAvoidInfo_Create(double positionY, double height); diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index 29c7059b0..7e9dc414e 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -55,8 +55,8 @@ typedef struct InputMethod_TextConfig InputMethod_TextConfig; /** * @brief Create a new {@link InputMethod_TextConfig} instance. * - * @return If the creation is successful, a pointer to the newly created {@link InputMethod_TextConfig} instance is returned, - * otherwise, NULL is returned. + * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_TextConfig} instance is returned. + * If the creation fails, NULL is returned, possible cause is insufficient memory. * @since 12 */ InputMethod_TextConfig *OH_TextConfig_Create(); diff --git a/inputmethod/include/inputmethod_text_editor_proxy_capi.h b/inputmethod/include/inputmethod_text_editor_proxy_capi.h index 5d22bd37e..9f0db8b03 100644 --- a/inputmethod/include/inputmethod_text_editor_proxy_capi.h +++ b/inputmethod/include/inputmethod_text_editor_proxy_capi.h @@ -261,8 +261,8 @@ typedef void (*OH_TextEditorProxy_FinishTextPreviewFunc)(InputMethod_TextEditorP /** * @brief Create a new {@link InputMethod_TextEditorProxy} instance. * - * @return If the creation is successful, a pointer to the newly created {@link InputMethod_TextEditorProxy} instance is returned, - * otherwise, NULL is returned. + * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_TextEditorProxy} instance is returned. + * If the creation fails, NULL is returned, possible cause is insufficient memory. * @since 12 */ InputMethod_TextEditorProxy *OH_TextEditorProxy_Create(); -- Gitee From fbebcf3b7642bd7bf325df87bdc93d010cfc0dcb Mon Sep 17 00:00:00 2001 From: huchang Date: Mon, 19 Aug 2024 11:47:34 +0800 Subject: [PATCH 128/620] add ndk interface of audiokit for web Signed-off-by: huchang Change-Id: I1aead9d26d78b9db7a8c9d3856a4c4e71ed27af1 --- multimedia/audio_framework/BUILD.gn | 2 + .../audio_manager/native_audio_manager.h | 83 +++++++++++++++++++ .../native_audio_routing_manager.h | 69 +++++++++++++++ .../common/native_audio_common.h | 35 ++++++++ .../common/native_audio_device_base.h | 49 +++++++++++ multimedia/audio_framework/ohaudio.ndk.json | 20 +++++ 6 files changed, 258 insertions(+) create mode 100644 multimedia/audio_framework/audio_manager/native_audio_manager.h diff --git a/multimedia/audio_framework/BUILD.gn b/multimedia/audio_framework/BUILD.gn index 2928db509..e3a53b3cf 100644 --- a/multimedia/audio_framework/BUILD.gn +++ b/multimedia/audio_framework/BUILD.gn @@ -18,6 +18,7 @@ ohos_ndk_headers("ohaudio_header") { dest_dir = "$ndk_headers_out_dir/ohaudio" sources = [ "audio_capturer/native_audiocapturer.h", + "audio_manager/native_audio_manager.h", "audio_manager/native_audio_routing_manager.h", "audio_manager/native_audio_session_manager.h", "audio_renderer/native_audiorenderer.h", @@ -38,6 +39,7 @@ ohos_ndk_library("libohaudio_ndk") { "ohaudio/native_audiostreambuilder.h", "ohaudio/native_audiorenderer.h", "ohaudio/native_audiocapturer.h", + "ohaudio/native_audio_manager.h", "ohaudio/native_audio_routing_manager.h", "ohaudio/native_audio_common.h", "ohaudio/native_audio_device_base.h", diff --git a/multimedia/audio_framework/audio_manager/native_audio_manager.h b/multimedia/audio_framework/audio_manager/native_audio_manager.h new file mode 100644 index 000000000..b25ae98d8 --- /dev/null +++ b/multimedia/audio_framework/audio_manager/native_audio_manager.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup OHAudio + * @{ + * + * @brief Provide the definition of the C interface for the audio module. + * + * @syscap SystemCapability.Multimedia.Audio.Core + * + * @since 12 + * @version 1.0 + */ + +/** + * @file native_audio_manager.h + * + * @brief Declare audio manager related interfaces. + * + * @library libohaudio.so + * @syscap SystemCapability.Multimedia.Audio.Core + * @since 12 + * @version 1.0 + */ +#ifndef NATIVE_AUDIO_MANAGER_H +#define NATIVE_AUDIO_MANAGER_H + +#include "native_audio_common.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Declare the audio manager. + * The handle of audio manager is used for audio management related functions. + * + * @since 12 + */ +typedef struct OH_AudioManager OH_AudioManager; + +/** + * @brief Get audio manager handle. + * + * @param audioManager the {@link OH_AudioManager} handle received from this function. + * @return Function result code: + * {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful. + * {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}: + * 1.The param of audioManager is nullptr; + * @since 12 + */ +OH_AudioCommon_Result OH_GetAudioManager(OH_AudioManager **audioManager); + +/** + * @brief Get audio scene. + * @param audioManager the {@link OH_AudioManager} handle received from {@link OH_GetAudioManager}. + * @param scene the {@link OH_AudioScene} pointer to receive the result. + * @return Function result code: + * {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful. + * {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}: + * 1.The param of audioManager is nullptr; + * 2.The param of scene is nullptr. + * @since 12 + */ +OH_AudioCommon_Result OH_GetAudioScene(OH_AudioManager* manager, OH_AudioScene *scene); + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif // NATIVE_AUDIO_ROUTING_MANAGER_H \ No newline at end of file diff --git a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h index a34a8fbc0..153d37d39 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h @@ -113,6 +113,75 @@ OH_AudioCommon_Result OH_AudioRoutingManager_GetDevices( OH_AudioDevice_Flag deviceFlag, OH_AudioDeviceDescriptorArray **audioDeviceDescriptorArray); +/** + * @brief Get available devices by device usage. + * + * @param audioRoutingManager the {@link OH_AudioRoutingManager} handle returned + * by {@link OH_AudioManager_GetAudioRoutingManager}. + * @param deviceUsage the {@link OH_AudioDevice_Usage}. + * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} + * pointer variable which will be set the audio device descriptors value + * Do not release the audioDeviceDescriptorArray pointer separately + * instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array + * when it is no use anymore. + * @return Function result code: + * {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful. + * {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}: + * 1.The param of audioRoutingManager is nullptr; + * 2.The param of deviceUsage is invalid; + * 3.The param of audioDeviceDescriptorArray is nullptr. + * {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. + * @since 12 + */ +OH_AudioCommon_Result OH_AudioRoutingManager_GetAvailableDevices( + OH_AudioRoutingManager *audioRoutingManager, + OH_AudioDevice_Usage deviceUsage, OH_AudioDeviceDescriptorArray **audioDeviceDescriptorArray); + +/** + * @brief Get preferred ouput devices by audio usage. + * + * @param audioRoutingManager the {@link OH_AudioRoutingManager} handle returned + * by {@link OH_AudioManager_GetAudioRoutingManager}. + * @param streamUsage the {@link OH_AudioStream_Usage}. + * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} + * pointer variable which will be set the audio device descriptors value + * Do not release the audioDeviceDescriptorArray pointer separately + * instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array + * when it is no use anymore. + * @return Function result code: + * {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful. + * {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}: + * 1.The param of audioRoutingManager is nullptr; + * 2.The param of streamUsage is invalid; + * 3.The param of audioDeviceDescriptorArray is nullptr. + * {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. + * @since 12 + */ +OH_AudioCommon_Result OH_AudioRoutingManager_GetPreferredOutputDevice( + OH_AudioRoutingManager *audioRoutingManager, + OH_AudioStream_Usage streamUsage, OH_AudioDeviceDescriptorArray **audioDeviceDescriptorArray); + +/** + * @brief Get preferred input devices by audio source type. + * @param audioRoutingManager the {@link OH_AudioRoutingManager} handle returned + * by {@link OH_AudioManager_GetAudioRoutingManager}. + * @param sourceType the {@link OH_AudioStream_SourceType}. + * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} + * pointer variable which will be set the audio device descriptors value + * Do not release the audioDeviceDescriptorArray pointer separately + * instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array + * when it is no use anymore. + * @return Function result code: + * {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful. + * {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}: + * 1.The param of audioRoutingManager is nullptr; + * 2.The param of sourceType is invalid; + * 3.The param of audioDeviceDescriptorArray is nullptr. + * {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. + * @since 12 + */ +OH_AudioCommon_Result OH_AudioRoutingManager_GetPreferredInputDevice(OH_AudioRoutingManager *audioRoutingManager, + OH_AudioStream_SourceType sourceType, OH_AudioDeviceDescriptorArray **audioDeviceDescriptorArray); /** * @brief Register the device change callback of the audio routing manager. * diff --git a/multimedia/audio_framework/common/native_audio_common.h b/multimedia/audio_framework/common/native_audio_common.h index c0051b877..6a50df302 100644 --- a/multimedia/audio_framework/common/native_audio_common.h +++ b/multimedia/audio_framework/common/native_audio_common.h @@ -95,6 +95,41 @@ typedef enum { AUDIOCOMMON_RESULT_ERROR_SYSTEM = 6800301, } OH_AudioCommon_Result; +/** + * @brief Defines the audio scene. + * + * @since 12 + */ +typedef enum { + /** + * Default audio scene. + * + * @since 12 + */ + AUDIO_SCENE_DEFAULT = 0, + + /** + * Ringing scene. + * + * @since 12 + */ + AUDIO_SCENE_RINGING = 1, + + /** + * Phone call scene. + * + * @since 12 + */ + AUDIO_SCENE_PHONE_CALL = 2, + + /** + * Voice chat scene. + * + * @since 12 + */ + AUDIO_SCENE_VOICE_CHAT = 3, +} OH_AudioScene; + #ifdef __cplusplus } #endif diff --git a/multimedia/audio_framework/common/native_audio_device_base.h b/multimedia/audio_framework/common/native_audio_device_base.h index 6d7a6cef5..436fc6683 100644 --- a/multimedia/audio_framework/common/native_audio_device_base.h +++ b/multimedia/audio_framework/common/native_audio_device_base.h @@ -176,6 +176,55 @@ typedef enum { AUDIO_DEVICE_FLAG_ALL = 3, } OH_AudioDevice_Flag; +/** + * @brief Defines the audio device usage. + * + * @since 12 + */ +typedef enum { + /** + * @brief Device used for media ouput. + * + * @since 12 + */ + AUDIO_DEVICE_USAGE_MEDIA_OUTPUT = 1, + + /** + * @brief Device used for media input. + * + * @since 12 + */ + AUDIO_DEVICE_USAGE_MEDIA_INPUT = 2, + + /** + * @brief Device used for media, including input and output. + * + * @since 12 + */ + AUDIO_DEVICE_USAGE_MEDIA_ALL = 3, + + /** + * @brief Device used for call output. + * + * @since 12 + */ + AUDIO_DEVICE_USAGE_CALL_OUTPUT = 4, + + /** + * @brief Device used for call input. + * + * @since 12 + */ + AUDIO_DEVICE_USAGE_CALL_INPUT = 8, + + /** + * @brief Device used for call, including input and output. + * + * @since 12 + */ + AUDIO_DEVICE_USAGE_CALL_ALL = 12, +} OH_AudioDevice_Usage; + /** * @brief Declaring the audio device descriptor. * The instance is used to get more audio device detail attributes. diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index a4c82abf9..58b9ad34e 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -346,5 +346,25 @@ { "first_introduced": "12", "name":"OH_AudioSessionManager_UnregisterSessionDeactivatedCallback" + }, + { + "first_introduced": "12", + "name": "OH_GetAudioManager" + }, + { + "first_introduced": "12", + "name": "OH_GetAudioScene" + }, + { + "first_introduced": "12", + "name": "OH_AudioRoutingManager_GetAvailableDevices" + }, + { + "first_introduced": "12", + "name": "OH_AudioRoutingManager_GetPreferredOutputDevice" + }, + { + "first_introduced": "12", + "name": "OH_AudioRoutingManager_GetPreferredInputDevice" } ] -- Gitee From 1ad87e3e3d6cfd8c3b90a2effe9715a303be28fc Mon Sep 17 00:00:00 2001 From: wuchengwen Date: Thu, 22 Aug 2024 22:07:35 +0800 Subject: [PATCH 129/620] change new to create, delete to destory Signed-off-by: wuchengwen --- .../include/inputmethod_cursor_info_capi.h | 2 +- .../include/inputmethod_text_config_capi.h | 2 +- inputmethod/libohinputmethodndk.json | 26 +++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/inputmethod/include/inputmethod_cursor_info_capi.h b/inputmethod/include/inputmethod_cursor_info_capi.h index 6d1796398..407142cf2 100644 --- a/inputmethod/include/inputmethod_cursor_info_capi.h +++ b/inputmethod/include/inputmethod_cursor_info_capi.h @@ -63,7 +63,7 @@ InputMethod_CursorInfo *OH_CursorInfo_Create(double left, double top, double wid /** * @brief Destroy a {@link InputMethod_CursorInfo} instance. * - * @param cursorInfo Represents a pointer to an {@link InputMethod_CursorInfo} instance which will be deleted. + * @param cursorInfo Represents a pointer to an {@link InputMethod_CursorInfo} instance which will be destroyed. * @since 12 */ void OH_CursorInfo_Destroy(InputMethod_CursorInfo *cursorInfo); diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index 7e9dc414e..f2a707e02 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -104,7 +104,7 @@ InputMethod_ErrorCode OH_TextConfig_SetEnterKeyType( * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 12 */ -InputMethod_ErrorCode OH_TextConfig_SetIsPreviewTextSupported(InputMethod_TextConfig *config, bool supported); +InputMethod_ErrorCode OH_TextConfig_SetPreviewTextSupport(InputMethod_TextConfig *config, bool supported); /** * @brief Set selection into TextConfig. * diff --git a/inputmethod/libohinputmethodndk.json b/inputmethod/libohinputmethodndk.json index a20dda473..683c0a355 100644 --- a/inputmethod/libohinputmethodndk.json +++ b/inputmethod/libohinputmethodndk.json @@ -7,15 +7,15 @@ { "name": "OH_InputMethodProxy_NotifyConfigurationChange" }, { "name": "OH_InputMethodProxy_NotifyCursorUpdate" }, { "name": "OH_InputMethodProxy_SendPrivateCommand" }, - { "name": "OH_CursorInfo_New" }, - { "name": "OH_CursorInfo_Delete" }, + { "name": "OH_CursorInfo_Create" }, + { "name": "OH_CursorInfo_Destroy" }, { "name": "OH_CursorInfo_SetRect" }, { "name": "OH_CursorInfo_GetRect" }, - { "name": "OH_TextConfig_New" }, - { "name": "OH_TextConfig_Delete" }, + { "name": "OH_TextConfig_Create" }, + { "name": "OH_TextConfig_Destroy" }, { "name": "OH_TextConfig_SetInputType" }, { "name": "OH_TextConfig_SetEnterKeyType" }, - { "name": "OH_TextConfig_SetIsPreviewTextSupported" }, + { "name": "OH_TextConfig_SetPreviewTextSupport" }, { "name": "OH_TextConfig_SetSelection" }, { "name": "OH_TextConfig_SetWindowId" }, { "name": "OH_TextConfig_GetInputType" }, @@ -25,8 +25,8 @@ { "name": "OH_TextConfig_GetTextAvoidInfo" }, { "name": "OH_TextConfig_GetSelection" }, { "name": "OH_TextConfig_GetWindowId" }, - { "name": "OH_TextEditorProxy_New" }, - { "name": "OH_TextEditorProxy_Delete" }, + { "name": "OH_TextEditorProxy_Create" }, + { "name": "OH_TextEditorProxy_Destroy" }, { "name": "OH_TextEditorProxy_SetGetTextConfigFunc" }, { "name": "OH_TextEditorProxy_SetInsertTextFunc" }, { "name": "OH_TextEditorProxy_SetDeleteForwardFunc" }, @@ -57,17 +57,17 @@ { "name": "OH_TextEditorProxy_GetReceivePrivateCommandFunc" }, { "name": "OH_TextEditorProxy_GetSetPreviewTextFunc" }, { "name": "OH_TextEditorProxy_GetFinishTextPreviewFunc" }, - { "name": "OH_AttachOptions_New" }, - { "name": "OH_AttachOptions_Delete" }, + { "name": "OH_AttachOptions_Create" }, + { "name": "OH_AttachOptions_Destroy" }, { "name": "OH_AttachOptions_IsShowKeyboard" }, - { "name": "OH_TextAvoidInfo_New" }, - { "name": "OH_TextAvoidInfo_Delete" }, + { "name": "OH_TextAvoidInfo_Create" }, + { "name": "OH_TextAvoidInfo_Destroy" }, { "name": "OH_TextAvoidInfo_SetPositionY" }, { "name": "OH_TextAvoidInfo_SetHeight" }, { "name": "OH_TextAvoidInfo_GetPositionY" }, { "name": "OH_TextAvoidInfo_GetHeight" }, - { "name": "OH_PrivateCommand_New" }, - { "name": "OH_PrivateCommand_Delete" }, + { "name": "OH_PrivateCommand_Create" }, + { "name": "OH_PrivateCommand_Destroy" }, { "name": "OH_PrivateCommand_SetKey" }, { "name": "OH_PrivateCommand_SetBoolValue" }, { "name": "OH_PrivateCommand_SetIntValue" }, -- Gitee From ee99d1ed3dac108b800daed4253182545bc4efcd Mon Sep 17 00:00:00 2001 From: m00472246 Date: Thu, 22 Aug 2024 20:42:46 +0800 Subject: [PATCH 130/620] =?UTF-8?q?NDK=E5=AF=B9=E5=A4=96=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=A7=84=E6=A0=BC=E8=A1=A5=E5=85=85=20Signed-off-by:=20m004722?= =?UTF-8?q?46=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m00472246 --- .../graphic_2d/native_buffer/native_buffer.h | 46 ++++--- .../graphic_2d/native_image/native_image.h | 41 +++++-- .../native_window/external_window.h | 113 +++++++++++++----- 3 files changed, 145 insertions(+), 55 deletions(-) diff --git a/graphic/graphic_2d/native_buffer/native_buffer.h b/graphic/graphic_2d/native_buffer/native_buffer.h index fca0fc9a2..aee47ec3f 100644 --- a/graphic/graphic_2d/native_buffer/native_buffer.h +++ b/graphic/graphic_2d/native_buffer/native_buffer.h @@ -287,7 +287,10 @@ typedef struct { /** * @brief Alloc a OH_NativeBuffer that matches the passed BufferRequestConfig. \n - * A new OH_NativeBuffer instance is created each time this function is called. + * A new OH_NativeBuffer instance is created each time this function is called.\n + * This interface needs to be used in conjunction with OH_NativeBuffer_Unreference<\b>, + * otherwise memory leaks will occur.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param config Indicates the pointer to a BufferRequestConfig instance. @@ -299,7 +302,10 @@ typedef struct { OH_NativeBuffer* OH_NativeBuffer_Alloc(const OH_NativeBuffer_Config* config); /** - * @brief Adds the reference count of a OH_NativeBuffer. + * @brief Adds the reference count of a OH_NativeBuffer.\n + * This interface needs to be used in conjunction with OH_NativeBuffer_Unreference<\b>, + * otherwise memory leaks will occur.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -310,8 +316,9 @@ OH_NativeBuffer* OH_NativeBuffer_Alloc(const OH_NativeBuffer_Config* config); int32_t OH_NativeBuffer_Reference(OH_NativeBuffer *buffer); /** - * @brief Decreases the reference count of a OH_NativeBuffer and, when the reference count reaches 0, \n - * destroys this OH_NativeBuffer. + * @brief Decreases the reference count of a OH_NativeBuffer and, when the reference count reaches 0, + * destroys this OH_NativeBuffer.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -322,7 +329,8 @@ int32_t OH_NativeBuffer_Reference(OH_NativeBuffer *buffer); int32_t OH_NativeBuffer_Unreference(OH_NativeBuffer *buffer); /** - * @brief Return a config of the OH_NativeBuffer in the passed OHNativeBufferConfig struct. + * @brief Return a config of the OH_NativeBuffer in the passed OHNativeBufferConfig struct.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -334,7 +342,9 @@ int32_t OH_NativeBuffer_Unreference(OH_NativeBuffer *buffer); void OH_NativeBuffer_GetConfig(OH_NativeBuffer *buffer, OH_NativeBuffer_Config* config); /** - * @brief Provide direct cpu access to the OH_NativeBuffer in the process's address space. + * @brief Provide direct cpu access to the OH_NativeBuffer in the process's address space.\n + * This interface needs to be used in conjunction with OH_NativeBuffer_Unmap<\b>.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -347,7 +357,8 @@ void OH_NativeBuffer_GetConfig(OH_NativeBuffer *buffer, OH_NativeBuffer_Config* int32_t OH_NativeBuffer_Map(OH_NativeBuffer *buffer, void **virAddr); /** - * @brief Remove direct cpu access ability of the OH_NativeBuffer in the process's address space. + * @brief Remove direct cpu access ability of the OH_NativeBuffer in the process's address space.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -358,7 +369,8 @@ int32_t OH_NativeBuffer_Map(OH_NativeBuffer *buffer, void **virAddr); int32_t OH_NativeBuffer_Unmap(OH_NativeBuffer *buffer); /** - * @brief Get the systen wide unique sequence number of the OH_NativeBuffer. + * @brief Get the systen wide unique sequence number of the OH_NativeBuffer.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -369,7 +381,8 @@ int32_t OH_NativeBuffer_Unmap(OH_NativeBuffer *buffer); uint32_t OH_NativeBuffer_GetSeqNum(OH_NativeBuffer *buffer); /** - * @brief Provide direct cpu access to the potentially multi-plannar OH_NativeBuffer in the process's address space. + * @brief Provide direct cpu access to the potentially multi-plannar OH_NativeBuffer in the process's address space.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -382,7 +395,8 @@ uint32_t OH_NativeBuffer_GetSeqNum(OH_NativeBuffer *buffer); int32_t OH_NativeBuffer_MapPlanes(OH_NativeBuffer *buffer, void **virAddr, OH_NativeBuffer_Planes *outPlanes); /** - * @brief Converts an OHNativeWindowBuffer instance to an OH_NativeBuffer. + * @brief Converts an OHNativeWindowBuffer instance to an OH_NativeBuffer.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param nativeWindowBuffer Indicates the pointer to a OHNativeWindowBuffer instance. @@ -394,7 +408,8 @@ int32_t OH_NativeBuffer_MapPlanes(OH_NativeBuffer *buffer, void **virAddr, OH_Na int32_t OH_NativeBuffer_FromNativeWindowBuffer(OHNativeWindowBuffer *nativeWindowBuffer, OH_NativeBuffer **buffer); /** - * @brief Set the color space of the OH_NativeBuffer. + * @brief Set the color space of the OH_NativeBuffer.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -406,7 +421,8 @@ int32_t OH_NativeBuffer_FromNativeWindowBuffer(OHNativeWindowBuffer *nativeWindo int32_t OH_NativeBuffer_SetColorSpace(OH_NativeBuffer *buffer, OH_NativeBuffer_ColorSpace colorSpace); /** - * @brief Get the color space of the OH_NativeBuffer. + * @brief Get the color space of the OH_NativeBuffer.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -420,7 +436,8 @@ int32_t OH_NativeBuffer_SetColorSpace(OH_NativeBuffer *buffer, OH_NativeBuffer_C int32_t OH_NativeBuffer_GetColorSpace(OH_NativeBuffer *buffer, OH_NativeBuffer_ColorSpace *colorSpace); /** - * @brief Set the metadata type of the OH_NativeBuffer. + * @brief Set the metadata type of the OH_NativeBuffer.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -438,7 +455,8 @@ int32_t OH_NativeBuffer_SetMetadataValue(OH_NativeBuffer *buffer, OH_NativeBuffe int32_t size, uint8_t *metadata); /** - * @brief Set the metadata type of the OH_NativeBuffer. + * @brief Set the metadata type of the OH_NativeBuffer.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. diff --git a/graphic/graphic_2d/native_image/native_image.h b/graphic/graphic_2d/native_image/native_image.h index 56e10963d..0a12a14dc 100644 --- a/graphic/graphic_2d/native_image/native_image.h +++ b/graphic/graphic_2d/native_image/native_image.h @@ -79,6 +79,9 @@ typedef struct OH_OnFrameAvailableListener { /** * @brief Create a OH_NativeImage related to an Opengl ES texture and target. \n + * This interface needs to be used in conjunction with OH_NativeImage_Destroy<\b>, + * otherwise memory leaks will occur.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param textureId Indicates the id of the Opengl ES texture which the native image attached to. @@ -91,7 +94,8 @@ typedef struct OH_OnFrameAvailableListener { OH_NativeImage* OH_NativeImage_Create(uint32_t textureId, uint32_t textureTarget); /** - * @brief Acquire the OHNativeWindow for the OH_NativeImage. + * @brief Acquire the OHNativeWindow for the OH_NativeImage.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -103,7 +107,8 @@ OHNativeWindow* OH_NativeImage_AcquireNativeWindow(OH_NativeImage* image); /** * @brief Attach the OH_NativeImage to Opengl ES context, and the Opengl ES texture is bound to the \n - * GL_TEXTURE_EXTERNAL_OES, which will update by the OH_NativeImage. + * GL_TEXTURE_EXTERNAL_OES, which will update by the OH_NativeImage.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -115,7 +120,8 @@ OHNativeWindow* OH_NativeImage_AcquireNativeWindow(OH_NativeImage* image); int32_t OH_NativeImage_AttachContext(OH_NativeImage* image, uint32_t textureId); /** - * @brief Detach the OH_NativeImage from the Opengl ES context. + * @brief Detach the OH_NativeImage from the Opengl ES context.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -127,7 +133,10 @@ int32_t OH_NativeImage_AttachContext(OH_NativeImage* image, uint32_t textureId); int32_t OH_NativeImage_DetachContext(OH_NativeImage* image); /** - * @brief Update the related Opengl ES texture with the OH_NativeImage acquired buffer. + * @brief Update the related Opengl ES texture with the OH_NativeImage acquired buffer.\n + * This interface needs to be called in the Opengl ES context thread.\n + * This interface needs to be called after receiving the OH_OnFrameAvailableListener<\b> callback.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -138,7 +147,8 @@ int32_t OH_NativeImage_DetachContext(OH_NativeImage* image); int32_t OH_NativeImage_UpdateSurfaceImage(OH_NativeImage* image); /** - * @brief Get the timestamp of the texture image set by the most recent call to OH_NativeImage_UpdateSurfaceImage. + * @brief Get the timestamp of the texture image set by the most recent call to OH_NativeImage_UpdateSurfaceImage.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -164,7 +174,8 @@ int64_t OH_NativeImage_GetTimestamp(OH_NativeImage* image); int32_t OH_NativeImage_GetTransformMatrix(OH_NativeImage* image, float matrix[16]); /** - * @brief Return the native image's surface id. + * @brief Return the native image's surface id.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -176,7 +187,9 @@ int32_t OH_NativeImage_GetTransformMatrix(OH_NativeImage* image, float matrix[16 int32_t OH_NativeImage_GetSurfaceId(OH_NativeImage* image, uint64_t* surfaceId); /** - * @brief Set the frame available callback. + * @brief Set the frame available callback.\n + * Not allow calling other interfaces in the callback function.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -188,7 +201,8 @@ int32_t OH_NativeImage_GetSurfaceId(OH_NativeImage* image, uint64_t* surfaceId); int32_t OH_NativeImage_SetOnFrameAvailableListener(OH_NativeImage* image, OH_OnFrameAvailableListener listener); /** - * @brief Unset the frame available callback. + * @brief Unset the frame available callback.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -199,8 +213,9 @@ int32_t OH_NativeImage_SetOnFrameAvailableListener(OH_NativeImage* image, OH_OnF int32_t OH_NativeImage_UnsetOnFrameAvailableListener(OH_NativeImage* image); /** - * @brief Destroy the OH_NativeImage created by OH_NativeImage_Create, and the pointer to \n - * OH_NativeImage will be null after this operation. + * @brief Destroy the OH_NativeImage created by OH_NativeImage_Create, and the pointer to + * OH_NativeImage will be null after this operation.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage pointer. @@ -211,6 +226,8 @@ void OH_NativeImage_Destroy(OH_NativeImage** image); /** * @brief Obtains the transform matrix of the texture image by producer transform type.\n + * The matrix will not be update until OH_NativeImage_UpdateSurfaceImage<\b> is called.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -233,6 +250,7 @@ int32_t OH_NativeImage_GetTransformMatrixV2(OH_NativeImage* image, float matrix[ * This interface needs to be used in conjunction with OH_NativeImage_ReleaseNativeWindowBuffer<\b>, * otherwise memory leaks will occur.\n * When the fenceFd is used up, you need to close it.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -251,6 +269,7 @@ int32_t OH_NativeImage_AcquireNativeWindowBuffer(OH_NativeImage* image, * @brief Release the OHNativeWindowBuffer to the buffer queue through an * OH_NativeImage instance for reuse.\n * The fenceFd will be close by system.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -271,6 +290,8 @@ int32_t OH_NativeImage_ReleaseNativeWindowBuffer(OH_NativeImage* image, * This method can not be used at the same time with OH_NativeImage_UpdateSurfaceImage.\n * This interface needs to be used in conjunction with OH_NativeImage_Destroy<\b>, * otherwise memory leaks will occur.\n + * This interface dose not support concurrency.\n + * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @return Returns the pointer to the OH_NativeImage instance created if the operation is successful, \n * returns NULL otherwise. diff --git a/graphic/graphic_2d/native_window/external_window.h b/graphic/graphic_2d/native_window/external_window.h index 767e8c8ac..b8717daf2 100644 --- a/graphic/graphic_2d/native_window/external_window.h +++ b/graphic/graphic_2d/native_window/external_window.h @@ -399,7 +399,9 @@ typedef enum { OHNativeWindow* OH_NativeWindow_CreateNativeWindow(void* pSurface); /** - * @brief Decreases the reference count of a OHNativeWindow instance by 1, and when the reference count reaches 0, destroys the instance. + * @brief Decreases the reference count of a OHNativeWindow instance by 1, + * and when the reference count reaches 0, destroys the instance.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -422,8 +424,11 @@ void OH_NativeWindow_DestroyNativeWindow(OHNativeWindow* window); OHNativeWindowBuffer* OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer(void* pSurfaceBuffer); /** - * @brief Creates a OHNativeWindowBuffer instance. - A new OHNativeWindowBuffer instance is created each time this function is called. + * @brief Creates a OHNativeWindowBuffer instance.\n + * A new OHNativeWindowBuffer instance is created each time this function is called.\n + * This interface needs to be used in conjunction with OH_NativeWindow_DestroyNativeWindowBuffer<\b>, + * otherwise memory leaks will occur.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param nativeBuffer Indicates the pointer to a native buffer. The type is OH_NativeBuffer*. @@ -434,7 +439,9 @@ OHNativeWindowBuffer* OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer( OHNativeWindowBuffer* OH_NativeWindow_CreateNativeWindowBufferFromNativeBuffer(OH_NativeBuffer* nativeBuffer); /** - * @brief Decreases the reference count of a OHNativeWindowBuffer instance by 1 and, when the reference count reaches 0, destroys the instance. + * @brief Decreases the reference count of a OHNativeWindowBuffer instance by 1 and, + * when the reference count reaches 0, destroys the instance.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. @@ -444,7 +451,13 @@ OHNativeWindowBuffer* OH_NativeWindow_CreateNativeWindowBufferFromNativeBuffer(O void OH_NativeWindow_DestroyNativeWindowBuffer(OHNativeWindowBuffer* buffer); /** - * @brief Requests a OHNativeWindowBuffer through a OHNativeWindow instance for content production. + * @brief Requests a OHNativeWindowBuffer through a OHNativeWindow instance for content production.\n + * Before calling this interface, you need to set the width and height of + * OHNativeWindow through SET_BUFFER_GEOMETRY.\n + * This interface needs to be used in conjunction with OH_NativeWindow_NativeWindowFlushBuffer<\b>, + * otherwise buffer will be exhausted.\n + * When the fenceFd is used up, you need to close it.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -458,7 +471,10 @@ int32_t OH_NativeWindow_NativeWindowRequestBuffer(OHNativeWindow *window, OHNativeWindowBuffer **buffer, int *fenceFd); /** - * @brief Flushes the OHNativeWindowBuffer filled with the content to the buffer queue through a OHNativeWindow instance for content consumption. + * @brief Flushes the OHNativeWindowBuffer filled with the content to the buffer queue + * through a OHNativeWindow instance for content consumption.\n + * The fenceFd will be close by system.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -490,7 +506,9 @@ int32_t OH_NativeWindow_GetLastFlushedBuffer(OHNativeWindow *window, OHNativeWin int *fenceFd, float matrix[16]); /** - * @brief Returns the OHNativeWindowBuffer to the buffer queue through a OHNativeWindow instance, without filling in any content. The OHNativeWindowBuffer can be used for another request. + * @brief Returns the OHNativeWindowBuffer to the buffer queue through a OHNativeWindow instance, + * without filling in any content. The OHNativeWindowBuffer can be used for another request.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -502,7 +520,8 @@ int32_t OH_NativeWindow_GetLastFlushedBuffer(OHNativeWindow *window, OHNativeWin int32_t OH_NativeWindow_NativeWindowAbortBuffer(OHNativeWindow *window, OHNativeWindowBuffer *buffer); /** - * @brief Sets or obtains the attributes of a native window, including the width, height, and content format. + * @brief Sets or obtains the attributes of a native window, including the width, height, and content format.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -515,7 +534,8 @@ int32_t OH_NativeWindow_NativeWindowAbortBuffer(OHNativeWindow *window, OHNative int32_t OH_NativeWindow_NativeWindowHandleOpt(OHNativeWindow *window, int code, ...); /** - * @brief Obtains the pointer to a BufferHandle of a OHNativeWindowBuffer instance. + * @brief Obtains the pointer to a BufferHandle of a OHNativeWindowBuffer instance.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. @@ -526,7 +546,10 @@ int32_t OH_NativeWindow_NativeWindowHandleOpt(OHNativeWindow *window, int code, BufferHandle *OH_NativeWindow_GetBufferHandleFromNative(OHNativeWindowBuffer *buffer); /** - * @brief Adds the reference count of a native object. + * @brief Adds the reference count of a native object.\n + * This interface needs to be used in conjunction with OH_NativeWindow_NativeObjectUnreference<\b>, + * otherwise memory leaks will occur.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. @@ -537,7 +560,9 @@ BufferHandle *OH_NativeWindow_GetBufferHandleFromNative(OHNativeWindowBuffer *bu int32_t OH_NativeWindow_NativeObjectReference(void *obj); /** - * @brief Decreases the reference count of a native object and, when the reference count reaches 0, destroys this object. + * @brief Decreases the reference count of a native object and, + * when the reference count reaches 0, destroys this object.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. @@ -548,7 +573,8 @@ int32_t OH_NativeWindow_NativeObjectReference(void *obj); int32_t OH_NativeWindow_NativeObjectUnreference(void *obj); /** - * @brief Obtains the magic ID of a native object. + * @brief Obtains the magic ID of a native object.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. @@ -620,7 +646,10 @@ int32_t OH_NativeWindow_NativeWindowSetMetaDataSet(OHNativeWindow *window, uint3 int32_t OH_NativeWindow_NativeWindowSetTunnelHandle(OHNativeWindow *window, const OHExtDataHandle *handle); /** - * @brief Attach a buffer to an OHNativeWindow instance. + * @brief Attach a buffer to an OHNativeWindow instance.\n + * This interface needs to be used in conjunction with OH_NativeWindow_NativeWindowDetachBuffer<\b>, + * otherwise buffer management will be chaotic.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to an OHNativeWindow instance. @@ -632,7 +661,8 @@ int32_t OH_NativeWindow_NativeWindowSetTunnelHandle(OHNativeWindow *window, cons int32_t OH_NativeWindow_NativeWindowAttachBuffer(OHNativeWindow *window, OHNativeWindowBuffer *buffer); /** - * @brief Detach a buffer from an OHNativeWindow instance. + * @brief Detach a buffer from an OHNativeWindow instance.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to an OHNativeWindow instance. @@ -644,7 +674,8 @@ int32_t OH_NativeWindow_NativeWindowAttachBuffer(OHNativeWindow *window, OHNativ int32_t OH_NativeWindow_NativeWindowDetachBuffer(OHNativeWindow *window, OHNativeWindowBuffer *buffer); /** - * @brief Get surfaceId from native window. + * @brief Get surfaceId from native window.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to an OHNativeWindow instance. @@ -657,6 +688,14 @@ int32_t OH_NativeWindow_GetSurfaceId(OHNativeWindow *window, uint64_t *surfaceId /** * @brief Creates an OHNativeWindow instance.\n + * This interface needs to be used in conjunction with OH_NativeWindow_DestroyNativeWindow<\b>, + * otherwise memory leaks will occur.\n + * If there is a concurrent destroy OHNativeWindow, you need to add once and decrement once to the + * OHNativeWindow reference count through OH_NativeWindow_NativeObjectReference<\b> and + * OH_NativeWindow_NativeObjectUnreference<\b>.\n + * If the surface obtained through surfaceId is created in this process, the surface cannot be obtained + * across processes.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param surfaceId Indicates the surfaceId to a surface. @@ -668,7 +707,8 @@ int32_t OH_NativeWindow_GetSurfaceId(OHNativeWindow *window, uint64_t *surfaceId int32_t OH_NativeWindow_CreateNativeWindowFromSurfaceId(uint64_t surfaceId, OHNativeWindow **window); /** - * @brief Sets scalingMode of a native window. + * @brief Sets scalingMode of a native window.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window indicates the pointer to an OHNativeWindow instance. @@ -680,7 +720,8 @@ int32_t OH_NativeWindow_CreateNativeWindowFromSurfaceId(uint64_t surfaceId, OHNa int32_t OH_NativeWindow_NativeWindowSetScalingModeV2(OHNativeWindow *window, OHScalingModeV2 scalingMode); /** - * @brief Set native window buffer hold. + * @brief Set native window buffer hold.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to an OHNativeWindow instance. @@ -690,42 +731,48 @@ int32_t OH_NativeWindow_NativeWindowSetScalingModeV2(OHNativeWindow *window, OHS void OH_NativeWindow_SetBufferHold(OHNativeWindow *window); /** - * @brief Write an OHNativeWindow to an OHIPCParcel. + * @brief Write an OHNativeWindow to an OHIPCParcel.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to an OHNativeWindow instance. * @param parcel Indicates the pointer to an OHIPCParcel instance. - * @return 0 - Success. - * 40001000 - parcel is NULL or window is NULL. + * @return {@link NATIVE_ERROR_OK} 0 - Success. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - parcel is NULL or window is NULL. * @since 12 * @version 1.0 */ int32_t OH_NativeWindow_WriteToParcel(OHNativeWindow *window, OHIPCParcel *parcel); /** - * @brief Read an OHNativeWindow from an OHIPCParcel. + * @brief Read an OHNativeWindow from an OHIPCParcel.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param parcel Indicates the pointer to an OHIPCParcel instance. * @param window Indicates the pointer to an OHNativeWindow instance. - * @return 0 - Success. - * 40001000 - parcel is NULL or parcel does not contain the window. + * @return {@link NATIVE_ERROR_OK} 0 - Success. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - parcel is NULL or parcel does not contain the window. * @since 12 * @version 1.0 */ int32_t OH_NativeWindow_ReadFromParcel(OHIPCParcel *parcel, OHNativeWindow **window); /** - * @brief Get the last flushed OHNativeWindowBuffer from an OHNativeWindow instance. + * @brief Get the last flushed OHNativeWindowBuffer from an OHNativeWindow instance.\n + * When the fenceFd is used up, you need to close it.\n + * This interface needs to be used in conjunction with OH_NativeWindow_NativeObjectUnreference<\b>, + * otherwise memory leaks will occur.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to an OHNativeWindow instance. * @param buffer Indicates the pointer to an OHNativeWindowBuffer pointer. * @param fenceFd Indicates the pointer to a file descriptor handle. * @param matrix Indicates the retrieved 4*4 transform matrix. - * @return 0 - Success. - * 40001000 - window is NULL or buffer is NULL or fenceFd is NULL. - * 41207000 - buffer state is wrong. + * @return {@link NATIVE_ERROR_OK} 0 - Success. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - window is NULL or buffer is NULL or fenceFd is NULL. + * {@link NATIVE_ERROR_BUFFER_STATE_INVALID} 41207000 - buffer state is wrong. * @since 12 * @version 1.0 */ @@ -733,7 +780,8 @@ int32_t OH_NativeWindow_ReadFromParcel(OHIPCParcel *parcel, OHNativeWindow **win int32_t OH_NativeWindow_GetLastFlushedBufferV2(OHNativeWindow *window, OHNativeWindowBuffer **buffer, int *fenceFd, float matrix[16]); /** - * @brief Set the color space of the native window. + * @brief Set the color space of the native window.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -747,7 +795,8 @@ int32_t OH_NativeWindow_GetLastFlushedBufferV2(OHNativeWindow *window, OHNativeW int32_t OH_NativeWindow_SetColorSpace(OHNativeWindow *window, OH_NativeBuffer_ColorSpace colorSpace); /** - * @brief Get the color space of the native window. + * @brief Get the color space of the native window.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -761,7 +810,8 @@ int32_t OH_NativeWindow_SetColorSpace(OHNativeWindow *window, OH_NativeBuffer_Co int32_t OH_NativeWindow_GetColorSpace(OHNativeWindow *window, OH_NativeBuffer_ColorSpace *colorSpace); /** - * @brief Set the metadata type of the native window. + * @brief Set the metadata type of the native window.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -779,7 +829,8 @@ int32_t OH_NativeWindow_SetMetadataValue(OHNativeWindow *window, OH_NativeBuffer int32_t size, uint8_t *metadata); /** - * @brief Set the metadata type of the native window. + * @brief Set the metadata type of the native window.\n + * This interface dose not support concurrency.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. -- Gitee From 25017a376449eaf40886a793e152c6a4ff0ba075 Mon Sep 17 00:00:00 2001 From: zhaolinglan Date: Fri, 23 Aug 2024 10:21:33 +0800 Subject: [PATCH 131/620] modify annotation Signed-off-by: zhaolinglan --- inputmethod/include/inputmethod_attach_options_capi.h | 4 ++-- inputmethod/include/inputmethod_cursor_info_capi.h | 4 ++-- inputmethod/include/inputmethod_private_command_capi.h | 4 ++-- inputmethod/include/inputmethod_text_avoid_info_capi.h | 4 ++-- inputmethod/include/inputmethod_text_config_capi.h | 4 ++-- inputmethod/include/inputmethod_text_editor_proxy_capi.h | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/inputmethod/include/inputmethod_attach_options_capi.h b/inputmethod/include/inputmethod_attach_options_capi.h index 7d6f13d0c..d4ec119a7 100644 --- a/inputmethod/include/inputmethod_attach_options_capi.h +++ b/inputmethod/include/inputmethod_attach_options_capi.h @@ -51,8 +51,8 @@ typedef struct InputMethod_AttachOptions InputMethod_AttachOptions; * @brief Create a new {@link InputMethod_AttachOptions} instance. * * @param showKeyboard Represents whether to show the keyboard. - * @return If the creation is successful, a pointer to the newly created {@link InputMethod_AttachOptions} instance is returned. - * If the creation fails, NULL is returned, possible cause is insufficient memory. + * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_AttachOptions} + * instance is returned. If the creation fails, NULL is returned, possible cause is insufficient memory. * @since 12 */ InputMethod_AttachOptions *OH_AttachOptions_Create(bool showKeyboard); diff --git a/inputmethod/include/inputmethod_cursor_info_capi.h b/inputmethod/include/inputmethod_cursor_info_capi.h index 6d1796398..c199cee53 100644 --- a/inputmethod/include/inputmethod_cursor_info_capi.h +++ b/inputmethod/include/inputmethod_cursor_info_capi.h @@ -54,8 +54,8 @@ typedef struct InputMethod_CursorInfo InputMethod_CursorInfo; * @param top The top point of the cursor and must be absolute coordinate of the physical screen. * @param width The width of the cursor. * @param height The height of the cursor. - * @return If the creation is successful, a pointer to the newly created {@link InputMethod_CursorInfo} instance is returned. - * If the creation fails, NULL is returned, possible cause is insufficient memory. + * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_CursorInfo} + * instance is returned. If the creation fails, NULL is returned, possible cause is insufficient memory. * @since 12 */ InputMethod_CursorInfo *OH_CursorInfo_Create(double left, double top, double width, double height); diff --git a/inputmethod/include/inputmethod_private_command_capi.h b/inputmethod/include/inputmethod_private_command_capi.h index 189eaf2e1..6871a76bc 100644 --- a/inputmethod/include/inputmethod_private_command_capi.h +++ b/inputmethod/include/inputmethod_private_command_capi.h @@ -55,8 +55,8 @@ typedef struct InputMethod_PrivateCommand InputMethod_PrivateCommand; * * @param key The key of the private command. * @param keyLength The length of the key. - * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_PrivateCommand} instance is returned. - * If the creation fails, NULL is returned, possible cause is insufficient memory. + * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_PrivateCommand} + * instance is returned. If the creation fails, NULL is returned, possible cause is insufficient memory. * @since 12 */ InputMethod_PrivateCommand *OH_PrivateCommand_Create(char key[], size_t keyLength); diff --git a/inputmethod/include/inputmethod_text_avoid_info_capi.h b/inputmethod/include/inputmethod_text_avoid_info_capi.h index dc17894b6..9a707549b 100644 --- a/inputmethod/include/inputmethod_text_avoid_info_capi.h +++ b/inputmethod/include/inputmethod_text_avoid_info_capi.h @@ -53,8 +53,8 @@ typedef struct InputMethod_TextAvoidInfo InputMethod_TextAvoidInfo; * * @param positionY The y-coordinate of the avoid area. * @param height The height of the avoid area. - * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_TextAvoidInfo} instance is returned. - * If the creation fails, NULL is returned, possible cause is insufficient memory. + * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_TextAvoidInfo} + * instance is returned. If the creation fails, NULL is returned, possible cause is insufficient memory. * @since 12 */ InputMethod_TextAvoidInfo *OH_TextAvoidInfo_Create(double positionY, double height); diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index 7e9dc414e..d0b406159 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -55,8 +55,8 @@ typedef struct InputMethod_TextConfig InputMethod_TextConfig; /** * @brief Create a new {@link InputMethod_TextConfig} instance. * - * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_TextConfig} instance is returned. - * If the creation fails, NULL is returned, possible cause is insufficient memory. + * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_TextConfig} + * instance is returned. If the creation fails, NULL is returned, possible cause is insufficient memory. * @since 12 */ InputMethod_TextConfig *OH_TextConfig_Create(); diff --git a/inputmethod/include/inputmethod_text_editor_proxy_capi.h b/inputmethod/include/inputmethod_text_editor_proxy_capi.h index 9f0db8b03..64ebd4c04 100644 --- a/inputmethod/include/inputmethod_text_editor_proxy_capi.h +++ b/inputmethod/include/inputmethod_text_editor_proxy_capi.h @@ -261,8 +261,8 @@ typedef void (*OH_TextEditorProxy_FinishTextPreviewFunc)(InputMethod_TextEditorP /** * @brief Create a new {@link InputMethod_TextEditorProxy} instance. * - * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_TextEditorProxy} instance is returned. - * If the creation fails, NULL is returned, possible cause is insufficient memory. + * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_TextEditorProxy} + * instance is returned. If the creation fails, NULL is returned, possible cause is insufficient memory. * @since 12 */ InputMethod_TextEditorProxy *OH_TextEditorProxy_Create(); -- Gitee From f972c8305465113fd39706e331dd0268032f5fd6 Mon Sep 17 00:00:00 2001 From: lvshiqi Date: Fri, 23 Aug 2024 10:40:44 +0800 Subject: [PATCH 132/620] =?UTF-8?q?=E5=BC=82=E6=AD=A5=E7=BB=98=E5=88=B6ndk?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lvshiqi Change-Id: I454ccb8857b31df951d20579c6ca869d8e5f5fcc --- .../native_drawing/drawing_canvas.h | 13 ++ .../native_drawing/drawing_record_cmd.h | 121 ++++++++++++++++++ .../graphic_2d/native_drawing/drawing_types.h | 15 +++ .../native_drawing/libnative_drawing.ndk.json | 24 ++++ 4 files changed, 173 insertions(+) create mode 100644 graphic/graphic_2d/native_drawing/drawing_record_cmd.h diff --git a/graphic/graphic_2d/native_drawing/drawing_canvas.h b/graphic/graphic_2d/native_drawing/drawing_canvas.h index 4d1e8a0fa..783230ec9 100644 --- a/graphic/graphic_2d/native_drawing/drawing_canvas.h +++ b/graphic/graphic_2d/native_drawing/drawing_canvas.h @@ -828,6 +828,19 @@ OH_Drawing_ErrorCode OH_Drawing_CanvasIsClipEmpty(OH_Drawing_Canvas* canvas, boo */ OH_Drawing_ErrorCode OH_Drawing_CanvasGetImageInfo(OH_Drawing_Canvas* canvas, OH_Drawing_Image_Info* imageInfo); +/** + * @brief Replay drawing command. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param recordCmd Indicates the pointer to an OH_Drawing_RecordCmd object. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if canvas or recordCmd is nullptr. + * @since 13 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_Drawing_CanvasDrawRecordCmd(OH_Drawing_Canvas* canvas, OH_Drawing_RecordCmd* recordCmd); #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_record_cmd.h b/graphic/graphic_2d/native_drawing/drawing_record_cmd.h new file mode 100644 index 000000000..c5728f209 --- /dev/null +++ b/graphic/graphic_2d/native_drawing/drawing_record_cmd.h @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef C_INCLUDE_DRAWING_RECORD_CMD_H +#define C_INCLUDE_DRAWING_RECORD_CMD_H + +/** + * @addtogroup Drawing + * @{ + * + * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * + * @since 13 + * @version 1.0 + */ + +/** + * @file drawing_record_cmd.h + * + * @brief Declares functions related to the RecordCmd object in the drawing module. + * + * @library libnative_drawing.so + * @since 13 + * @version 1.0 + */ + +#include "drawing_types.h" +#include "drawing_error_code.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Creates an OH_Drawing_RecordCmdUtils object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @return Returns the pointer to the OH_Drawing_RecordCmdUtils object created. + * @since 13 + * @version 1.0 + */ +OH_Drawing_RecordCmdUtils* OH_Drawing_RecordCmdUtilsCreate(void); + +/** + * @brief Destroys an OH_Drawing_RecordCmdUtils object and reclaims the memory occupied by the object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param recordCmdUtils Indicates the pointer to an OH_Drawing_RecordCmdUtils object. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if recordCmdUtils is nullptr. + * @since 13 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsDestroy(OH_Drawing_RecordCmdUtils* recordCmdUtils); + +/** + * @brief Get the canvas that records the drawing command. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param recordCmdUtils Indicates the pointer to an OH_Drawing_RecordCmdUtils object. + * @param width Width of canvas object. + * @param height Height of canvas object. + * @param canvas Indicates a secondary pointer to an OH_Srawing_Canvasobject. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if recordCmdUtils or canvas is nullptr, + * width less than or equal to 0 or height less than or equal to 0. + * @since 13 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsBeginRecording(OH_Drawing_RecordCmdUtils* recordCmdUtils, + int32_t width, int32_t height, OH_Drawing_Canvas** canvas); + +/** + * @brief Finish the recording and get the recording command object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param recordCmdUtils Indicates the pointer to an OH_Drawing_RecordCmdUtils object. + * @param recordCmd Indicates a secondary pointer to an OH_Drawing_RecordCmd object. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if recordCmdUtils or recordCmd is nullptr. + * @since 13 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsFinishingRecording(OH_Drawing_RecordCmdUtils* recordCmdUtils, + OH_Drawing_RecordCmd** recordCmd); + +/** + * @brief Destroys an OH_Drawing_RecordCmd object and reclaims the memory occupied by the object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param recordCmd Indicates the pointer to an OH_Drawing_RecordCmd object. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if recordCmd is nullptr. + * @since 13 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_RecordCmdDestroy(OH_Drawing_RecordCmd* recordCmd); + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif \ No newline at end of file diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h index edcc71cb8..0755375b7 100644 --- a/graphic/graphic_2d/native_drawing/drawing_types.h +++ b/graphic/graphic_2d/native_drawing/drawing_types.h @@ -502,6 +502,21 @@ typedef struct OH_Drawing_FontMgr OH_Drawing_FontMgr; */ typedef struct OH_Drawing_FontStyleSet OH_Drawing_FontStyleSet; +/** + * @brief Define OH_Drawing_RecordCmdUtils, which is used to generate drawing commands tool. + * + * @since 13 + * @version 1.0 + */ +typedef struct OH_Drawing_RecordCmdUtils OH_Drawing_RecordCmdUtils; + +/** + * @brief Define OH_Drawing_RecordCmd, which is used to replay drawing commands. + * + * @since 13 + * @version 1.0 + */ +typedef struct OH_Drawing_RecordCmd OH_Drawing_RecordCmd; #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index f0d6835c1..5625ddbb0 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1441,5 +1441,29 @@ { "first_introduced": "12", "name":"OH_Drawing_SetTextShadow" + }, + { + "first_introduced": "13", + "name":"OH_Drawing_Drawing_CanvasDrawRecordCmd" + }, + { + "first_introduced": "13", + "name":"OH_Drawing_RecordCmdUtilsCreate" + }, + { + "first_introduced": "13", + "name":"OH_Drawing_RecordCmdUtilsDestroy" + }, + { + "first_introduced": "13", + "name":"OH_Drawing_RecordCmdUtilsBeginRecording" + }, + { + "first_introduced": "13", + "name":"OH_Drawing_RecordCmdUtilsFinishingRecording" + }, + { + "first_introduced": "13", + "name":"OH_Drawing_RecordCmdDestroy" } ] \ No newline at end of file -- Gitee From ccbc0b993420f3c41d3424b7404758f6bba9c0f3 Mon Sep 17 00:00:00 2001 From: zhuguoyang Date: Fri, 23 Aug 2024 10:44:26 +0800 Subject: [PATCH 133/620] attr Signed-off-by: zhuguoyang --- resourceschedule/ffrt/ffrt.ndk.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resourceschedule/ffrt/ffrt.ndk.json b/resourceschedule/ffrt/ffrt.ndk.json index ed52dcc3b..e0e760ce7 100644 --- a/resourceschedule/ffrt/ffrt.ndk.json +++ b/resourceschedule/ffrt/ffrt.ndk.json @@ -82,7 +82,7 @@ { "name": "ffrt_loop_timer_start" }, { "name": "ffrt_loop_timer_stop" }, { "name": "ffrt_queue_attr_set_max_concurrency" }, - { "name": "ffrt_queue_atte_get_max_concurrency" }, + { "name": "ffrt_queue_attr_get_max_concurrency" }, { "name": "ffrt_get_main_queue" }, { "name": "ffrt_get_current_queue" }, { "name": "ffrt_task_attr_set_queue_priority" }, -- Gitee From a6df8ce6988fa5ca83e581698c5e3dd81c7ffe2c Mon Sep 17 00:00:00 2001 From: lvshiqi Date: Fri, 23 Aug 2024 14:14:15 +0800 Subject: [PATCH 134/620] =?UTF-8?q?=E6=B7=BB=E5=8A=A0errorcode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lvshiqi Change-Id: If29b52399e8a8cff713409261f6dcaef85d09655 --- graphic/graphic_2d/native_drawing/drawing_error_code.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_error_code.h b/graphic/graphic_2d/native_drawing/drawing_error_code.h index b9d52fc51..3943f64fb 100644 --- a/graphic/graphic_2d/native_drawing/drawing_error_code.h +++ b/graphic/graphic_2d/native_drawing/drawing_error_code.h @@ -65,6 +65,10 @@ typedef enum { * @error The parameter is not in the valid range. */ OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE = 26200001, + /** + * @error mem allocate failed. + */ + OH_DRAWING_ERROR_ALLOCATION_FAILED = 26200002, } OH_Drawing_ErrorCode; /** -- Gitee From f59974562888723ee8a08ff3f3534d7e3172c686 Mon Sep 17 00:00:00 2001 From: wuchengwen Date: Fri, 23 Aug 2024 11:43:18 +0800 Subject: [PATCH 135/620] add } Signed-off-by: wuchengwen --- inputmethod/include/inputmethod_attach_options_capi.h | 3 ++- inputmethod/include/inputmethod_controller_capi.h | 1 + inputmethod/include/inputmethod_cursor_info_capi.h | 1 + inputmethod/include/inputmethod_inputmethod_proxy_capi.h | 1 + inputmethod/include/inputmethod_private_command_capi.h | 1 + inputmethod/include/inputmethod_text_avoid_info_capi.h | 1 + inputmethod/include/inputmethod_text_config_capi.h | 3 ++- inputmethod/include/inputmethod_text_editor_proxy_capi.h | 1 + inputmethod/include/inputmethod_types_capi.h | 1 + 9 files changed, 11 insertions(+), 2 deletions(-) diff --git a/inputmethod/include/inputmethod_attach_options_capi.h b/inputmethod/include/inputmethod_attach_options_capi.h index d4ec119a7..316bafd0b 100644 --- a/inputmethod/include/inputmethod_attach_options_capi.h +++ b/inputmethod/include/inputmethod_attach_options_capi.h @@ -57,7 +57,7 @@ typedef struct InputMethod_AttachOptions InputMethod_AttachOptions; */ InputMethod_AttachOptions *OH_AttachOptions_Create(bool showKeyboard); /** - * @brief Destroy a {@link InputMethod_AttachOptions} instance. + * @brief Delete a {@link InputMethod_AttachOptions} instance. * * @param options Represents a pointer to an {@link InputMethod_AttachOptions} instance which will be destroyed. * @since 12 @@ -80,4 +80,5 @@ InputMethod_ErrorCode OH_AttachOptions_IsShowKeyboard(InputMethod_AttachOptions #ifdef __cplusplus } #endif /* __cplusplus */ +/** @} */ #endif // OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_controller_capi.h b/inputmethod/include/inputmethod_controller_capi.h index b362e897e..7eb8be5c9 100644 --- a/inputmethod/include/inputmethod_controller_capi.h +++ b/inputmethod/include/inputmethod_controller_capi.h @@ -84,4 +84,5 @@ InputMethod_ErrorCode OH_InputMethodController_Detach(InputMethod_InputMethodPro #ifdef __cplusplus } #endif /* __cplusplus */ +/** @} */ #endif // OHOS_INPUTMETHOD_CONTROLLER_CAPI_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_cursor_info_capi.h b/inputmethod/include/inputmethod_cursor_info_capi.h index 7645e15ba..a3d7dc341 100644 --- a/inputmethod/include/inputmethod_cursor_info_capi.h +++ b/inputmethod/include/inputmethod_cursor_info_capi.h @@ -104,4 +104,5 @@ InputMethod_ErrorCode OH_CursorInfo_GetRect( #ifdef __cplusplus } #endif /* __cplusplus */ +/** @} */ #endif // OHOS_INPUTMETHOD_CURSOR_INFO_CAPI_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h index f0b82f3d9..1e0ff4871 100644 --- a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h +++ b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h @@ -169,4 +169,5 @@ InputMethod_ErrorCode OH_InputMethodProxy_SendPrivateCommand( #ifdef __cplusplus } #endif /* __cplusplus */ +/** @} */ #endif // INPUTMETHOD_INPUTMETHOD_PROXY_CAP_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_private_command_capi.h b/inputmethod/include/inputmethod_private_command_capi.h index 6871a76bc..2e1f4206e 100644 --- a/inputmethod/include/inputmethod_private_command_capi.h +++ b/inputmethod/include/inputmethod_private_command_capi.h @@ -191,4 +191,5 @@ InputMethod_ErrorCode OH_PrivateCommand_GetStrValue( #ifdef __cplusplus } #endif /* __cplusplus */ +/** @} */ #endif // OHOS_INPUTMETHOD_PRIVATE_COMMAND_CAPI_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_text_avoid_info_capi.h b/inputmethod/include/inputmethod_text_avoid_info_capi.h index 9a707549b..3166d10e0 100644 --- a/inputmethod/include/inputmethod_text_avoid_info_capi.h +++ b/inputmethod/include/inputmethod_text_avoid_info_capi.h @@ -116,4 +116,5 @@ InputMethod_ErrorCode OH_TextAvoidInfo_GetHeight(InputMethod_TextAvoidInfo *info #ifdef __cplusplus } #endif /* __cplusplus */ +/** @} */ #endif // OHOS_INPUTMETHOD_TEXT_AVOID_INFO_CAP_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index 707794081..863e37c5b 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -94,7 +94,7 @@ InputMethod_ErrorCode OH_TextConfig_SetInputType(InputMethod_TextConfig *config, InputMethod_ErrorCode OH_TextConfig_SetEnterKeyType( InputMethod_TextConfig *config, InputMethod_EnterKeyType enterKeyType); /** - * @brief Set is preview text supported into TextConfig. + * @brief Set preview text support into TextConfig. * * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. * @param supported Indicates whether the preview text is supported. @@ -225,4 +225,5 @@ InputMethod_ErrorCode OH_TextConfig_GetWindowId(InputMethod_TextConfig *config, #ifdef __cplusplus } #endif /* __cplusplus */ +/** @} */ #endif // OHOS_INPUTMETHOD_TEXT_CONFIG_CAPI_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_text_editor_proxy_capi.h b/inputmethod/include/inputmethod_text_editor_proxy_capi.h index 64ebd4c04..f4b06cccc 100644 --- a/inputmethod/include/inputmethod_text_editor_proxy_capi.h +++ b/inputmethod/include/inputmethod_text_editor_proxy_capi.h @@ -698,4 +698,5 @@ InputMethod_ErrorCode OH_TextEditorProxy_GetFinishTextPreviewFunc( #ifdef __cplusplus } #endif /* __cplusplus */ +/** @} */ #endif // OHOS_INPUTMETHOD_TEXT_EDITOR_PROXY_CAP_H \ No newline at end of file diff --git a/inputmethod/include/inputmethod_types_capi.h b/inputmethod/include/inputmethod_types_capi.h index 29abd4f41..4ab1f57ff 100644 --- a/inputmethod/include/inputmethod_types_capi.h +++ b/inputmethod/include/inputmethod_types_capi.h @@ -304,4 +304,5 @@ typedef enum InputMethod_ErrorCode { #ifdef __cplusplus } #endif /* __cplusplus */ +/** @} */ #endif // OHOS_INPUTMETHOD_TYPES_CAPI_H \ No newline at end of file -- Gitee From 8a9a4548bb23d5b3b973f9ef316f1122fc471077 Mon Sep 17 00:00:00 2001 From: wuchengwen Date: Fri, 23 Aug 2024 14:45:11 +0800 Subject: [PATCH 136/620] max length is 8k Signed-off-by: wuchengwen --- inputmethod/include/inputmethod_inputmethod_proxy_capi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h index 1e0ff4871..94c54f275 100644 --- a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h +++ b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h @@ -91,7 +91,7 @@ InputMethod_ErrorCode OH_InputMethodProxy_HideKeyboard(InputMethod_InputMethodPr * @param inputMethodProxy Represents a pointer to an {@link InputMethod_InputMethodProxy} instance. * The inputMethodProxy is obtained from {@link OH_InputMethodController_Attach}. * @param text The whole input text. - * @param length The length of text. Max 8K bytes. + * @param length The length of text. Max length is 8K. * @param start The start position of selected text. * @param end The end position of selected text. * @return Returns a specific error code. -- Gitee From 82402274f8ff8a855c4f1a4671baa66dce4e13e5 Mon Sep 17 00:00:00 2001 From: lvshiqi Date: Fri, 23 Aug 2024 15:46:42 +0800 Subject: [PATCH 137/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9codecheck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lvshiqi Change-Id: I91f4fb46c1d182d34d81d51b2914d58ee58b51b3 --- graphic/graphic_2d/native_drawing/drawing_record_cmd.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_record_cmd.h b/graphic/graphic_2d/native_drawing/drawing_record_cmd.h index c5728f209..ee83dc6e6 100644 --- a/graphic/graphic_2d/native_drawing/drawing_record_cmd.h +++ b/graphic/graphic_2d/native_drawing/drawing_record_cmd.h @@ -75,11 +75,12 @@ OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsDestroy(OH_Drawing_RecordCmdUtils* * @param recordCmdUtils Indicates the pointer to an OH_Drawing_RecordCmdUtils object. * @param width Width of canvas object. * @param height Height of canvas object. - * @param canvas Indicates a secondary pointer to an OH_Srawing_Canvasobject. + * @param canvas Indicates a secondary pointer to an OH_Drawing_Canvasobject. * @return Returns the error code. * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if recordCmdUtils or canvas is nullptr, * width less than or equal to 0 or height less than or equal to 0. + * Returns {@link OH_DRAWING_ERROR_ALLOCATION_FAILED} if the memory is out. * @since 13 * @version 1.0 */ @@ -95,6 +96,7 @@ OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsBeginRecording(OH_Drawing_RecordCm * @return Returns the error code. * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if recordCmdUtils or recordCmd is nullptr. + * Returns {@link OH_DRAWING_ERROR_ALLOCATION_FAILED} if the memory is out. * @since 13 * @version 1.0 */ -- Gitee From 145146ccb05ac5606061c0e1445c73d4aa971905 Mon Sep 17 00:00:00 2001 From: lvshiqi Date: Fri, 23 Aug 2024 16:02:38 +0800 Subject: [PATCH 138/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lvshiqi Change-Id: Idf8de3345ae13597b810555f83ba67866db642f6 --- graphic/graphic_2d/native_drawing/drawing_record_cmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_record_cmd.h b/graphic/graphic_2d/native_drawing/drawing_record_cmd.h index ee83dc6e6..84c987645 100644 --- a/graphic/graphic_2d/native_drawing/drawing_record_cmd.h +++ b/graphic/graphic_2d/native_drawing/drawing_record_cmd.h @@ -80,7 +80,7 @@ OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsDestroy(OH_Drawing_RecordCmdUtils* * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if recordCmdUtils or canvas is nullptr, * width less than or equal to 0 or height less than or equal to 0. - * Returns {@link OH_DRAWING_ERROR_ALLOCATION_FAILED} if the memory is out. + * Returns {@link OH_DRAWING_ERROR_ALLOCATION_FAILED} if no memory. * @since 13 * @version 1.0 */ @@ -96,7 +96,7 @@ OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsBeginRecording(OH_Drawing_RecordCm * @return Returns the error code. * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if recordCmdUtils or recordCmd is nullptr. - * Returns {@link OH_DRAWING_ERROR_ALLOCATION_FAILED} if the memory is out. + * Returns {@link OH_DRAWING_ERROR_ALLOCATION_FAILED} if no memory. * @since 13 * @version 1.0 */ -- Gitee From 859e03f5cc1b1b59c5b6bff622c67faa8546254e Mon Sep 17 00:00:00 2001 From: lvshiqi Date: Fri, 23 Aug 2024 17:25:19 +0800 Subject: [PATCH 139/620] =?UTF-8?q?=E6=B7=BB=E5=8A=A0gn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lvshiqi Change-Id: I0a068f9ec406df08998fef17ac231d4d79a5d477 --- graphic/graphic_2d/native_drawing/BUILD.gn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/BUILD.gn b/graphic/graphic_2d/native_drawing/BUILD.gn index fa8656ce6..aea6e1dc4 100644 --- a/graphic/graphic_2d/native_drawing/BUILD.gn +++ b/graphic/graphic_2d/native_drawing/BUILD.gn @@ -39,6 +39,7 @@ ohos_ndk_headers("native_drawing_header") { "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_pen.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_pixel_map.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_point.h", + "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_record_cmd.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_rect.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_region.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_register_font.h", @@ -81,6 +82,7 @@ ohos_ndk_library("libnative_drawing_ndk") { "native_drawing/drawing_pen.h", "native_drawing/drawing_pixel_map.h", "native_drawing/drawing_point.h", + "native_drawing/drawing_record_cmd.h", "native_drawing/drawing_rect.h", "native_drawing/drawing_region.h", "native_drawing/drawing_register_font.h", -- Gitee From f8e15b39a53c828d0fb927ef1049b4d7ff9b725d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=BC=9F?= Date: Fri, 23 Aug 2024 09:06:24 +0000 Subject: [PATCH 140/620] update graphic/graphic_2d/native_drawing/drawing_error_code.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘伟 --- graphic/graphic_2d/native_drawing/drawing_error_code.h | 1 + 1 file changed, 1 insertion(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_error_code.h b/graphic/graphic_2d/native_drawing/drawing_error_code.h index 3943f64fb..817c8c614 100644 --- a/graphic/graphic_2d/native_drawing/drawing_error_code.h +++ b/graphic/graphic_2d/native_drawing/drawing_error_code.h @@ -67,6 +67,7 @@ typedef enum { OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE = 26200001, /** * @error mem allocate failed. + * @since 13 */ OH_DRAWING_ERROR_ALLOCATION_FAILED = 26200002, } OH_Drawing_ErrorCode; -- Gitee From 9808babe9915b14d613a6715a3433c3c7e813de8 Mon Sep 17 00:00:00 2001 From: lvshiqi Date: Fri, 23 Aug 2024 17:49:41 +0800 Subject: [PATCH 141/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9finish?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lvshiqi Change-Id: Ibdf2359a163c704ae96148acabf5df297b654ec0 --- graphic/graphic_2d/native_drawing/drawing_record_cmd.h | 2 +- graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_record_cmd.h b/graphic/graphic_2d/native_drawing/drawing_record_cmd.h index 84c987645..63c03f03b 100644 --- a/graphic/graphic_2d/native_drawing/drawing_record_cmd.h +++ b/graphic/graphic_2d/native_drawing/drawing_record_cmd.h @@ -100,7 +100,7 @@ OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsBeginRecording(OH_Drawing_RecordCm * @since 13 * @version 1.0 */ -OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsFinishingRecording(OH_Drawing_RecordCmdUtils* recordCmdUtils, +OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsFinishRecording(OH_Drawing_RecordCmdUtils* recordCmdUtils, OH_Drawing_RecordCmd** recordCmd); /** diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 5625ddbb0..e6b537d68 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1460,7 +1460,7 @@ }, { "first_introduced": "13", - "name":"OH_Drawing_RecordCmdUtilsFinishingRecording" + "name":"OH_Drawing_RecordCmdUtilsFinishRecording" }, { "first_introduced": "13", -- Gitee From 5f2616c4492eaa822c7295cfa24cbfb2a8d6e324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=88=90=E6=96=87?= Date: Sat, 24 Aug 2024 11:16:51 +0800 Subject: [PATCH 142/620] fix:inputmethod capi review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴成文 --- inputmethod/BUILD.gn | 18 +- .../include/inputmethod_attach_options_capi.h | 4 +- .../include/inputmethod_controller_capi.h | 6 +- .../include/inputmethod_cursor_info_capi.h | 4 +- .../inputmethod_inputmethod_proxy_capi.h | 4 +- .../inputmethod_private_command_capi.h | 4 +- .../inputmethod_text_avoid_info_capi.h | 4 +- .../include/inputmethod_text_config_capi.h | 4 +- .../inputmethod_text_editor_proxy_capi.h | 4 +- inputmethod/include/inputmethod_types_capi.h | 4 +- inputmethod/libohinputmethodndk.json | 390 ++++++++++++++---- 11 files changed, 339 insertions(+), 107 deletions(-) diff --git a/inputmethod/BUILD.gn b/inputmethod/BUILD.gn index ab36bb5c3..cc1480cdb 100644 --- a/inputmethod/BUILD.gn +++ b/inputmethod/BUILD.gn @@ -20,15 +20,15 @@ ohos_ndk_library("libohinputmethod") { min_compact_version = "12" system_capability = "SystemCapability.MiscServices.InputMethodFramework" system_capability_headers = [ - "./include/inputmethod_controller_capi.h", - "./include/inputmethod_attach_options_capi.h", - "./include/inputmethod_cursor_info_capi.h", - "./include/inputmethod_inputmethod_proxy_capi.h", - "./include/inputmethod_private_command_capi.h", - "./include/inputmethod_text_avoid_info_capi.h", - "./include/inputmethod_text_config_capi.h", - "./include/inputmethod_text_editor_proxy_capi.h", - "./include/inputmethod_types_capi.h", + "./inputmethod/inputmethod_controller_capi.h", + "./inputmethod/inputmethod_attach_options_capi.h", + "./inputmethod/inputmethod_cursor_info_capi.h", + "./inputmethod/inputmethod_inputmethod_proxy_capi.h", + "./inputmethod/inputmethod_private_command_capi.h", + "./inputmethod/inputmethod_text_avoid_info_capi.h", + "./inputmethod/inputmethod_text_config_capi.h", + "./inputmethod/inputmethod_text_editor_proxy_capi.h", + "./inputmethod/inputmethod_types_capi.h", ] } diff --git a/inputmethod/include/inputmethod_attach_options_capi.h b/inputmethod/include/inputmethod_attach_options_capi.h index 316bafd0b..3a12eaba6 100644 --- a/inputmethod/include/inputmethod_attach_options_capi.h +++ b/inputmethod/include/inputmethod_attach_options_capi.h @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H -#define OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H /** * @addtogroup InputMethod * @{ @@ -34,6 +32,8 @@ * @since 12 * @version 1.0 */ +#ifndef OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H +#define OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H #include "inputmethod_types_capi.h" #ifdef __cplusplus extern "C" { diff --git a/inputmethod/include/inputmethod_controller_capi.h b/inputmethod/include/inputmethod_controller_capi.h index 7eb8be5c9..0816e69f8 100644 --- a/inputmethod/include/inputmethod_controller_capi.h +++ b/inputmethod/include/inputmethod_controller_capi.h @@ -12,9 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#ifndef OHOS_INPUTMETHOD_CONTROLLER_CAPI_H -#define OHOS_INPUTMETHOD_CONTROLLER_CAPI_H /** * @addtogroup InputMethod * @{ @@ -35,7 +32,8 @@ * @since 12 * @version 1.0 */ - +#ifndef OHOS_INPUTMETHOD_CONTROLLER_CAPI_H +#define OHOS_INPUTMETHOD_CONTROLLER_CAPI_H #include #include diff --git a/inputmethod/include/inputmethod_cursor_info_capi.h b/inputmethod/include/inputmethod_cursor_info_capi.h index a3d7dc341..5810219f7 100644 --- a/inputmethod/include/inputmethod_cursor_info_capi.h +++ b/inputmethod/include/inputmethod_cursor_info_capi.h @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef OHOS_INPUTMETHOD_CURSOR_INFO_CAPI_H -#define OHOS_INPUTMETHOD_CURSOR_INFO_CAPI_H /** * @addtogroup InputMethod * @{ @@ -34,6 +32,8 @@ * @since 12 * @version 1.0 */ +#ifndef OHOS_INPUTMETHOD_CURSOR_INFO_CAPI_H +#define OHOS_INPUTMETHOD_CURSOR_INFO_CAPI_H #include "inputmethod_types_capi.h" #ifdef __cplusplus extern "C"{ diff --git a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h index 94c54f275..e542d96da 100644 --- a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h +++ b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef OHOS_INPUTMETHOD_INPUTMETHOD_PROXY_CAPI_H -#define OHOS_INPUTMETHOD_INPUTMETHOD_PROXY_CAPI_H /** * @addtogroup InputMethod * @{ @@ -34,6 +32,8 @@ * @since 12 * @version 1.0 */ +#ifndef OHOS_INPUTMETHOD_INPUTMETHOD_PROXY_CAPI_H +#define OHOS_INPUTMETHOD_INPUTMETHOD_PROXY_CAPI_H #include #include "inputmethod_types_capi.h" diff --git a/inputmethod/include/inputmethod_private_command_capi.h b/inputmethod/include/inputmethod_private_command_capi.h index 2e1f4206e..2821b2e75 100644 --- a/inputmethod/include/inputmethod_private_command_capi.h +++ b/inputmethod/include/inputmethod_private_command_capi.h @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef OHOS_INPUTMETHOD_PRIVATE_COMMAND_CAPI_H -#define OHOS_INPUTMETHOD_PRIVATE_COMMAND_CAPI_H /** * @addtogroup InputMethod * @{ @@ -34,6 +32,8 @@ * @since 12 * @version 1.0 */ +#ifndef OHOS_INPUTMETHOD_PRIVATE_COMMAND_CAPI_H +#define OHOS_INPUTMETHOD_PRIVATE_COMMAND_CAPI_H #include #include diff --git a/inputmethod/include/inputmethod_text_avoid_info_capi.h b/inputmethod/include/inputmethod_text_avoid_info_capi.h index 3166d10e0..a22590f6a 100644 --- a/inputmethod/include/inputmethod_text_avoid_info_capi.h +++ b/inputmethod/include/inputmethod_text_avoid_info_capi.h @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef OHOS_INPUTMETHOD_TEXT_AVOID_INFO_CAPI_H -#define OHOS_INPUTMETHOD_TEXT_AVOID_INFO_CAPI_H /** * @addtogroup InputMethod * @{ @@ -34,6 +32,8 @@ * @since 12 * @version 1.0 */ +#ifndef OHOS_INPUTMETHOD_TEXT_AVOID_INFO_CAPI_H +#define OHOS_INPUTMETHOD_TEXT_AVOID_INFO_CAPI_H #include "inputmethod_types_capi.h" #ifdef __cplusplus extern "C" { diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index 863e37c5b..1a625eb08 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef OHOS_INPUTMETHOD_TEXT_CONFIG_CAPI_H -#define OHOS_INPUTMETHOD_TEXT_CONFIG_CAPI_H /** * @addtogroup InputMethod * @{ @@ -34,6 +32,8 @@ * @since 12 * @version 1.0 */ +#ifndef OHOS_INPUTMETHOD_TEXT_CONFIG_CAPI_H +#define OHOS_INPUTMETHOD_TEXT_CONFIG_CAPI_H #include #include "inputmethod_cursor_info_capi.h" diff --git a/inputmethod/include/inputmethod_text_editor_proxy_capi.h b/inputmethod/include/inputmethod_text_editor_proxy_capi.h index f4b06cccc..05d56b643 100644 --- a/inputmethod/include/inputmethod_text_editor_proxy_capi.h +++ b/inputmethod/include/inputmethod_text_editor_proxy_capi.h @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef OHOS_INPUTMETHOD_TEXT_EDITOR_PROXY_CAPI_H -#define OHOS_INPUTMETHOD_TEXT_EDITOR_PROXY_CAPI_H /** * @addtogroup InputMethod * @{ @@ -34,6 +32,8 @@ * @since 12 * @version 1.0 */ +#ifndef OHOS_INPUTMETHOD_TEXT_EDITOR_PROXY_CAPI_H +#define OHOS_INPUTMETHOD_TEXT_EDITOR_PROXY_CAPI_H #include #include "inputmethod_private_command_capi.h" diff --git a/inputmethod/include/inputmethod_types_capi.h b/inputmethod/include/inputmethod_types_capi.h index 4ab1f57ff..2e1481335 100644 --- a/inputmethod/include/inputmethod_types_capi.h +++ b/inputmethod/include/inputmethod_types_capi.h @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef OHOS_INPUTMETHOD_TYPES_CAPI_H -#define OHOS_INPUTMETHOD_TYPES_CAPI_H /** * @addtogroup InputMethod * @{ @@ -34,6 +32,8 @@ * @since 12 * @version 1.0 */ +#ifndef OHOS_INPUTMETHOD_TYPES_CAPI_H +#define OHOS_INPUTMETHOD_TYPES_CAPI_H #ifdef __cplusplus extern "C"{ #endif /* __cplusplus */ diff --git a/inputmethod/libohinputmethodndk.json b/inputmethod/libohinputmethodndk.json index 683c0a355..0c026b2e6 100644 --- a/inputmethod/libohinputmethodndk.json +++ b/inputmethod/libohinputmethodndk.json @@ -1,80 +1,314 @@ [ - { "name": "OH_InputMethodController_Attach" }, - { "name": "OH_InputMethodController_Detach" }, - { "name": "OH_InputMethodProxy_ShowKeyboard" }, - { "name": "OH_InputMethodProxy_HideKeyboard" }, - { "name": "OH_InputMethodProxy_NotifySelectionChange" }, - { "name": "OH_InputMethodProxy_NotifyConfigurationChange" }, - { "name": "OH_InputMethodProxy_NotifyCursorUpdate" }, - { "name": "OH_InputMethodProxy_SendPrivateCommand" }, - { "name": "OH_CursorInfo_Create" }, - { "name": "OH_CursorInfo_Destroy" }, - { "name": "OH_CursorInfo_SetRect" }, - { "name": "OH_CursorInfo_GetRect" }, - { "name": "OH_TextConfig_Create" }, - { "name": "OH_TextConfig_Destroy" }, - { "name": "OH_TextConfig_SetInputType" }, - { "name": "OH_TextConfig_SetEnterKeyType" }, - { "name": "OH_TextConfig_SetPreviewTextSupport" }, - { "name": "OH_TextConfig_SetSelection" }, - { "name": "OH_TextConfig_SetWindowId" }, - { "name": "OH_TextConfig_GetInputType" }, - { "name": "OH_TextConfig_GetEnterKeyType" }, - { "name": "OH_TextConfig_IsPreviewTextSupported" }, - { "name": "OH_TextConfig_GetCursorInfo" }, - { "name": "OH_TextConfig_GetTextAvoidInfo" }, - { "name": "OH_TextConfig_GetSelection" }, - { "name": "OH_TextConfig_GetWindowId" }, - { "name": "OH_TextEditorProxy_Create" }, - { "name": "OH_TextEditorProxy_Destroy" }, - { "name": "OH_TextEditorProxy_SetGetTextConfigFunc" }, - { "name": "OH_TextEditorProxy_SetInsertTextFunc" }, - { "name": "OH_TextEditorProxy_SetDeleteForwardFunc" }, - { "name": "OH_TextEditorProxy_SetDeleteBackwardFunc" }, - { "name": "OH_TextEditorProxy_SetSendKeyboardStatusFunc" }, - { "name": "OH_TextEditorProxy_SetSendEnterKeyFunc" }, - { "name": "OH_TextEditorProxy_SetMoveCursorFunc" }, - { "name": "OH_TextEditorProxy_SetHandleSetSelectionFunc" }, - { "name": "OH_TextEditorProxy_SetHandleExtendActionFunc" }, - { "name": "OH_TextEditorProxy_SetGetLeftTextOfCursorFunc" }, - { "name": "OH_TextEditorProxy_SetGetRightTextOfCursorFunc" }, - { "name": "OH_TextEditorProxy_SetGetTextIndexAtCursorFunc" }, - { "name": "OH_TextEditorProxy_SetReceivePrivateCommandFunc" }, - { "name": "OH_TextEditorProxy_SetSetPreviewTextFunc" }, - { "name": "OH_TextEditorProxy_SetFinishTextPreviewFunc" }, - { "name": "OH_TextEditorProxy_GetGetTextConfigFunc" }, - { "name": "OH_TextEditorProxy_GetInsertTextFunc" }, - { "name": "OH_TextEditorProxy_GetDeleteForwardFunc" }, - { "name": "OH_TextEditorProxy_GetDeleteBackwardFunc" }, - { "name": "OH_TextEditorProxy_GetSendKeyboardStatusFunc" }, - { "name": "OH_TextEditorProxy_GetSendEnterKeyFunc" }, - { "name": "OH_TextEditorProxy_GetMoveCursorFunc" }, - { "name": "OH_TextEditorProxy_GetHandleSetSelectionFunc" }, - { "name": "OH_TextEditorProxy_GetHandleExtendActionFunc" }, - { "name": "OH_TextEditorProxy_GetGetLeftTextOfCursorFunc" }, - { "name": "OH_TextEditorProxy_GetGetRightTextOfCursorFunc" }, - { "name": "OH_TextEditorProxy_GetGetTextIndexAtCursorFunc" }, - { "name": "OH_TextEditorProxy_GetReceivePrivateCommandFunc" }, - { "name": "OH_TextEditorProxy_GetSetPreviewTextFunc" }, - { "name": "OH_TextEditorProxy_GetFinishTextPreviewFunc" }, - { "name": "OH_AttachOptions_Create" }, - { "name": "OH_AttachOptions_Destroy" }, - { "name": "OH_AttachOptions_IsShowKeyboard" }, - { "name": "OH_TextAvoidInfo_Create" }, - { "name": "OH_TextAvoidInfo_Destroy" }, - { "name": "OH_TextAvoidInfo_SetPositionY" }, - { "name": "OH_TextAvoidInfo_SetHeight" }, - { "name": "OH_TextAvoidInfo_GetPositionY" }, - { "name": "OH_TextAvoidInfo_GetHeight" }, - { "name": "OH_PrivateCommand_Create" }, - { "name": "OH_PrivateCommand_Destroy" }, - { "name": "OH_PrivateCommand_SetKey" }, - { "name": "OH_PrivateCommand_SetBoolValue" }, - { "name": "OH_PrivateCommand_SetIntValue" }, - { "name": "OH_PrivateCommand_SetStrValue" }, - { "name": "OH_PrivateCommand_GetKey" }, - { "name": "OH_PrivateCommand_GetValueType" }, - { "name": "OH_PrivateCommand_GetBoolValue" }, - { "name": "OH_PrivateCommand_GetIntValue" }, - { "name": "OH_PrivateCommand_GetStrValue" } + { + "first_introduced": "12", + "name": "OH_InputMethodController_Attach" + }, + { + "first_introduced": "12", + "name": "OH_InputMethodController_Detach" + }, + { + "first_introduced": "12", + "name": "OH_InputMethodProxy_ShowKeyboard" + }, + { + "first_introduced": "12", + "name": "OH_InputMethodProxy_HideKeyboard" + }, + { + "first_introduced": "12", + "name": "OH_InputMethodProxy_NotifySelectionChange" + }, + { + "first_introduced": "12", + "name": "OH_InputMethodProxy_NotifyConfigurationChange" + }, + { + "first_introduced": "12", + "name": "OH_InputMethodProxy_NotifyCursorUpdate" + }, + { + "first_introduced": "12", + "name": "OH_InputMethodProxy_SendPrivateCommand" + }, + { + "first_introduced": "12", + "name": "OH_CursorInfo_Create" + }, + { + "first_introduced": "12", + "name": "OH_CursorInfo_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_CursorInfo_SetRect" + }, + { + "first_introduced": "12", + "name": "OH_CursorInfo_GetRect" + }, + { + "first_introduced": "12", + "name": "OH_TextConfig_Create" + }, + { + "first_introduced": "12", + "name": "OH_TextConfig_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_TextConfig_SetInputType" + }, + { + "first_introduced": "12", + "name": "OH_TextConfig_SetEnterKeyType" + }, + { + "first_introduced": "12", + "name": "OH_TextConfig_SetPreviewTextSupport" + }, + { + "first_introduced": "12", + "name": "OH_TextConfig_SetSelection" + }, + { + "first_introduced": "12", + "name": "OH_TextConfig_SetWindowId" + }, + { + "first_introduced": "12", + "name": "OH_TextConfig_GetInputType" + }, + { + "first_introduced": "12", + "name": "OH_TextConfig_GetEnterKeyType" + }, + { + "first_introduced": "12", + "name": "OH_TextConfig_IsPreviewTextSupported" + }, + { + "first_introduced": "12", + "name": "OH_TextConfig_GetCursorInfo" + }, + { + "first_introduced": "12", + "name": "OH_TextConfig_GetTextAvoidInfo" + }, + { + "first_introduced": "12", + "name": "OH_TextConfig_GetSelection" + }, + { + "first_introduced": "12", + "name": "OH_TextConfig_GetWindowId" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_Create" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetGetTextConfigFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetInsertTextFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetDeleteForwardFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetDeleteBackwardFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetSendKeyboardStatusFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetSendEnterKeyFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetMoveCursorFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetHandleSetSelectionFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetHandleExtendActionFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetGetLeftTextOfCursorFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetGetRightTextOfCursorFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetGetTextIndexAtCursorFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetReceivePrivateCommandFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetSetPreviewTextFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_SetFinishTextPreviewFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetGetTextConfigFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetInsertTextFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetDeleteForwardFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetDeleteBackwardFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetSendKeyboardStatusFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetSendEnterKeyFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetMoveCursorFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetHandleSetSelectionFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetHandleExtendActionFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetGetLeftTextOfCursorFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetGetRightTextOfCursorFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetGetTextIndexAtCursorFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetReceivePrivateCommandFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetSetPreviewTextFunc" + }, + { + "first_introduced": "12", + "name": "OH_TextEditorProxy_GetFinishTextPreviewFunc" + }, + { + "first_introduced": "12", + "name": "OH_AttachOptions_Create" + }, + { + "first_introduced": "12", + "name": "OH_AttachOptions_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_AttachOptions_IsShowKeyboard" + }, + { + "first_introduced": "12", + "name": "OH_TextAvoidInfo_Create" + }, + { + "first_introduced": "12", + "name": "OH_TextAvoidInfo_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_TextAvoidInfo_SetPositionY" + }, + { + "first_introduced": "12", + "name": "OH_TextAvoidInfo_SetHeight" + }, + { + "first_introduced": "12", + "name": "OH_TextAvoidInfo_GetPositionY" + }, + { + "first_introduced": "12", + "name": "OH_TextAvoidInfo_GetHeight" + }, + { + "first_introduced": "12", + "name": "OH_PrivateCommand_Create" + }, + { + "first_introduced": "12", + "name": "OH_PrivateCommand_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_PrivateCommand_SetKey" + }, + { + "first_introduced": "12", + "name": "OH_PrivateCommand_SetBoolValue" + }, + { + "first_introduced": "12", + "name": "OH_PrivateCommand_SetIntValue" + }, + { + "first_introduced": "12", + "name": "OH_PrivateCommand_SetStrValue" + }, + { + "first_introduced": "12", + "name": "OH_PrivateCommand_GetKey" + }, + { + "first_introduced": "12", + "name": "OH_PrivateCommand_GetValueType" + }, + { + "first_introduced": "12", + "name": "OH_PrivateCommand_GetBoolValue" + }, + { + "first_introduced": "12", + "name": "OH_PrivateCommand_GetIntValue" + }, + { + "first_introduced": "12", + "name": "OH_PrivateCommand_GetStrValue" + } ] \ No newline at end of file -- Gitee From 4cfe86f5b9f7108368d2eb2d5404068ea762f28b Mon Sep 17 00:00:00 2001 From: zhangkai Date: Wed, 21 Aug 2024 16:23:48 +0800 Subject: [PATCH 143/620] =?UTF-8?q?audio=20=E8=93=9D=E9=BB=84=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E6=80=A7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangkai --- multimedia/audio_framework/common/native_audiostream_base.h | 2 +- multimedia/audio_framework/ohaudio.ndk.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/audio_framework/common/native_audiostream_base.h b/multimedia/audio_framework/common/native_audiostream_base.h index 6c1b362a4..84015d364 100644 --- a/multimedia/audio_framework/common/native_audiostream_base.h +++ b/multimedia/audio_framework/common/native_audiostream_base.h @@ -443,7 +443,7 @@ typedef enum { } OH_AudioStream_SourceType; /** - * Defines the audio interrupt mode. + * @brief Defines the audio interrupt mode. * * @since 12 */ diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 165dc8631..66bf9872f 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -317,7 +317,7 @@ }, { "first_introduced": "12", - "name":"OH_AudioRenderer_SetSilentModeAndMixWithOthers" + "name":"OH_AudioRenderer_SetSilentModeAndMixWithOthers" }, { "first_introduced": "12", -- Gitee From f206049985a0eae8bfde1cb3c79d069cf7903100 Mon Sep 17 00:00:00 2001 From: wangsen1994 Date: Tue, 20 Aug 2024 16:50:23 +0800 Subject: [PATCH 144/620] =?UTF-8?q?=E6=96=B0=E5=A2=9Ecse=20ndk=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangsen1994 --- BasicServicesKit/BUILD.gn | 20 + .../commonevent/libcommonevent.ndk.json | 98 ++++ BasicServicesKit/commonevent/oh_commonevent.h | 370 ++++++++++++ .../commonevent/oh_commonevent_support.h | 528 ++++++++++++++++++ 4 files changed, 1016 insertions(+) create mode 100644 BasicServicesKit/commonevent/libcommonevent.ndk.json create mode 100644 BasicServicesKit/commonevent/oh_commonevent.h create mode 100644 BasicServicesKit/commonevent/oh_commonevent_support.h diff --git a/BasicServicesKit/BUILD.gn b/BasicServicesKit/BUILD.gn index d7cb6f57f..ea12f5495 100644 --- a/BasicServicesKit/BUILD.gn +++ b/BasicServicesKit/BUILD.gn @@ -71,3 +71,23 @@ ohos_ndk_library("libtime_service_ndk") { system_capability = "SystemCapability.MiscServices.Time" system_capability_headers = [ "BasicServicesKit/time_service.h" ] } + +ohos_ndk_headers("ohcommonevent_header") { + dest_dir = "$ndk_headers_out_dir/BasicServicesKit/" + sources = [ + "./commonevent/oh_commonevent.h", + "./commonevent/oh_commonevent_support.h", + ] +} + +ohos_ndk_library("libcommonevent_ndk") { + output_name = "ohcommonevent" + output_extension = "so" + ndk_description_file = "./commonevent/libcommonevent.ndk.json" + min_compact_version = "12" + system_capability = "SystemCapability.Notification.CommonEvent" + system_capability_headers = [ + "BasicServicesKit/commonevent/oh_commonevent.h", + "BasicServicesKit/commonevent/oh_commonevent_support.h", + ] +} diff --git a/BasicServicesKit/commonevent/libcommonevent.ndk.json b/BasicServicesKit/commonevent/libcommonevent.ndk.json new file mode 100644 index 000000000..40ddccdfe --- /dev/null +++ b/BasicServicesKit/commonevent/libcommonevent.ndk.json @@ -0,0 +1,98 @@ +[ + { + "first_introduced": "12", + "name":"OH_CommonEvent_CreateSubscribeInfo" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_SetPublisherPermission" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_SetPublisherBundleName" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_DestroySubscribeInfo" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_CreateSubscriber" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_DestroySubscriber" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_Subscribe" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_UnSubscribe" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetEventFromRcvData" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetCodeFromRcvData" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetDataStrFromRcvData" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetBundleNameFromRcvData" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetParametersFromRcvData" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_HasKeyInParameters" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetIntFromParameters" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetIntArrayFromParameters" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetLongFromParameters" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetLongArrayFromParameters" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetBoolFromParameters" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetBoolArrayFromParameters" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetCharFromParameters" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetCharArrayFromParameters" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetDoubleFromParameters" + }, + { + "first_introduced": "12", + "name":"OH_CommonEvent_GetDoubleArrayFromParameters" + } +] diff --git a/BasicServicesKit/commonevent/oh_commonevent.h b/BasicServicesKit/commonevent/oh_commonevent.h new file mode 100644 index 000000000..695328b66 --- /dev/null +++ b/BasicServicesKit/commonevent/oh_commonevent.h @@ -0,0 +1,370 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup OH_CommonEvent + * @{ + * + * @brief Provides the APIs of common event service. + * + * @since 12 + */ +/** + * @file oh_commonevent.h + * + * @brief Declares the APIs to subscribe and unsubscribe common event, and so on. + * + * @library libohcommonevent.so + * @kit BasicServicesKit + * @syscap SystemCapability.Notification.CommonEvent + * @since 12 + * @version 1.0 + */ + +#ifndef OH_COMMONEVENT_H +#define OH_COMMONEVENT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Defines error codes. + * + * @since 12 + * @version 1.0 + */ +typedef enum CommonEvent_ErrCode { + /** @error Execution successful. */ + COMMONEVENT_ERR_OK = 0, + + /** @error permission verification failed. */ + COMMONEVENT_ERR_PERMISSION_ERROR = 201, + + /** @error invalid input parameter. */ + COMMONEVENT_ERR_INVALID_PARAMETER = 401, + + /** @error IPC request failed to send. */ + COMMONEVENT_ERR_SENDING_REQUEST_FAILED = 1500007, + + /** @error Common event service not init. */ + COMMONEVENT_ERR_INIT_UNDONE = 1500008, + + /** @error The subscriber number exceed system specification */ + COMMONEVENT_ERR_SUBSCRIBER_NUM_EXCEEDED = 1500010, + + /** @error A memory allocation error occurs. */ + COMMONEVENT_ERR_ALLOC_MEMORY_FAILED = 1500011, +} CommonEvent_ErrCode; + +/** + * @brief the information of the subscriber + * + * @since 12 + */ +typedef struct CommonEvent_SubscribeInfo CommonEvent_SubscribeInfo; + +/** + * @brief the subscriber of common event + * + * @since 12 + */ +typedef void CommonEvent_Subscriber; + +/** + * @brief the data of the commonEvent callback + * + * @since 12 + */ +typedef struct CommonEvent_RcvData CommonEvent_RcvData; + +/** + * @brief The description of the parameters in a common event callback data. + * + * @since 12 + */ +typedef void CommonEvent_Parameters; + +/** + * @brief Common event callback. + * + * @param data common event callback data. + * @since 12 + */ +typedef void (*CommonEvent_ReceiveCallback)(const CommonEvent_RcvData *data); + +/** + * @brief Create subscribe information. + * + * @param events Indicates the subscribed events. + * @param eventsNum Indicates the subscribed events of number. + * @return Returns the CommonEvent_SubscribeInfo, if allocate memory failed, returns null. + * @since 12 + */ +CommonEvent_SubscribeInfo* OH_CommonEvent_CreateSubscribeInfo(const char* events[], int32_t eventsNum); + +/** + * @brief Set the subscribe information of permission. + * + * @param info Indicates the subscribed events. + * @param permission Indicates the subscribed events of number. + * @return Returns the error code. + * Returns {@link COMMONEVENT_ERR_OK} if the operation is successful. + * Returns {@link COMMONEVENT_ERR_INVALID_PARAMETER} if a parameter error occurs. + * @since 12 + */ +CommonEvent_ErrCode OH_CommonEvent_SetPublisherPermission(CommonEvent_SubscribeInfo* info, const char* permission); + +/** + * @brief Set the subscribe information of bundleName. + * + * @param info Indicates the subscribed events. + * @param bundleName Indicates the subscribed events of number. + * @return Returns the error code. + * Returns {@link COMMONEVENT_ERR_OK} if the operation is successful. + * Returns {@link COMMONEVENT_ERR_INVALID_PARAMETER} if a parameter error occurs. + * @since 12 + */ +CommonEvent_ErrCode OH_CommonEvent_SetPublisherBundleName(CommonEvent_SubscribeInfo* info, const char* bundleName); + +/** + * @brief Destroy the subscribe information. + * + * @param info Indicates the subscribe info. + * @since 12 + */ +void OH_CommonEvent_DestroySubscribeInfo(CommonEvent_SubscribeInfo* info); + +/** + * @brief Create a subscriber. + * + * @param info Indicates the created subscribe Info. + * @param callback Indicates the received common event callback. + * @return Returns the CommonEvent_Subscriber, if allocate memory failed, returns null. + * @since 12 + */ +CommonEvent_Subscriber* OH_CommonEvent_CreateSubscriber(const CommonEvent_SubscribeInfo* info, + CommonEvent_ReceiveCallback callback); + +/** + * @brief Destory the subscriber. + * + * @param subscriber Indicates the created subscriber. + * @since 12 + */ +void OH_CommonEvent_DestroySubscriber(CommonEvent_Subscriber* subscriber); + +/** + * @brief Subscribe event by a subscriber. + * + * @param subscriber Indicates the subscriber. + * @return Returns the error code. + * Returns {@link COMMONEVENT_ERR_OK} if the operation is successful. + * Returns {@link COMMONEVENT_ERR_INVALID_PARAMETER } if the input parameter is invalid. + * Returns {@link COMMONEVENT_ERR_SENDING_REQUEST_FAILED } if IPC request failed to send. + * Returns {@link COMMONEVENT_ERR_INIT_UNDONE } if ces not init done. + * Returns {@link COMMONEVENT_ERR_SUBSCRIBER_NUM_EXCEEDED } if the subscriber number is exceeded. + * Returns {@link COMMONEVENT_ERR_ALLOC_MEMORY_FAILED } if a memory allocation error occurs. + * @since 12 + */ +CommonEvent_ErrCode OH_CommonEvent_Subscribe(const CommonEvent_Subscriber* subscriber); + +/** + * @brief Unsubscribe event by a subscriber. + * + * @param subscriber Indicates the subscriber. + * @return Returns the error code. + * Returns {@link COMMONEVENT_ERR_OK} if the operation is successful. + * Returns {@link COMMONEVENT_ERR_INVALID_PARAMETER } if the input parameter is invalid. + * Returns {@link COMMONEVENT_ERR_SENDING_REQUEST_FAILED } if IPC request failed to send. + * Returns {@link COMMONEVENT_ERR_INIT_UNDONE } if ces not init done. + * @since 12 + */ +CommonEvent_ErrCode OH_CommonEvent_UnSubscribe(const CommonEvent_Subscriber* subscriber); + +/** + * @brief Get event name from callback data. + * + * @param rcvData Indicates the event of callback data. + * @return Returns the event name. + * @since 12 + */ +const char* OH_CommonEvent_GetEventFromRcvData(const CommonEvent_RcvData* rcvData); + +/** + * @brief Get event result code from callback data. + * + * @param rcvData Indicates the event of callback data. + * @return Returns the event of result code, default is 0. + * @since 12 + */ +int32_t OH_CommonEvent_GetCodeFromRcvData(const CommonEvent_RcvData* rcvData); + +/** + * @brief Get event result data from callback data. + * + * @param rcvData Indicates the event of callback data. + * @return Returns the event of result data, default is null. + * @since 12 + */ +const char* OH_CommonEvent_GetDataStrFromRcvData(const CommonEvent_RcvData* rcvData); + +/** + * @brief Get event bundlename from callback data. + * + * @param rcvData Indicates the event of callback data. + * @return Returns the event of bundlename, default is null. + * @since 12 + */ +const char* OH_CommonEvent_GetBundleNameFromRcvData(const CommonEvent_RcvData* rcvData); + +/** + * @brief Get event parameters data from callback data. + * + * @param rcvData Indicates the event of callback data. + * @return Returns the event of parameters data, default is null. + * @since 12 + */ +const CommonEvent_Parameters* OH_CommonEvent_GetParametersFromRcvData(const CommonEvent_RcvData* rcvData); + +/** + * @brief Check whether the parameters contains a key. + * + * @param rcvData Indicates the event of callback data. + * @param key Indicates the key of parameter. + * @return Returns the result of check, true means it contains. + * @since 12 + */ +bool OH_CommonEvent_HasKeyInParameters(const CommonEvent_Parameters* para, const char* key); + +/** + * @brief Get int data from parameters data by key. + * + * @param rcvData Indicates the event of parameters data. + * @param key Indicates the key of parameters data. + * @param defaultValue Indicates default return value. + * @return Returns the int data of the key in the parameters. + * @since 12 + */ +int OH_CommonEvent_GetIntFromParameters(const CommonEvent_Parameters* para, const char* key, const int defaultValue); + +/** + * @brief Get int array data from parameters data by key. + * + * @param rcvData Indicates the event of parameters data. + * @param key Indicates the key of parameters data. + * @param array Indicates the int array. + * @return Returns the length of the array. + * @since 12 + */ +int32_t OH_CommonEvent_GetIntArrayFromParameters(const CommonEvent_Parameters* para, const char* key, int** array); + +/** + * @brief Get long data from parameters data by key. + * + * @param rcvData Indicates the event of parameters data. + * @param key Indicates the key of parameters data. + * @param defaultValue Indicates default return value. + * @return Returns the long data of the key in the parameters. + * @since 12 + */ +long OH_CommonEvent_GetLongFromParameters(const CommonEvent_Parameters* para, const char* key, const long defaultValue); + +/** + * @brief Get long array data from parameters data by key. + * + * @param rcvData Indicates the event of parameters data. + * @param key Indicates the key of parameters data. + * @param array Indicates the long array. + * @return Returns the length of the array. + * @since 12 + */ +int32_t OH_CommonEvent_GetLongArrayFromParameters(const CommonEvent_Parameters* para, const char* key, long** array); + +/** + * @brief Get bool data from parameters data by key. + * + * @param rcvData Indicates the event of parameters data. + * @param key Indicates the key of parameters data. + * @param defaultValue Indicates default return value. + * @return Returns the bool data of the key in the parameters. + * @since 12 + */ +bool OH_CommonEvent_GetBoolFromParameters(const CommonEvent_Parameters* para, const char* key, const bool defaultValue); + +/** + * @brief Get bool array data from parameters data by key. + * + * @param rcvData Indicates the event of parameters data. + * @param key Indicates the key of parameters data. + * @param array Indicates the bool array. + * @return Returns the length of the array. + * @since 12 + */ +int32_t OH_CommonEvent_GetBoolArrayFromParameters(const CommonEvent_Parameters* para, const char* key, bool** array); + +/** + * @brief Get char data from parameters data by key. + * + * @param rcvData Indicates the event of parameters data. + * @param key Indicates the key of parameters data. + * @param defaultValue Indicates default return value. + * @return Returns the char data of the key in the parameters. + * @since 12 + */ +char OH_CommonEvent_GetCharFromParameters(const CommonEvent_Parameters* para, const char* key, const char defaultValue); + +/** + * @brief Get char array data from parameters data by key. + * + * @param rcvData Indicates the event of parameters data. + * @param key Indicates the key of parameters data. + * @param array Indicates the char array. + * @return Returns the length of the array. + * @since 12 + */ +int32_t OH_CommonEvent_GetCharArrayFromParameters(const CommonEvent_Parameters* para, const char* key, char** array); + +/** + * @brief Get double data from parameters data by key. + * + * @param rcvData Indicates the event of parameters data. + * @param key Indicates the key of parameters data. + * @param defaultValue Indicates default return value. + * @return Returns the double data of the key in the parameters. + * @since 12 + */ +double OH_CommonEvent_GetDoubleFromParameters(const CommonEvent_Parameters* para, const char* key, + const double defaultValue); + +/** + * @brief Get double array data from parameters data by key. + * + * @param rcvData Indicates the event of parameters data. + * @param key Indicates the key of parameters data. + * @param array Indicates the double array. + * @return Returns the length of the array, default is 0. + * @since 12 + */ +int32_t OH_CommonEvent_GetDoubleArrayFromParameters(const CommonEvent_Parameters* para, const char* key, + double** array); + +#ifdef __cplusplus +} +#endif +#endif // OH_COMMONEVENT_H +/** @} */ diff --git a/BasicServicesKit/commonevent/oh_commonevent_support.h b/BasicServicesKit/commonevent/oh_commonevent_support.h new file mode 100644 index 000000000..2f4b77898 --- /dev/null +++ b/BasicServicesKit/commonevent/oh_commonevent_support.h @@ -0,0 +1,528 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup OH_CommonEvent + * @{ + * + * @brief Provides the APIs of common event service. + * + * @since 12 + */ +/** + * @file oh_commonevent_support.h + * + * @brief Declares the constants of system-defined common event. + * + * @library libohcommonevent.so + * @kit BasicServicesKit + * @syscap SystemCapability.Notification.CommonEvent + * @since 12 + * @version 1.0 + */ + +#ifndef OH_COMMONEVENT_SUPPORT_H +#define OH_COMMONEVENT_SUPPORT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief This commonEvent means when the device is shutting down, note: turn off, not sleeping. + * + * @since 12 + */ +static const char* const COMMON_EVENT_SHUTDOWN = "usual.event.SHUTDOWN"; + +/** + * @brief This commonEvent means when the charging state, level and so on about the battery. + * + * @since 12 + */ +static const char* const COMMON_EVENT_BATTERY_CHANGED = "usual.event.BATTERY_CHANGED"; + +/** + * @brief This commonEvent means when the device in low battery state.. + * + * @since 12 + */ +static const char* const COMMON_EVENT_BATTERY_LOW = "usual.event.BATTERY_LOW"; + +/** + * @brief This commonEvent means when the battery level is an ok state. + * + * @since 12 + */ +static const char* const COMMON_EVENT_BATTERY_OKAY = "usual.event.BATTERY_OKAY"; + +/** + * @brief This commonEvent means when the other power is connected to the device. + * + * @since 12 + */ +static const char* const COMMON_EVENT_POWER_CONNECTED = "usual.event.POWER_CONNECTED"; + +/** + * @brief This commonEvent means when the other power is removed from the device. + * + * @since 12 + */ +static const char* const COMMON_EVENT_POWER_DISCONNECTED = "usual.event.POWER_DISCONNECTED"; + +/** + * @brief This commonEvent means when the screen is turned off. + * + * @since 12 + */ +static const char* const COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF"; + +/** + * @brief This commonEvent means when the device is awakened and interactive. + * + * @since 12 + */ +static const char* const COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON"; + +/** + * @brief This commonEvent means when the thermal state level change + * + * @since 12 + */ +static const char* const COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED"; + +/** + * @brief This commonEvent means when the current time is changed. + * + * @since 12 + */ +static const char* const COMMON_EVENT_TIME_TICK = "usual.event.TIME_TICK"; + +/** + * @brief This commonEvent means when the time is set. + * + * @since 12 + */ +static const char* const COMMON_EVENT_TIME_CHANGED = "usual.event.TIME_CHANGED"; + +/** + * @brief This commonEvent means when the time zone is changed. + * + * @since 12 + */ +static const char* const COMMON_EVENT_TIMEZONE_CHANGED = "usual.event.TIMEZONE_CHANGED"; + +/** + * @brief This commonEvent means when a new application package is installed on the device. + * + * @since 12 + */ +static const char* const COMMON_EVENT_PACKAGE_ADDED = "usual.event.PACKAGE_ADDED"; + +/** + * @brief This commonEvent means when an existing application package is removed from the device. + * + * @since 12 + */ +static const char* const COMMON_EVENT_PACKAGE_REMOVED = "usual.event.PACKAGE_REMOVED"; + +/** + * @brief This commonEvent means when an existing application package is removed from the device. + * + * @since 12 + */ +static const char* const COMMON_EVENT_BUNDLE_REMOVED = "usual.event.BUNDLE_REMOVED"; + +/** + * @brief This commonEvent means when an existing application package is completely removed from the device. + * + * @since 12 + */ +static const char* const COMMON_EVENT_PACKAGE_FULLY_REMOVED = "usual.event.PACKAGE_FULLY_REMOVED"; + +/** + * @brief This commonEvent means when an existing application package has been changed. + * + * @since 12 + */ +static const char* const COMMON_EVENT_PACKAGE_CHANGED = "usual.event.PACKAGE_CHANGED"; + +/** + * @brief This commonEvent means the user has restarted a package, and all of its processes have been killed. + * + * @since 12 + */ +static const char* const COMMON_EVENT_PACKAGE_RESTARTED = "usual.event.PACKAGE_RESTARTED"; + +/** + * @brief This commonEvent means the user has cleared the package data. + * + * @since 12 + */ +static const char* const COMMON_EVENT_PACKAGE_DATA_CLEARED = "usual.event.PACKAGE_DATA_CLEARED"; + +/** + * @brief This commonEvent means the user has cleared the package cache. + * + * @since 12 + */ +static const char* const COMMON_EVENT_PACKAGE_CACHE_CLEARED = "usual.event.PACKAGE_CACHE_CLEARED"; + +/** + * @brief This commonEvent means the packages have been suspended. + * + * @since 12 + */ +static const char* const COMMON_EVENT_PACKAGES_SUSPENDED = "usual.event.PACKAGES_SUSPENDED"; + +/** + * @brief This commonEvent Sent to a package that has been suspended by the system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_MY_PACKAGE_SUSPENDED = "usual.event.MY_PACKAGE_SUSPENDED"; + +/** + * @brief Sent to a package that has been un-suspended. + * + * @since 12 + */ +static const char* const COMMON_EVENT_MY_PACKAGE_UNSUSPENDED = "usual.event.MY_PACKAGE_UNSUSPENDED"; + +/** + * @brief The current device's locale has changed. + * + * @since 12 + */ +static const char* const COMMON_EVENT_LOCALE_CHANGED = "usual.event.LOCALE_CHANGED"; + +/** + * @brief Indicates low memory condition notification acknowledged by user and package + * management should be started. + * + * @since 12 + */ +static const char* const COMMON_EVENT_MANAGE_PACKAGE_STORAGE = "usual.event.MANAGE_PACKAGE_STORAGE"; + +/** + * @brief Remind new user of that the service has been unlocked. + * + * @since 12 + */ +static const char* const COMMON_EVENT_USER_UNLOCKED = "usual.event.USER_UNLOCKED"; + +/** + * @brief Distributed account logout successfully. + * + * @since 12 + */ +static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOUT = "common.event.DISTRIBUTED_ACCOUNT_LOGOUT"; + +/** + * @brief Distributed account is invalid. + * + * @since 12 + */ +static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_TOKEN_INVALID = + "common.event.DISTRIBUTED_ACCOUNT_TOKEN_INVALID"; + +/** + * @brief Distributed account logs off. + * + * @since 12 + */ +static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOFF = "common.event.DISTRIBUTED_ACCOUNT_LOGOFF"; + +/** + * @brief WIFI state. + * + * @since 12 + */ +static const char* const COMMON_EVENT_WIFI_POWER_STATE = "usual.event.wifi.POWER_STATE"; + +/** + * @brief WIFI scan results. + * + * @since 12 + */ +static const char* const COMMON_EVENT_WIFI_SCAN_FINISHED = "usual.event.wifi.SCAN_FINISHED"; + +/** + * @brief WIFI RSSI change. + * + * @since 12 + */ +static const char* const COMMON_EVENT_WIFI_RSSI_VALUE = "usual.event.wifi.RSSI_VALUE"; + +/** + * @brief WIFI connect state. + * + * @since 12 + */ +static const char* const COMMON_EVENT_WIFI_CONN_STATE = "usual.event.wifi.CONN_STATE"; + +/** + * @brief WIFI hotspot state. + * + * @since 12 + */ +static const char* const COMMON_EVENT_WIFI_HOTSPOT_STATE = "usual.event.wifi.HOTSPOT_STATE"; + +/** + * @brief WIFI ap sta join. + * + * @since 12 + */ +static const char* const COMMON_EVENT_WIFI_AP_STA_JOIN = "usual.event.wifi.WIFI_HS_STA_JOIN"; + +/** + * @brief WIFI ap sta join. + * + * @since 12 + */ +static const char* const COMMON_EVENT_WIFI_AP_STA_LEAVE = "usual.event.wifi.WIFI_HS_STA_LEAVE"; + +/** + * @brief Indicates Wi-Fi MpLink state notification acknowledged by binding or unbinding MpLink. + * + * @since 12 + */ +static const char* const COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE = "usual.event.wifi.mplink.STATE_CHANGE"; + +/** + * @brief Indicates Wi-Fi P2P connection state notification acknowledged by connecting or disconnected P2P. + * + * @since 12 + */ +static const char* const COMMON_EVENT_WIFI_P2P_CONN_STATE = "usual.event.wifi.p2p.CONN_STATE_CHANGE"; + +/** + * @brief Indicates that the Wi-Fi P2P state change. + * + * @since 12 + */ +static const char* const COMMON_EVENT_WIFI_P2P_STATE_CHANGED = "usual.event.wifi.p2p.STATE_CHANGE"; + +/** + * @brief Indicates that the Wi-Fi P2P peers state change. + * + * @since 12 + */ +static const char* const COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED = "usual.event.wifi.p2p.DEVICES_CHANGE"; + +/** + * @brief Indicates that the Wi-Fi P2P discovery state change. + * + * @since 12 + */ +static const char* const COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED = + "usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE"; + +/** + * @brief Indicates that the Wi-Fi P2P current device state change. + * + * @since 12 + */ +static const char* const COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED = + "usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE"; + +/** + * @brief Indicates that the Wi-Fi P2P group info is changed. + * + * @since 12 + */ +static const char* const COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED = "usual.event.wifi.p2p.GROUP_STATE_CHANGED"; + +/** + * @brief Nfc state change. + * + * @since 12 + */ +static const char* const COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED = "usual.event.nfc.action.ADAPTER_STATE_CHANGED"; + +/** + * @brief Nfc field on detected. + * + * @since 12 + */ +static const char* const COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED = "usual.event.nfc.action.RF_FIELD_ON_DETECTED"; + +/** + * @brief Nfc field off detected. + * + * @since 12 + */ +static const char* const COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED = "usual.event.nfc.action.RF_FIELD_OFF_DETECTED"; + +/** + * @brief Sent when stop charging battery. + * + * @since 12 + */ +static const char* const COMMON_EVENT_DISCHARGING = "usual.event.DISCHARGING"; + +/** + * @brief Sent when start charging battery. + * + * @since 12 + */ +static const char* const COMMON_EVENT_CHARGING = "usual.event.CHARGING"; + +/** + * @brief Sent when device's idle mode changed + * + * @since 12 + */ +static const char* const COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED = "usual.event.DEVICE_IDLE_MODE_CHANGED"; + +/** + * @brief Sent when device's charge idle mode changed. + * + * @since 12 + */ +static const char* const COMMON_EVENT_CHARGE_IDLE_MODE_CHANGED = "usual.event.CHARGE_IDLE_MODE_CHANGED"; + +/** + * @brief Sent when device's power save mode changed + * + * @since 12 + */ +static const char* const COMMON_EVENT_POWER_SAVE_MODE_CHANGED = "usual.event.POWER_SAVE_MODE_CHANGED"; + +/** + * @brief The usb state change events. + * This is a protected common event that can only be sent by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_USB_STATE = "usual.event.hardware.usb.action.USB_STATE"; + +/** + * @brief The usb port changed. + * This is a protected common event that can only be sent by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_USB_PORT_CHANGED = "usual.event.hardware.usb.action.USB_PORT_CHANGED"; + +/** + * @brief The usb device attached. + * This is a protected common event that can only be sent by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_USB_DEVICE_ATTACHED = "usual.event.hardware.usb.action.USB_DEVICE_ATTACHED"; + +/** + * @brief The usb device detached. + * This is a protected common event that can only be sent by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_USB_DEVICE_DETACHED = "usual.event.hardware.usb.action.USB_DEVICE_DETACHED"; + +/** + * @brief Indicates the common event Action indicating that the airplane mode status of the device changes. + * Users can register this event to listen to the change of the airplane mode status of the device. + * + * @since 12 + */ +static const char* const COMMON_EVENT_AIRPLANE_MODE_CHANGED = "usual.event.AIRPLANE_MODE"; + +/** + * @brief sent by the window manager service when the window mode is split. + * + * @since 12 + */ +static const char* const COMMON_EVENT_SPLIT_SCREEN = "common.event.SPLIT_SCREEN"; + +/** + * @brief Indicate the result of quick fix apply. + * This common event can be triggered only by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_QUICK_FIX_APPLY_RESULT = "usual.event.QUICK_FIX_APPLY_RESULT"; + +/** + * @brief Indicate the result of quick fix revoke. + * This common event can be triggered only by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_QUICK_FIX_REVOKE_RESULT = "usual.event.QUICK_FIX_REVOKE_RESULT"; + +/** + * @brief Indicate the action of a common event that the user information has been updated. + * This common event can be triggered only by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_USER_INFO_UPDATED = "usual.event.USER_INFO_UPDATED"; + +/** + * @brief Indicates the action of a common event that the phone SIM card state has changed. + * This is a protected common event that can only be sent by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_SIM_STATE_CHANGED = "usual.event.SIM_STATE_CHANGED"; + +/** + * @brief Indicates the action of a common event that the call state has been changed. + * To subscribe to this protected common event, your application must have the ohos.permission.GET_TELEPHONY_STATE + * permission. + * This is a protected common event that can only be sent by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_CALL_STATE_CHANGED = "usual.event.CALL_STATE_CHANGED"; + +/** + * @brief Indicates the action of a common event that the network state has been changed. + * This is a protected common event that can only be sent by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_NETWORK_STATE_CHANGED = "usual.event.NETWORK_STATE_CHANGED"; + +/** + * @brief Indicates the action of a common event that the signal info has been changed. + * This is a protected common event that can only be sent by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_SIGNAL_INFO_CHANGED = "usual.event.SIGNAL_INFO_CHANGED"; + +/** + * @brief This commonEvent means when the screen is unlocked. + * + * @since 12 + */ +static const char* const COMMON_EVENT_SCREEN_UNLOCKED = "usual.event.SCREEN_UNLOCKED"; + +/** + * @brief This commonEvent means when the screen is locked. + * + * @since 12 + */ +static const char* const COMMON_EVENT_SCREEN_LOCKED = "usual.event.SCREEN_LOCKED"; +#ifdef __cplusplus +} +#endif +#endif // OH_COMMONEVENT_SUPPORT_H +/** @} */ -- Gitee From baf79b25bc6e5d620c0f8f86774caee67b92041e Mon Sep 17 00:00:00 2001 From: fandongyu Date: Sat, 24 Aug 2024 16:46:21 +0800 Subject: [PATCH 145/620] Signed-off-by:fandongyu Signed-off-by: fandongyu --- multimedia/image_framework/BUILD.gn | 4 +- .../include/image/image_packer_native.h | 32 ++++---- .../include/image/image_source_native.h | 14 ++-- .../include/image/picture_native.h | 74 +++++++++---------- .../image_framework/libimage_common.ndk.json | 10 +-- .../image_framework/libimage_packer.ndk.json | 28 +++---- .../image_framework/libimage_source.ndk.json | 10 +-- .../image_framework/libpicture.ndk.json | 56 +++++++------- 8 files changed, 114 insertions(+), 114 deletions(-) diff --git a/multimedia/image_framework/BUILD.gn b/multimedia/image_framework/BUILD.gn index 9b5e9895a..f28533e28 100644 --- a/multimedia/image_framework/BUILD.gn +++ b/multimedia/image_framework/BUILD.gn @@ -48,7 +48,7 @@ ohos_ndk_library("libpicture") { ndk_description_file = "./libpicture.ndk.json" output_name = "picture" output_extension = "so" - min_compact_version = "12" + min_compact_version = "13" system_capability = "SystemCapability.Multimedia.Image.Core" system_capability_headers = [ "multimedia/image_framework/image/picture_native.h", @@ -65,7 +65,7 @@ ohos_ndk_library("libimage_common") { ndk_description_file = "./libimage_common.ndk.json" output_name = "image_common" output_extension = "so" - min_compact_version = "12" + min_compact_version = "13" system_capability = "SystemCapability.Multimedia.Image.Core" system_capability_headers = [ "multimedia/image_framework/image/image_common.h" ] diff --git a/multimedia/image_framework/include/image/image_packer_native.h b/multimedia/image_framework/include/image/image_packer_native.h index ef2081b02..b80688711 100644 --- a/multimedia/image_framework/include/image/image_packer_native.h +++ b/multimedia/image_framework/include/image/image_packer_native.h @@ -62,14 +62,14 @@ typedef struct OH_PackingOptions OH_PackingOptions; /** * @brief Defines the image sequence packing options. * - * @since 12 + * @since 13 */ struct OH_PackingOptionsForSequence; /** * @brief Defines the image sequence packing options. * - * @since 12 + * @since 13 */ typedef struct OH_PackingOptionsForSequence OH_PackingOptionsForSequence; @@ -203,7 +203,7 @@ Image_ErrorCode OH_PackingOptions_Release(OH_PackingOptions *options); * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PackingOptionsForSequence_Create(OH_PackingOptionsForSequence **options); @@ -215,7 +215,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_Create(OH_PackingOptionsForSequence * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PackingOptionsForSequence_SetFrameCount(OH_PackingOptionsForSequence *options, uint32_t frameCount); @@ -228,7 +228,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_SetFrameCount(OH_PackingOptionsForS * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options or frameCount is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PackingOptionsForSequence_GetFrameCount(OH_PackingOptionsForSequence *options, uint32_t *frameCount); @@ -242,7 +242,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_GetFrameCount(OH_PackingOptionsForS * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options or delayTimeList is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PackingOptionsForSequence_SetDelayTimeList(OH_PackingOptionsForSequence *options, int32_t *delayTimeList, size_t delayTimeListLength); @@ -256,7 +256,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_SetDelayTimeList(OH_PackingOptionsF * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options or delayTimeList is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PackingOptionsForSequence_GetDelayTimeList(OH_PackingOptionsForSequence *options, int32_t *delayTimeList, size_t delayTimeListLength); @@ -270,7 +270,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_GetDelayTimeList(OH_PackingOptionsF * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options or disposalTypes is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PackingOptionsForSequence_SetDisposalTypes(OH_PackingOptionsForSequence *options, uint32_t *disposalTypes, size_t disposalTypesLength); @@ -284,7 +284,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_SetDisposalTypes(OH_PackingOptionsF * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options or disposalTypes is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PackingOptionsForSequence_GetDisposalTypes(OH_PackingOptionsForSequence *options, uint32_t *disposalTypes, size_t disposalTypesLength); @@ -297,7 +297,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_GetDisposalTypes(OH_PackingOptionsF * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PackingOptionsForSequence_SetLoopCount(OH_PackingOptionsForSequence *options, uint32_t loopCount); @@ -309,7 +309,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_SetLoopCount(OH_PackingOptionsForSe * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options or loopCount is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PackingOptionsForSequence_GetLoopCount(OH_PackingOptionsForSequence *options, uint32_t *loopCount); @@ -320,7 +320,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_GetLoopCount(OH_PackingOptionsForSe * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PackingOptionsForSequence_Release(OH_PackingOptionsForSequence *options); @@ -374,7 +374,7 @@ Image_ErrorCode OH_ImagePackerNative_PackToDataFromPixelmap(OH_ImagePackerNative * {@link IMAGE_BAD_PARAMETER} imagePacker is nullptr, or picture is nullptr, or outData is nullptr, * or size is invalid. * {@link IMAGE_ENCODE_FAILED} encode failed. - * @since 12 + * @since 13 */ Image_ErrorCode OH_ImagePackerNative_PackToDataFromPicture(OH_ImagePackerNative *imagePacker, OH_PackingOptions *options, OH_PictureNative *picture, uint8_t *outData, size_t *size); @@ -392,7 +392,7 @@ Image_ErrorCode OH_ImagePackerNative_PackToDataFromPicture(OH_ImagePackerNative * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} one of the pointer type parameters is nullptr, or size/length is invalid * {@link IMAGE_ENCODE_FAILED} encode failed. - * @since 12 + * @since 13 */ Image_ErrorCode OH_ImagePackerNative_PackToDataFromPixelmapSequence(OH_ImagePackerNative *imagePacker, OH_PackingOptionsForSequence *options, OH_PixelmapNative **pixelmapSequence, @@ -435,7 +435,7 @@ Image_ErrorCode OH_ImagePackerNative_PackToFileFromPixelmap(OH_ImagePackerNative * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} imagePacker is nullptr, or picture is nullptr, or fd is invalid. * {@link IMAGE_ENCODE_FAILED} encode failed. - * @since 12 + * @since 13 */ Image_ErrorCode OH_ImagePackerNative_PackToFileFromPicture(OH_ImagePackerNative *imagePacker, OH_PackingOptions *options, OH_PictureNative *picture, int32_t fd); @@ -452,7 +452,7 @@ Image_ErrorCode OH_ImagePackerNative_PackToFileFromPicture(OH_ImagePackerNative * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} one of the pointer type parameters is nullptr, or length is invalid * {@link IMAGE_ENCODE_FAILED} encode failed. - * @since 12 + * @since 13 */ Image_ErrorCode OH_ImagePackerNative_PackToFileFromPixelmapSequence(OH_ImagePackerNative *imagePacker, OH_PackingOptionsForSequence *options, OH_PixelmapNative **pixelmapSequence, size_t sequenceLength, int32_t fd); diff --git a/multimedia/image_framework/include/image/image_source_native.h b/multimedia/image_framework/include/image/image_source_native.h index 803fe4928..7e54b94ef 100644 --- a/multimedia/image_framework/include/image/image_source_native.h +++ b/multimedia/image_framework/include/image/image_source_native.h @@ -66,7 +66,7 @@ typedef struct OH_ImageSource_Info OH_ImageSource_Info; * @brief Defines decoding options for picture * {@link OH_DecodingOptionsForPicture_Create}. * - * @since 12 + * @since 13 */ struct OH_DecodingOptionsForPicture; @@ -74,7 +74,7 @@ struct OH_DecodingOptionsForPicture; * @brief Defines decoding options for picture * {@link OH_DecodingOptionsForPicture_Create}. * - * @since 12 + * @since 13 */ typedef struct OH_DecodingOptionsForPicture OH_DecodingOptionsForPicture; @@ -389,7 +389,7 @@ Image_ErrorCode OH_ImageSourceNative_CreatePixelmapList(OH_ImageSourceNative *so * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} source is nullptr, or picture is nullptr. * {@link IMAGE_DECODE_FAILED} decode failed. - * @since 12 + * @since 13 */ Image_ErrorCode OH_ImageSourceNative_CreatePicture(OH_ImageSourceNative *source, OH_DecodingOptionsForPicture *options, OH_PictureNative **picture); @@ -470,7 +470,7 @@ Image_ErrorCode OH_ImageSourceNative_Release(OH_ImageSourceNative *source); * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_DecodingOptionsForPicture_Create(OH_DecodingOptionsForPicture **options); @@ -484,7 +484,7 @@ Image_ErrorCode OH_DecodingOptionsForPicture_Create(OH_DecodingOptionsForPicture * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options is nullptr, desiredAuxiliaryPictures is nullptr, * or length is invalid. - * @since 12 + * @since 13 */ Image_ErrorCode OH_DecodingOptionsForPicture_GetDesiredAuxiliaryPictures(OH_DecodingOptionsForPicture *options, Image_AuxiliaryPictureType **desiredAuxiliaryPictures, size_t *length); @@ -499,7 +499,7 @@ Image_ErrorCode OH_DecodingOptionsForPicture_GetDesiredAuxiliaryPictures(OH_Deco * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options is nullptr, desiredAuxiliaryPictures is nullptr, * or length is invalid. - * @since 12 + * @since 13 */ Image_ErrorCode OH_DecodingOptionsForPicture_SetDesiredAuxiliaryPictures(OH_DecodingOptionsForPicture *options, Image_AuxiliaryPictureType *desiredAuxiliaryPictures, size_t length); @@ -511,7 +511,7 @@ Image_ErrorCode OH_DecodingOptionsForPicture_SetDesiredAuxiliaryPictures(OH_Deco * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_DecodingOptionsForPicture_Release(OH_DecodingOptionsForPicture *options); #ifdef __cplusplus diff --git a/multimedia/image_framework/include/image/picture_native.h b/multimedia/image_framework/include/image/picture_native.h index ddc402513..42eed5065 100644 --- a/multimedia/image_framework/include/image/picture_native.h +++ b/multimedia/image_framework/include/image/picture_native.h @@ -20,7 +20,7 @@ * @brief Provides APIs for obtaining picture data and information. * * @Syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since 13 */ /** @@ -31,7 +31,7 @@ * @library libpicture.so * @kit ImageKit * @Syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since 13 */ #ifndef INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PICTURE_NATIVE_H_ #define INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PICTURE_NATIVE_H_ @@ -45,14 +45,14 @@ extern "C" { /** * @brief Define a Picture struct type, used for picture pointer controls. * - * @since 12 + * @since 13 */ struct OH_PictureNative; /** * @brief Define a Picture struct type, used for picture pointer controls. * - * @since 12 + * @since 13 */ typedef struct OH_PictureNative OH_PictureNative; @@ -60,7 +60,7 @@ typedef struct OH_PictureNative OH_PictureNative; * @brief Define a AuxiliaryPicture struct type, used for auxiliary * picture pointer controls. * - * @since 12 + * @since 13 */ struct OH_AuxiliaryPictureNative; @@ -68,7 +68,7 @@ struct OH_AuxiliaryPictureNative; * @brief Define a AuxiliaryPicture struct type, used for auxiliary * picture pointer controls. * - * @since 12 + * @since 13 */ typedef struct OH_AuxiliaryPictureNative OH_AuxiliaryPictureNative; @@ -76,7 +76,7 @@ typedef struct OH_AuxiliaryPictureNative OH_AuxiliaryPictureNative; * @brief Define a AuxiliaryPictureInfo struct type, used for auxiliary * picture info controls. * - * @since 12 + * @since 13 */ struct OH_AuxiliaryPictureInfo; @@ -84,14 +84,14 @@ struct OH_AuxiliaryPictureInfo; * @brief Define a AuxiliaryPictureInfo struct type, used for auxiliary * picture info controls. * - * @since 12 + * @since 13 */ typedef struct OH_AuxiliaryPictureInfo OH_AuxiliaryPictureInfo; /** * @brief Define a auxiliary picture type. * - * @since 12 + * @since 13 */ typedef enum { /* @@ -124,7 +124,7 @@ typedef enum { * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} mainPixelmap is nullptr, or picture is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PictureNative_CreatePicture(OH_PixelmapNative *mainPixelmap, OH_PictureNative **picture); @@ -136,7 +136,7 @@ Image_ErrorCode OH_PictureNative_CreatePicture(OH_PixelmapNative *mainPixelmap, * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or mainPixelmap is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PictureNative_GetMainPixelmap(OH_PictureNative *picture, OH_PixelmapNative **mainPixelmap); @@ -149,7 +149,7 @@ Image_ErrorCode OH_PictureNative_GetMainPixelmap(OH_PictureNative *picture, OH_P * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or hdrPixelmap is nullptr. * {@link IMAGE_UNSUPPORTED_OPERATION} Unsupported operation, e.g. the picture does not has a gainmap - * @since 12 + * @since 13 */ Image_ErrorCode OH_PictureNative_GetHdrComposedPixelmap(OH_PictureNative *picture, OH_PixelmapNative **hdrPixelmap); @@ -161,7 +161,7 @@ Image_ErrorCode OH_PictureNative_GetHdrComposedPixelmap(OH_PictureNative *pictur * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or gainmapPixelmap is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PictureNative_GetGainmapPixelmap(OH_PictureNative *picture, OH_PixelmapNative **gainmapPixelmap); @@ -174,7 +174,7 @@ Image_ErrorCode OH_PictureNative_GetGainmapPixelmap(OH_PictureNative *picture, O * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or auxiliaryPicture is nullptr, or the type is invalid. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PictureNative_SetAuxiliaryPicture(OH_PictureNative *picture, Image_AuxiliaryPictureType type, OH_AuxiliaryPictureNative *auxiliaryPicture); @@ -188,7 +188,7 @@ Image_ErrorCode OH_PictureNative_SetAuxiliaryPicture(OH_PictureNative *picture, * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or auxiliaryPicture is nullptr, or the type is invalid. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PictureNative_GetAuxiliaryPicture(OH_PictureNative *picture, Image_AuxiliaryPictureType type, OH_AuxiliaryPictureNative **auxiliaryPicture); @@ -203,7 +203,7 @@ Image_ErrorCode OH_PictureNative_GetAuxiliaryPicture(OH_PictureNative *picture, * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or metadata is nullptr. * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PictureNative_GetMetadata(OH_PictureNative *picture, Image_MetadataType metadataType, OH_PictureMetadata **metadata); @@ -218,7 +218,7 @@ Image_ErrorCode OH_PictureNative_GetMetadata(OH_PictureNative *picture, Image_Me * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} picture is nullptr, or metadata is nullptr. * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PictureNative_SetMetadata(OH_PictureNative *picture, Image_MetadataType metadataType, OH_PictureMetadata *metadata); @@ -230,7 +230,7 @@ Image_ErrorCode OH_PictureNative_SetMetadata(OH_PictureNative *picture, Image_Me * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} picture is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PictureNative_Release(OH_PictureNative *picture); @@ -246,7 +246,7 @@ Image_ErrorCode OH_PictureNative_Release(OH_PictureNative *picture); * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} data is nullptr, or dataLength is invalid, or size is nullptr, or the type * is invalid, or auxiliaryPicture is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureNative_Create(uint8_t *data, size_t dataLength, Image_Size *size, Image_AuxiliaryPictureType type, OH_AuxiliaryPictureNative **auxiliaryPicture); @@ -262,7 +262,7 @@ Image_ErrorCode OH_AuxiliaryPictureNative_Create(uint8_t *data, size_t dataLengt * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or source is nullptr, or the bufferSize is invalid. * {@link IMAGE_ALLOC_FAILED} memory alloc failed. * {@link IMAGE_COPY_FAILED} memory copy failed. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureNative_WritePixels(OH_AuxiliaryPictureNative *auxiliaryPicture, uint8_t *source, size_t bufferSize); @@ -279,7 +279,7 @@ Image_ErrorCode OH_AuxiliaryPictureNative_WritePixels(OH_AuxiliaryPictureNative * or the bufferSize is invalid. * {@link IMAGE_ALLOC_FAILED} memory alloc failed. * {@link IMAGE_COPY_FAILED} memory copy failed. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureNative_ReadPixels(OH_AuxiliaryPictureNative *auxiliaryPicture, uint8_t *destination, size_t *bufferSize); @@ -292,7 +292,7 @@ Image_ErrorCode OH_AuxiliaryPictureNative_ReadPixels(OH_AuxiliaryPictureNative * * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or type is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureNative_GetType(OH_AuxiliaryPictureNative *auxiliaryPicture, Image_AuxiliaryPictureType *type); @@ -305,7 +305,7 @@ Image_ErrorCode OH_AuxiliaryPictureNative_GetType(OH_AuxiliaryPictureNative *aux * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or info is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureNative_GetInfo(OH_AuxiliaryPictureNative *auxiliaryPicture, OH_AuxiliaryPictureInfo **info); @@ -318,7 +318,7 @@ Image_ErrorCode OH_AuxiliaryPictureNative_GetInfo(OH_AuxiliaryPictureNative *aux * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or info is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureNative_SetInfo(OH_AuxiliaryPictureNative *auxiliaryPicture, OH_AuxiliaryPictureInfo *info); @@ -334,7 +334,7 @@ Image_ErrorCode OH_AuxiliaryPictureNative_SetInfo(OH_AuxiliaryPictureNative *aux * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or metadata is nullptr. * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type, or the metadata type does not match the * auxiliary picture type. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureNative_GetMetadata(OH_AuxiliaryPictureNative *auxiliaryPicture, Image_MetadataType metadataType, OH_PictureMetadata **metadata); @@ -350,7 +350,7 @@ Image_ErrorCode OH_AuxiliaryPictureNative_GetMetadata(OH_AuxiliaryPictureNative * {@link IMAGE_BAD_PARAMETER} auxiliaryPicture is nullptr, or metadata is nullptr. * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type, or the metadata type does not match the * auxiliary picture type. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureNative_SetMetadata(OH_AuxiliaryPictureNative *auxiliaryPicture, Image_MetadataType metadataType, OH_PictureMetadata *metadata); @@ -362,7 +362,7 @@ Image_ErrorCode OH_AuxiliaryPictureNative_SetMetadata(OH_AuxiliaryPictureNative * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} picture is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureNative_Release(OH_AuxiliaryPictureNative *picture); @@ -373,7 +373,7 @@ Image_ErrorCode OH_AuxiliaryPictureNative_Release(OH_AuxiliaryPictureNative *pic * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} info is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureInfo_Create(OH_AuxiliaryPictureInfo **info); @@ -385,7 +385,7 @@ Image_ErrorCode OH_AuxiliaryPictureInfo_Create(OH_AuxiliaryPictureInfo **info); * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} info is nullptr, or type is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureInfo_GetType(OH_AuxiliaryPictureInfo *info, Image_AuxiliaryPictureType *type); @@ -397,7 +397,7 @@ Image_ErrorCode OH_AuxiliaryPictureInfo_GetType(OH_AuxiliaryPictureInfo *info, I * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} info is nullptr, or type is invalid. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureInfo_SetType(OH_AuxiliaryPictureInfo *info, Image_AuxiliaryPictureType type); @@ -409,7 +409,7 @@ Image_ErrorCode OH_AuxiliaryPictureInfo_SetType(OH_AuxiliaryPictureInfo *info, I * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} info is nullptr, or size is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureInfo_GetSize(OH_AuxiliaryPictureInfo *info, Image_Size *size); @@ -421,7 +421,7 @@ Image_ErrorCode OH_AuxiliaryPictureInfo_GetSize(OH_AuxiliaryPictureInfo *info, I * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} info is nullptr, or size is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureInfo_SetSize(OH_AuxiliaryPictureInfo *info, Image_Size *size); @@ -433,7 +433,7 @@ Image_ErrorCode OH_AuxiliaryPictureInfo_SetSize(OH_AuxiliaryPictureInfo *info, I * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} info is nullptr, or rowStride is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureInfo_GetRowStride(OH_AuxiliaryPictureInfo *info, uint32_t *rowStride); @@ -445,7 +445,7 @@ Image_ErrorCode OH_AuxiliaryPictureInfo_GetRowStride(OH_AuxiliaryPictureInfo *in * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} info is nullptr, or rowStride is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureInfo_SetRowStride(OH_AuxiliaryPictureInfo *info, uint32_t rowStride); @@ -457,7 +457,7 @@ Image_ErrorCode OH_AuxiliaryPictureInfo_SetRowStride(OH_AuxiliaryPictureInfo *in * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} info is nullptr, or pixelFormat is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureInfo_GetPixelFormat(OH_AuxiliaryPictureInfo *info, PIXEL_FORMAT *pixelFormat); @@ -469,7 +469,7 @@ Image_ErrorCode OH_AuxiliaryPictureInfo_GetPixelFormat(OH_AuxiliaryPictureInfo * * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} info is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureInfo_SetPixelFormat(OH_AuxiliaryPictureInfo *info, PIXEL_FORMAT pixelFormat); @@ -480,7 +480,7 @@ Image_ErrorCode OH_AuxiliaryPictureInfo_SetPixelFormat(OH_AuxiliaryPictureInfo * * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} info is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_AuxiliaryPictureInfo_Release(OH_AuxiliaryPictureInfo *info); diff --git a/multimedia/image_framework/libimage_common.ndk.json b/multimedia/image_framework/libimage_common.ndk.json index 9faa63b59..63d2820cc 100644 --- a/multimedia/image_framework/libimage_common.ndk.json +++ b/multimedia/image_framework/libimage_common.ndk.json @@ -1,22 +1,22 @@ [ { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PictureMetadata_Create" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PictureMetadata_GetProperty" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PictureMetadata_SetProperty" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PictureMetadata_Release" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PictureMetadata_Clone" } ] \ No newline at end of file diff --git a/multimedia/image_framework/libimage_packer.ndk.json b/multimedia/image_framework/libimage_packer.ndk.json index 694b6e2b8..c6f243504 100644 --- a/multimedia/image_framework/libimage_packer.ndk.json +++ b/multimedia/image_framework/libimage_packer.ndk.json @@ -40,43 +40,43 @@ "name": "OH_PackingOptions_Release" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PackingOptionsForSequence_Create" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PackingOptionsForSequence_SetFrameCount" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PackingOptionsForSequence_GetFrameCount" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PackingOptionsForSequence_SetDelayTimeList" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PackingOptionsForSequence_GetDelayTimeList" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PackingOptionsForSequence_SetDisposalTypes" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PackingOptionsForSequence_GetDisposalTypes" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PackingOptionsForSequence_SetLoopCount" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PackingOptionsForSequence_GetLoopCount" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PackingOptionsForSequence_Release" }, { @@ -92,11 +92,11 @@ "name": "OH_ImagePackerNative_PackToDataFromPixelmap" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImagePackerNative_PackToDataFromPicture" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImagePackerNative_PackToDataFromPixelmapSequence" }, { @@ -108,11 +108,11 @@ "name": "OH_ImagePackerNative_PackToFileFromPixelmap" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImagePackerNative_PackToFileFromPicture" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImagePackerNative_PackToFileFromPixelmapSequence" }, { diff --git a/multimedia/image_framework/libimage_source.ndk.json b/multimedia/image_framework/libimage_source.ndk.json index 133bba8ec..37312763e 100644 --- a/multimedia/image_framework/libimage_source.ndk.json +++ b/multimedia/image_framework/libimage_source.ndk.json @@ -100,7 +100,7 @@ "name": "OH_ImageSourceNative_CreatePixelmapList" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageSourceNative_CreatePicture" }, { @@ -128,19 +128,19 @@ "name": "OH_ImageSourceNative_Release" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_DecodingOptionsForPicture_Create" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_DecodingOptionsForPicture_GetDesiredAuxiliaryPictures" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_DecodingOptionsForPicture_SetDesiredAuxiliaryPictures" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_DecodingOptionsForPicture_Release" } ] \ No newline at end of file diff --git a/multimedia/image_framework/libpicture.ndk.json b/multimedia/image_framework/libpicture.ndk.json index d74f9c0f2..e236c17a4 100644 --- a/multimedia/image_framework/libpicture.ndk.json +++ b/multimedia/image_framework/libpicture.ndk.json @@ -1,114 +1,114 @@ [ { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PictureNative_CreatePicture" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PictureNative_GetMainPixelmap" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PictureNative_GetHdrComposedPixelmap" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PictureNative_GetGainmapPixelmap" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PictureNative_SetAuxiliaryPicture" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PictureNative_GetAuxiliaryPicture" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PictureNative_GetMetadata" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PictureNative_SetMetadata" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_PictureNative_Release" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureNative_Create" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureNative_WritePixels" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureNative_ReadPixels" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureNative_GetType" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureNative_GetInfo" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureNative_SetInfo" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureNative_GetMetadata" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureNative_SetMetadata" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureNative_Release" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureInfo_Create" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureInfo_GetType" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureInfo_SetType" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureInfo_GetSize" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureInfo_SetSize" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureInfo_GetRowStride" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureInfo_SetRowStride" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureInfo_GetPixelFormat" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureInfo_SetPixelFormat" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_AuxiliaryPictureInfo_Release" } ] \ No newline at end of file -- Gitee From 85e0969cc41236a0d332e6608dd22f2e315843f2 Mon Sep 17 00:00:00 2001 From: z30049243 Date: Sat, 24 Aug 2024 17:45:36 +0800 Subject: [PATCH 146/620] =?UTF-8?q?=E6=97=8B=E8=BD=AC=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E7=9A=84d.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: z30049243 --- multimedia/camera_framework/photo_output.h | 14 ++++++++++ multimedia/camera_framework/preview_output.h | 28 ++++++++++++++++++++ multimedia/camera_framework/video_output.h | 14 ++++++++++ 3 files changed, 56 insertions(+) diff --git a/multimedia/camera_framework/photo_output.h b/multimedia/camera_framework/photo_output.h index 2ec0654fe..e9ced68e3 100644 --- a/multimedia/camera_framework/photo_output.h +++ b/multimedia/camera_framework/photo_output.h @@ -222,6 +222,20 @@ Camera_ErrorCode OH_PhotoOutput_UnregisterCallback(Camera_PhotoOutput* photoOutp Camera_ErrorCode OH_PhotoOutput_RegisterCaptureStartWithInfoCallback(Camera_PhotoOutput* photoOutput, OH_PhotoOutput_CaptureStartWithInfo callback); +/** + * @brief Get the photo rotation angle. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance which used to get the photo rotation angle. + * @param deviceDegree the current device rotation degree. + * @param imageRotation the {@link Camera_ImageRotation} result of photo rotation angle. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_GetPhotoRotation(Camera_PhotoOutput* photoOutput, int deviceDegree, + Camera_ImageRotation* imageRotation); + /** * @brief Unregister capture start event callback. * diff --git a/multimedia/camera_framework/preview_output.h b/multimedia/camera_framework/preview_output.h index e59214707..015cd2882 100644 --- a/multimedia/camera_framework/preview_output.h +++ b/multimedia/camera_framework/preview_output.h @@ -190,6 +190,34 @@ Camera_ErrorCode OH_PreviewOutput_GetActiveProfile(Camera_PreviewOutput* preview */ Camera_ErrorCode OH_PreviewOutput_DeleteProfile(Camera_Profile* profile); +/** + * @brief Gets the preview rotation angle. + * + * @param previewOutput the {@link Camera_PreviewOutput} instance which used to get the preview rotation angle. + * @param displayRotation the current display rotation angle. + * @param imageRotation the {@link Camera_ImageRotation} result of preview rotation angle. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_PreviewOutput_GetPreviewRotation(Camera_PreviewOutput* previewOutput, int displayRotation, + Camera_ImageRotation* imageRotation); + +/** + * @brief Sets the preview rotation angle. + * + * @param previewOutput the {@link Camera_PreviewOutput} instance which used to get the preview rotation angle. + * @param previewRotation the {@link Camera_ImageRotation} result of preview rotation angle. + * @param isDisplayLocked True means the display is locked. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_PreviewOutput_SetPreviewRotation(Camera_PreviewOutput* previewOutput, + Camera_ImageRotation previewRotation, bool isDisplayLocked); + /** * @brief Get supported preview output frame rate list. * diff --git a/multimedia/camera_framework/video_output.h b/multimedia/camera_framework/video_output.h index 3f993c82e..9ff07d45a 100644 --- a/multimedia/camera_framework/video_output.h +++ b/multimedia/camera_framework/video_output.h @@ -188,6 +188,20 @@ Camera_ErrorCode OH_VideoOutput_GetActiveProfile(Camera_VideoOutput* videoOutput */ Camera_ErrorCode OH_VideoOutput_DeleteProfile(Camera_VideoProfile* profile); +/** + * @brief Get the video rotation angle. + * + * @param videoOutput the {@link Camera_VideoOutput} instance which used to get the video rotation angle. + * @param deviceDegree the current device rotation degree. + * @param imageRotation the {@link Camera_ImageRotation} result of video rotation angle. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_VideoOutput_GetVideoRotation(Camera_VideoOutput* videoOutput, int deviceDegree, + Camera_ImageRotation* imageRotation); + /** * @brief Get supported video output frame rate list. * -- Gitee From 5ba28f7d74d45d769ff9d373f7f6d8bf356ab346 Mon Sep 17 00:00:00 2001 From: z30049243 Date: Sat, 24 Aug 2024 18:37:52 +0800 Subject: [PATCH 147/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: z30049243 --- multimedia/camera_framework/photo_output.h | 2 +- multimedia/camera_framework/preview_output.h | 4 ++-- multimedia/camera_framework/video_output.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/multimedia/camera_framework/photo_output.h b/multimedia/camera_framework/photo_output.h index e9ced68e3..91ac87547 100644 --- a/multimedia/camera_framework/photo_output.h +++ b/multimedia/camera_framework/photo_output.h @@ -229,7 +229,7 @@ Camera_ErrorCode OH_PhotoOutput_RegisterCaptureStartWithInfoCallback(Camera_Phot * @param deviceDegree the current device rotation degree. * @param imageRotation the {@link Camera_ImageRotation} result of photo rotation angle. * @return {@link #CAMERA_OK} if the method call succeeds. - * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. * @since 12 */ diff --git a/multimedia/camera_framework/preview_output.h b/multimedia/camera_framework/preview_output.h index 015cd2882..509198fd4 100644 --- a/multimedia/camera_framework/preview_output.h +++ b/multimedia/camera_framework/preview_output.h @@ -197,7 +197,7 @@ Camera_ErrorCode OH_PreviewOutput_DeleteProfile(Camera_Profile* profile); * @param displayRotation the current display rotation angle. * @param imageRotation the {@link Camera_ImageRotation} result of preview rotation angle. * @return {@link #CAMERA_OK} if the method call succeeds. - * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. * @since 12 */ @@ -211,7 +211,7 @@ Camera_ErrorCode OH_PreviewOutput_GetPreviewRotation(Camera_PreviewOutput* previ * @param previewRotation the {@link Camera_ImageRotation} result of preview rotation angle. * @param isDisplayLocked True means the display is locked. * @return {@link #CAMERA_OK} if the method call succeeds. - * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. * @since 12 */ diff --git a/multimedia/camera_framework/video_output.h b/multimedia/camera_framework/video_output.h index 9ff07d45a..8a79f7968 100644 --- a/multimedia/camera_framework/video_output.h +++ b/multimedia/camera_framework/video_output.h @@ -195,7 +195,7 @@ Camera_ErrorCode OH_VideoOutput_DeleteProfile(Camera_VideoProfile* profile); * @param deviceDegree the current device rotation degree. * @param imageRotation the {@link Camera_ImageRotation} result of video rotation angle. * @return {@link #CAMERA_OK} if the method call succeeds. - * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. * @since 12 */ -- Gitee From bef5d38d06bf166307c61b82f05ca5a42e9d71b5 Mon Sep 17 00:00:00 2001 From: z30049243 Date: Sat, 24 Aug 2024 18:56:32 +0800 Subject: [PATCH 148/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: z30049243 --- multimedia/camera_framework/photo_output.h | 4 ++-- multimedia/camera_framework/preview_output.h | 8 ++++---- multimedia/camera_framework/video_output.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/multimedia/camera_framework/photo_output.h b/multimedia/camera_framework/photo_output.h index 91ac87547..70f909bcf 100644 --- a/multimedia/camera_framework/photo_output.h +++ b/multimedia/camera_framework/photo_output.h @@ -223,13 +223,13 @@ Camera_ErrorCode OH_PhotoOutput_RegisterCaptureStartWithInfoCallback(Camera_Phot OH_PhotoOutput_CaptureStartWithInfo callback); /** - * @brief Get the photo rotation angle. + * @brief Gets the photo rotation angle. * * @param photoOutput the {@link Camera_PhotoOutput} instance which used to get the photo rotation angle. * @param deviceDegree the current device rotation degree. * @param imageRotation the {@link Camera_ImageRotation} result of photo rotation angle. * @return {@link #CAMERA_OK} if the method call succeeds. - * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. * @since 12 */ diff --git a/multimedia/camera_framework/preview_output.h b/multimedia/camera_framework/preview_output.h index 509198fd4..6ae228ba2 100644 --- a/multimedia/camera_framework/preview_output.h +++ b/multimedia/camera_framework/preview_output.h @@ -197,7 +197,7 @@ Camera_ErrorCode OH_PreviewOutput_DeleteProfile(Camera_Profile* profile); * @param displayRotation the current display rotation angle. * @param imageRotation the {@link Camera_ImageRotation} result of preview rotation angle. * @return {@link #CAMERA_OK} if the method call succeeds. - * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. * @since 12 */ @@ -208,10 +208,10 @@ Camera_ErrorCode OH_PreviewOutput_GetPreviewRotation(Camera_PreviewOutput* previ * @brief Sets the preview rotation angle. * * @param previewOutput the {@link Camera_PreviewOutput} instance which used to get the preview rotation angle. - * @param previewRotation the {@link Camera_ImageRotation} result of preview rotation angle. - * @param isDisplayLocked True means the display is locked. + * @param previewRotation the {@link Camera_ImageRotation} of preview display rotation angle. + * @param isDisplayLocked TRUE means the display is locked. * @return {@link #CAMERA_OK} if the method call succeeds. - * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. * @since 12 */ diff --git a/multimedia/camera_framework/video_output.h b/multimedia/camera_framework/video_output.h index 8a79f7968..d0228d3e7 100644 --- a/multimedia/camera_framework/video_output.h +++ b/multimedia/camera_framework/video_output.h @@ -189,13 +189,13 @@ Camera_ErrorCode OH_VideoOutput_GetActiveProfile(Camera_VideoOutput* videoOutput Camera_ErrorCode OH_VideoOutput_DeleteProfile(Camera_VideoProfile* profile); /** - * @brief Get the video rotation angle. + * @brief Gets the video rotation angle. * * @param videoOutput the {@link Camera_VideoOutput} instance which used to get the video rotation angle. * @param deviceDegree the current device rotation degree. * @param imageRotation the {@link Camera_ImageRotation} result of video rotation angle. * @return {@link #CAMERA_OK} if the method call succeeds. - * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. * @since 12 */ -- Gitee From f79d12d0c6ee335f1b32ea36eeef62002155d0d4 Mon Sep 17 00:00:00 2001 From: z30049243 Date: Sat, 24 Aug 2024 18:59:36 +0800 Subject: [PATCH 149/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: z30049243 --- multimedia/camera_framework/preview_output.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/camera_framework/preview_output.h b/multimedia/camera_framework/preview_output.h index 6ae228ba2..15e67085d 100644 --- a/multimedia/camera_framework/preview_output.h +++ b/multimedia/camera_framework/preview_output.h @@ -207,7 +207,7 @@ Camera_ErrorCode OH_PreviewOutput_GetPreviewRotation(Camera_PreviewOutput* previ /** * @brief Sets the preview rotation angle. * - * @param previewOutput the {@link Camera_PreviewOutput} instance which used to get the preview rotation angle. + * @param previewOutput the {@link Camera_PreviewOutput} instance which used to set the preview rotation angle. * @param previewRotation the {@link Camera_ImageRotation} of preview display rotation angle. * @param isDisplayLocked TRUE means the display is locked. * @return {@link #CAMERA_OK} if the method call succeeds. -- Gitee From 5c4b0bf58c1df125d4558b8145645ae743daac6e Mon Sep 17 00:00:00 2001 From: huchang Date: Sat, 24 Aug 2024 20:03:02 +0800 Subject: [PATCH 150/620] add audiokit tag Signed-off-by: huchang Change-Id: I0196d57bc6cfa16b7dbb620efbcf1c1043fa761c --- multimedia/audio_framework/audio_manager/native_audio_manager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/multimedia/audio_framework/audio_manager/native_audio_manager.h b/multimedia/audio_framework/audio_manager/native_audio_manager.h index b25ae98d8..24c37f94b 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_manager.h @@ -32,6 +32,7 @@ * * @library libohaudio.so * @syscap SystemCapability.Multimedia.Audio.Core + * @kit AudioKit * @since 12 * @version 1.0 */ -- Gitee From 269a5d9d2c75ff325c6cf1b14aa18bcd9a5b1cbc Mon Sep 17 00:00:00 2001 From: rchdlee Date: Sat, 24 Aug 2024 23:41:10 +0800 Subject: [PATCH 151/620] =?UTF-8?q?avcodec=E6=8E=A5=E5=8F=A3=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E5=A2=9E=E5=8A=A0=E5=B7=B2=E6=9C=89=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rchdlee --- multimedia/av_codec/native_avcodec_videodecoder.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 7cb92a41c..a6c2ebfe8 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -164,6 +164,7 @@ OH_AVErrCode OH_VideoDecoder_Configure(OH_AVCodec *codec, OH_AVFormat *format); * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, if {@link OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE} is correctly configured, but decoder's output surface is not set, the operation is not permitted. * @since 9 */ OH_AVErrCode OH_VideoDecoder_Prepare(OH_AVCodec *codec); @@ -458,4 +459,4 @@ OH_AVErrCode OH_VideoDecoder_SetDecryptionConfig(OH_AVCodec *codec, MediaKeySess } #endif -#endif // NATIVE_AVCODEC_VIDEODECODER_H \ No newline at end of file +#endif // NATIVE_AVCODEC_VIDEODECODER_H -- Gitee From a66c9d91d5b5aadef527edfea18f76ab8618c53d Mon Sep 17 00:00:00 2001 From: wangsen1994 Date: Sat, 24 Aug 2024 19:29:35 +0800 Subject: [PATCH 152/620] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=B8=B8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangsen1994 --- .../commonevent/oh_commonevent_support.h | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/BasicServicesKit/commonevent/oh_commonevent_support.h b/BasicServicesKit/commonevent/oh_commonevent_support.h index 2f4b77898..67f77687b 100644 --- a/BasicServicesKit/commonevent/oh_commonevent_support.h +++ b/BasicServicesKit/commonevent/oh_commonevent_support.h @@ -521,6 +521,40 @@ static const char* const COMMON_EVENT_SCREEN_UNLOCKED = "usual.event.SCREEN_UNLO * @since 12 */ static const char* const COMMON_EVENT_SCREEN_LOCKED = "usual.event.SCREEN_LOCKED"; + +/** + * @brief This commonEvent means when the http proxy change. + * + * This is a protected common event that can only be sent by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_HTTP_PROXY_CHANGE = "usual.event.HTTP_PROXY_CHANGE"; + +/** + * @brief This commonEvent means when the network connectivityy change. + * + * This is a protected common event that can only be sent by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_CONNECTIVITY_CHANGE = "usual.event.CONNECTIVITY_CHANGE"; + +/** + * @brief This common event means that minors mode is enabled. + * This is a protected common event that can only be sent by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_MINORSMODE_ON = "usual.event.MINORSMODE_ON"; + +/** + * @brief This common event means that minors mode is disabled. + * This is a protected common event that can only be sent by system. + * + * @since 12 + */ +static const char* const COMMON_EVENT_MINORSMODE_OFF = "usual.event.MINORSMODE_OFF"; #ifdef __cplusplus } #endif -- Gitee From 911c846762e8b7d0fa7603f8c93dc57f98474baf Mon Sep 17 00:00:00 2001 From: libliang Date: Sun, 25 Aug 2024 13:51:50 +0800 Subject: [PATCH 153/620] first checin in setDefaultDevice Signed-off-by: libliang --- .../audio_renderer/native_audiorenderer.h | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index baf29a672..1690861de 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -480,6 +480,29 @@ OH_AudioStream_Result OH_AudioRenderer_SetSilentModeAndMixWithOthers( OH_AudioStream_Result OH_AudioRenderer_GetSilentModeAndMixWithOthers( OH_AudioRenderer* renderer, bool* on); +/** + * @brief Temporarily changes the current audio device + * This function applys on audiorenderers whose StreamUsage are + * STREAM_USAGE_VOICE_COMMUNICATIN/STREAM_USAGE_VIDEO_COMMUNICATION/STREAM_USAGE_VOICE_MESSAGE. + * Setting the device will ony takes effect if no other accessory such as headphoes are in use. + * + * @param renderer Renderer generated by OH_AudioStreamBuilder_GenerateRenderer() + * @param deviceType The target device. The available deviceTypes are: + * EARPIECE: Built-in earpiece + * SPEAKER: Built-in speaker + * DEFAULT: System default output device + * @return result code for this function. + * {@link #AUDIOSTREAM_SUCCESS} succeed in setting the default output device + * {@link AUDIOSTREAM_ERROR_INVALID_PARAM}: + * 1.The param of renderer is nullptr; + * 2.The param of deviceType is not valid + * {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} This audiorenderer can not reset the output device + * {@link #AUDIOSTREAM_ERROR_SYSTEM} system error when calling this function. + * @since 12 + */ +OH_AudioStream_Result OH_AudioRenderer_SetDefaultOutputDevice( + OH_AudioRenderer* renderer, OH_AudioDevice_Type deviceType); + #ifdef __cplusplus } #endif -- Gitee From f1db35af14f0ddba6e3263cd5adc841188a71f28 Mon Sep 17 00:00:00 2001 From: libliang Date: Sun, 25 Aug 2024 14:28:54 +0800 Subject: [PATCH 154/620] add releated header Signed-off-by: libliang --- multimedia/audio_framework/audio_renderer/native_audiorenderer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index 1690861de..cde3790f8 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -43,6 +43,7 @@ #include #include #include "native_audiostream_base.h" +#include "native_audio_device_base.h" #include "multimedia/native_audio_channel_layout.h" #ifdef __cplusplus extern "C" { -- Gitee From df921e144d0891d1f40ab67af84b1e12ca7b911e Mon Sep 17 00:00:00 2001 From: zhengqiyi Date: Sun, 25 Aug 2024 08:05:12 +0000 Subject: [PATCH 155/620] fix node click distance number Signed-off-by: zhengqiyi --- arkui/ace_engine/native/native_node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 6f4531d7d..82fb26773 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -1822,7 +1822,7 @@ typedef enum { * .value[0].f32: allowed moving distance of a finger, in vp. \n * */ - NODE_CLICK_DISTANCE = 96, + NODE_CLICK_DISTANCE = 97, /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. -- Gitee From d035f17550b8eba5556897a0a24da20869809ed5 Mon Sep 17 00:00:00 2001 From: libliang Date: Sun, 25 Aug 2024 16:27:08 +0800 Subject: [PATCH 156/620] add the ohaudio.ndk.json Signed-off-by: libliang --- multimedia/audio_framework/ohaudio.ndk.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 58b9ad34e..dc74200c7 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -367,4 +367,8 @@ "first_introduced": "12", "name": "OH_AudioRoutingManager_GetPreferredInputDevice" } + { + "first_introduced": "12", + "name":"OH_AudioRenderer_SetDefaultOutputDevice" + }, ] -- Gitee From bd533c116570a02f1dd1010383c2ceed985911c5 Mon Sep 17 00:00:00 2001 From: libliang Date: Sun, 25 Aug 2024 16:53:03 +0800 Subject: [PATCH 157/620] fix the # error Signed-off-by: libliang --- .../audio_framework/audio_renderer/native_audiorenderer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index cde3790f8..49c765ff6 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -494,10 +494,10 @@ OH_AudioStream_Result OH_AudioRenderer_GetSilentModeAndMixWithOthers( * DEFAULT: System default output device * @return result code for this function. * {@link #AUDIOSTREAM_SUCCESS} succeed in setting the default output device - * {@link AUDIOSTREAM_ERROR_INVALID_PARAM}: + * {@link #AUDIOSTREAM_ERROR_INVALID_PARAM}: * 1.The param of renderer is nullptr; * 2.The param of deviceType is not valid - * {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} This audiorenderer can not reset the output device + * {@link #AUDIOSTREAM_ERROR_ILLEGAL_STATE} This audiorenderer can not reset the output device * {@link #AUDIOSTREAM_ERROR_SYSTEM} system error when calling this function. * @since 12 */ -- Gitee From 4ffaf9b26b40b4520ba8dfc186ab05f995d7b8b0 Mon Sep 17 00:00:00 2001 From: libliang Date: Sun, 25 Aug 2024 19:01:19 +0800 Subject: [PATCH 158/620] fix ohaudio.ndk error Signed-off-by: libliang --- multimedia/audio_framework/ohaudio.ndk.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index dc74200c7..6d94eba3c 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -366,9 +366,9 @@ { "first_introduced": "12", "name": "OH_AudioRoutingManager_GetPreferredInputDevice" - } + }, { "first_introduced": "12", - "name":"OH_AudioRenderer_SetDefaultOutputDevice" - }, + "name":"OH_AudioRenderer_SetDefaultOutputDevice" + } ] -- Gitee From 2c6636b59071ef1af769653cb6c98e6080a1218b Mon Sep 17 00:00:00 2001 From: rchdlee Date: Sun, 25 Aug 2024 19:39:46 +0800 Subject: [PATCH 159/620] =?UTF-8?q?=E8=A1=A5=E5=85=85=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rchdlee --- multimedia/av_codec/native_avcodec_videodecoder.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index a6c2ebfe8..55e575b4e 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -164,7 +164,7 @@ OH_AVErrCode OH_VideoDecoder_Configure(OH_AVCodec *codec, OH_AVFormat *format); * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. - * {@link AV_ERR_OPERATE_NOT_PERMIT}, if {@link OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE} is correctly configured, but decoder's output surface is not set, the operation is not permitted. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, decoder is in buffer mode and color space conversion is configured. * @since 9 */ OH_AVErrCode OH_VideoDecoder_Prepare(OH_AVCodec *codec); @@ -181,6 +181,7 @@ OH_AVErrCode OH_VideoDecoder_Prepare(OH_AVCodec *codec); * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, video color space conversion is configured but decoder is not prepared. * @since 9 */ OH_AVErrCode OH_VideoDecoder_Start(OH_AVCodec *codec); -- Gitee From 429e06c05062a242b7048a92817fa6c624d1117e Mon Sep 17 00:00:00 2001 From: rchdlee Date: Sun, 25 Aug 2024 19:41:04 +0800 Subject: [PATCH 160/620] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=A9=BA=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rchdlee --- multimedia/av_codec/native_avcodec_videodecoder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 55e575b4e..f4b58bcbc 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -460,4 +460,4 @@ OH_AVErrCode OH_VideoDecoder_SetDecryptionConfig(OH_AVCodec *codec, MediaKeySess } #endif -#endif // NATIVE_AVCODEC_VIDEODECODER_H +#endif // NATIVE_AVCODEC_VIDEODECODER_H \ No newline at end of file -- Gitee From 3ce529f2a191c4f516ec6e0df136a16ce9279c16 Mon Sep 17 00:00:00 2001 From: lvshiqi Date: Mon, 26 Aug 2024 09:44:54 +0800 Subject: [PATCH 161/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lvshiqi Change-Id: I99a3aff7712ba3f49d8e6f9b2ba6070602cf2c9b --- graphic/graphic_2d/native_drawing/drawing_canvas.h | 2 +- graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_canvas.h b/graphic/graphic_2d/native_drawing/drawing_canvas.h index 783230ec9..f78e6127f 100644 --- a/graphic/graphic_2d/native_drawing/drawing_canvas.h +++ b/graphic/graphic_2d/native_drawing/drawing_canvas.h @@ -840,7 +840,7 @@ OH_Drawing_ErrorCode OH_Drawing_CanvasGetImageInfo(OH_Drawing_Canvas* canvas, OH * @since 13 * @version 1.0 */ -OH_Drawing_ErrorCode OH_Drawing_Drawing_CanvasDrawRecordCmd(OH_Drawing_Canvas* canvas, OH_Drawing_RecordCmd* recordCmd); +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawRecordCmd(OH_Drawing_Canvas* canvas, OH_Drawing_RecordCmd* recordCmd); #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index e6b537d68..9c5b0d269 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1444,7 +1444,7 @@ }, { "first_introduced": "13", - "name":"OH_Drawing_Drawing_CanvasDrawRecordCmd" + "name":"OH_Drawing_CanvasDrawRecordCmd" }, { "first_introduced": "13", -- Gitee From 0d888f47ac1c4ab49fe997a86d3a8d372055ab37 Mon Sep 17 00:00:00 2001 From: wuchengwen Date: Mon, 26 Aug 2024 09:50:36 +0800 Subject: [PATCH 162/620] fix:inputmethod doc Signed-off-by: wuchengwen --- inputmethod/include/inputmethod_controller_capi.h | 4 ++-- inputmethod/include/inputmethod_inputmethod_proxy_capi.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inputmethod/include/inputmethod_controller_capi.h b/inputmethod/include/inputmethod_controller_capi.h index 0816e69f8..abfc5cbdc 100644 --- a/inputmethod/include/inputmethod_controller_capi.h +++ b/inputmethod/include/inputmethod_controller_capi.h @@ -51,7 +51,7 @@ extern "C" { * If the call succeeds, caller cannot release textEditorProxy until the next attach or detach call. * @param options Represents a pointer to an {@link InputMethod_AttachOptions} instance. * The options when attaching input method. - * @param inputMethodProxy Represents a pointer to an {@link OH_InputMethod_InputMethodProxy} instance. + * @param inputMethodProxy Represents a pointer to an {@link InputMethod_InputMethodProxy} instance. * Lifecycle is mantianed until the next attach or detach call. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. @@ -68,7 +68,7 @@ InputMethod_ErrorCode OH_InputMethodController_Attach(InputMethod_TextEditorProx /** * @brief Detach application from the input method service. * - * @param inputMethodProxy Represents a pointer to an {@link OH_InputMethod_InputMethodProxy} instance. + * @param inputMethodProxy Represents a pointer to an {@link InputMethod_InputMethodProxy} instance. * The inputMethodProxy is obtained from {@link OH_InputMethodController_Attach}. * @return Returns a specific error code. * {@link IME_ERR_OK} - success. diff --git a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h index e542d96da..c0ae0a12c 100644 --- a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h +++ b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h @@ -150,7 +150,7 @@ InputMethod_ErrorCode OH_InputMethodProxy_NotifyCursorUpdate( /** * @brief Send private command. * - * @param inputMethodProxy Represents a pointer to an {@link OH_InputMethod_InputMethodProxy} instance. + * @param inputMethodProxy Represents a pointer to an {@link InputMethod_InputMethodProxy} instance. * The inputMethodProxy is obtained from {@link OH_InputMethodController_Attach}. * @param privateCommand The private commands, which is defined in {@link InputMethod_PrivateCommand}. Max size 32KB. * @param size The size of privateCommand. Max is 5. -- Gitee From 3f537b6ab4470aff960a358fc0868be516f85390 Mon Sep 17 00:00:00 2001 From: lipengfei Date: Mon, 26 Aug 2024 10:19:05 +0800 Subject: [PATCH 163/620] =?UTF-8?q?=E7=9F=AD=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0CAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lipengfei --- backgroundtasks/transient/BUILD.gn | 35 ++++++ .../transient/include/transient_task_api.h | 106 ++++++++++++++++++ .../transient/include/transient_task_type.h | 105 +++++++++++++++++ .../transient/libtransient_task.ndk.json | 14 +++ 4 files changed, 260 insertions(+) create mode 100644 backgroundtasks/transient/BUILD.gn create mode 100644 backgroundtasks/transient/include/transient_task_api.h create mode 100644 backgroundtasks/transient/include/transient_task_type.h create mode 100644 backgroundtasks/transient/libtransient_task.ndk.json diff --git a/backgroundtasks/transient/BUILD.gn b/backgroundtasks/transient/BUILD.gn new file mode 100644 index 000000000..1a04c838e --- /dev/null +++ b/backgroundtasks/transient/BUILD.gn @@ -0,0 +1,35 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_library("libtransient_task_ndk") { + output_name = "transient_task_ndk" + output_extension = "so" + ndk_description_file = "./libtransient_task.ndk.json" + system_capability = + "SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask" + system_capability_headers = [ + "include/transient_task_api.h", + "include/transient_task_type.h", + ] +} + +ohos_ndk_headers("transient_task_header") { + dest_dir = "$ndk_headers_out_dir/transient_task" + sources = [ + "include/transient_task_api.h", + "include/transient_task_type.h", + ] +} diff --git a/backgroundtasks/transient/include/transient_task_api.h b/backgroundtasks/transient/include/transient_task_api.h new file mode 100644 index 000000000..9beea8279 --- /dev/null +++ b/backgroundtasks/transient/include/transient_task_api.h @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_BACKGROUOND_TASK_MANAGER_TRANSIENT_TASK_API_H +#define OHOS_BACKGROUOND_TASK_MANAGER_TRANSIENT_TASK_API_H + +#include + +#include "transient_task_type.h" + +/** + * @addtogroup TransientTask + * @{ + * + * @brief Provide C interface for the Transient task management. + * + * @since 13 + * @version 1.0 + */ + +/** + * @file transient_task_api.h + * + * @brief Declares the APIs for Transient task management. + * + * @library libtransient_task_ndk + * @kit BackgroundTasksKit + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @since 13 + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Requests delayed transition to the suspended state. + * + * @param reason Indicates the reason for delayed transition to the suspended state. + * @param callback Indicates the callback delay time expired. + * @param delaySuspendInfo Indicates the info of delay request. + * @return {@link ERR_TRANSIENT_TASK_OK} 0 - Success. + * {@link ERR_TRANSIENT_TASK_INVALID_PARAM} 401 - Invalid parameter. + * {@link ERR_TRANSIENT_TASK_PARCEL_FAILED} 9800002 - Parcelable failed. + * {@link ERR_TRANSIENT_TASK_TRANSACTION_FAILED} 9800003 - Transact failed. + * {@link ERR_TRANSIENT_TASK_SYS_NOT_READY} 9800004 - System service not ready. + * {@link ERR_TRANSIENT_TASK_CLIENT_INFO_VERIFICATION_FAILED} 9900001 - uid or pid info verify failed. + * {@link ERR_TRANSIENT_TASK_SERVICE_VERIFICATION_FAILED} 9900002 - Transient task verification failed. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @since 13 + * @version 1.0 + */ +int32_t OH_BackgroundTaskManager_RequestSuspendDelay(const char* reason, + TransientTask_Callback callback, TransientTask_DelaySuspendInfo *info); + +/** + * @brief Obtains the remaining time before an application enters the suspended state. + * + * @param requestId Indicates the identifier of the delay request. + * @param time Indicates the remaining Time. + * @return {@link ERR_TRANSIENT_TASK_OK} 0 - Success. + * {@link ERR_TRANSIENT_TASK_INVALID_PARAM} 401 - Invalid parameter. + * {@link ERR_TRANSIENT_TASK_PARCEL_FAILED} 9800002 - Parcelable failed. + * {@link ERR_TRANSIENT_TASK_TRANSACTION_FAILED} 9800003 - Transact failed. + * {@link ERR_TRANSIENT_TASK_SYS_NOT_READY} 9800004 - System service not ready. + * {@link ERR_TRANSIENT_TASK_CLIENT_INFO_VERIFICATION_FAILED} 9900001 - uid or pid info verify failed. + * {@link ERR_TRANSIENT_TASK_SERVICE_VERIFICATION_FAILED} 9900002 - Transient task verification failed. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @since 13 + * @version 1.0 + */ +int32_t OH_BackgroundTaskManager_GetRemainingDelayTime(int32_t requestId, int32_t *delayTime); + +/** + * @brief Cancels delayed transition to the suspended state. + * + * @param requestId Indicates the identifier of the delay request. + * @return {@link ERR_TRANSIENT_TASK_OK} 0 - Success. + * {@link ERR_TRANSIENT_TASK_INVALID_PARAM} 401 - Invalid parameter. + * {@link ERR_TRANSIENT_TASK_PARCEL_FAILED} 9800002 - Parcelable failed. + * {@link ERR_TRANSIENT_TASK_TRANSACTION_FAILED} 9800003 - Transact failed. + * {@link ERR_TRANSIENT_TASK_SYS_NOT_READY} 9800004 - System service not ready. + * {@link ERR_TRANSIENT_TASK_CLIENT_INFO_VERIFICATION_FAILED} 9900001 - uid or pid info verify failed. + * {@link ERR_TRANSIENT_TASK_SERVICE_VERIFICATION_FAILED} 9900002 - Transient task verification failed. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @since 13 + * @version 1.0 + */ +int32_t OH_BackgroundTaskManager_CancelSuspendDelay(int32_t requestId); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/backgroundtasks/transient/include/transient_task_type.h b/backgroundtasks/transient/include/transient_task_type.h new file mode 100644 index 000000000..7895f85b2 --- /dev/null +++ b/backgroundtasks/transient/include/transient_task_type.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_BACKGROUOND_TASK_MANAGER_TRANSIENT_TASK_TYPE_H +#define OHOS_BACKGROUOND_TASK_MANAGER_TRANSIENT_TASK_TYPE_H + +/** + * @addtogroup TransientTask + * @{ + * + * @brief Provide C interface for the transient task management. + * + * @since 13 + * @version 1.0 + */ + +/** + * @file transient_task_type.h + * + * @brief Defines the data structures for the C APIs of transient task. + * + * @library libtransient_task_ndk + * @kit BackgroundTasksKit + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @since 11 + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif +/** + * @brief Enum for transient task error code. + * + * @since 13 + */ +typedef enum TransientTask_ErrorCode { + /** + * @error result is ok. + */ + ERR_TRANSIENT_TASK_OK = 0, + /** + * @error Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameters types. + */ + ERR_TRANSIENT_TASK_INVALID_PARAM = 401, + /** + * @error Parcel operation failed. + */ + ERR_TRANSIENT_TASK_PARCEL_FAILED = 9800002, + /** + * @error Internal transaction failed. + */ + ERR_TRANSIENT_TASK_TRANSACTION_FAILED = 9800003, + /** + * @error System service operation failed. + */ + ERR_TRANSIENT_TASK_SYS_NOT_READY = 9800004, + /** + * Caller information verification failed for a transient task. + */ + ERR_TRANSIENT_TASK_CLIENT_INFO_VERIFICATION_FAILED = 9900001, + /** + * Transient task verification failed. + */ + ERR_TRANSIENT_TASK_SERVICE_VERIFICATION_FAILED = 9900002, +} TransientTask_ErrorCode; + +/** + * @brief Define DelaySuspendInfo. + * + * @since 13 + * @version 1.0 + */ +typedef struct TransientTask_DelaySuspendInfo { + /** The unique identifier of the delay request */ + int32_t requestId; + /** The actual delay duration (ms) */ + int32_t actualDelayTime; +} TransientTask_DelaySuspendInfo; + +/** + * @brief Define a callback function when delay time expired. + * + * @since 13 + */ +typedef void (*TransientTask_Callback)(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/backgroundtasks/transient/libtransient_task.ndk.json b/backgroundtasks/transient/libtransient_task.ndk.json new file mode 100644 index 000000000..df952bfe1 --- /dev/null +++ b/backgroundtasks/transient/libtransient_task.ndk.json @@ -0,0 +1,14 @@ +[ + { + "first_introduced": "13", + "name": "OH_BackgroundTaskManager_RequestSuspendDelay" + }, + { + "first_introduced": "13", + "name": "OH_BackgroundTaskManager_GetRemainingDelayTime" + }, + { + "first_introduced": "13", + "name": "OH_BackgroundTaskManager_CancelSuspendDelay" + } +] \ No newline at end of file -- Gitee From 081eaaf48431f83fe09f723c217141bfed9bb7d6 Mon Sep 17 00:00:00 2001 From: jinmingru Date: Mon, 26 Aug 2024 15:10:06 +0800 Subject: [PATCH 164/620] jinmingru1@huawei.com Signed-off-by: jinmingru --- multimedia/image_effect/image_effect.h | 4 ++-- multimedia/image_effect/libimage_effect.ndk.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/multimedia/image_effect/image_effect.h b/multimedia/image_effect/image_effect.h index b1bb66de6..db65c16e4 100644 --- a/multimedia/image_effect/image_effect.h +++ b/multimedia/image_effect/image_effect.h @@ -326,7 +326,7 @@ ImageEffect_ErrorCode OH_ImageEffect_SetOutputUri(OH_ImageEffect *imageEffect, c * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to * {@link ImageEffect_ErrorCode} * {@link EFFECT_ERROR_PARAM_INVALID}, the input parameter is a null pointer. - * @since 12 + * @since 13 */ ImageEffect_ErrorCode OH_ImageEffect_SetInputPicture(OH_ImageEffect *imageEffect, OH_PictureNative *picture); @@ -339,7 +339,7 @@ ImageEffect_ErrorCode OH_ImageEffect_SetInputPicture(OH_ImageEffect *imageEffect * @return Returns EFFECT_SUCCESS if the execution is successful, otherwise returns a specific error code, refer to * {@link ImageEffect_ErrorCode} * {@link EFFECT_ERROR_PARAM_INVALID}, the input parameter is a null pointer. - * @since 12 + * @since 13 */ ImageEffect_ErrorCode OH_ImageEffect_SetOutputPicture(OH_ImageEffect *imageEffect, OH_PictureNative *picture); diff --git a/multimedia/image_effect/libimage_effect.ndk.json b/multimedia/image_effect/libimage_effect.ndk.json index 99226c04a..16f31e29f 100644 --- a/multimedia/image_effect/libimage_effect.ndk.json +++ b/multimedia/image_effect/libimage_effect.ndk.json @@ -204,11 +204,11 @@ "name": "OH_ImageEffect_SetOutputUri" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageEffect_SetInputPicture" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageEffect_SetOutputPicture" }, { -- Gitee From b9923025891d79eb0702236f485627361d621d6a Mon Sep 17 00:00:00 2001 From: cuiruibin Date: Mon, 26 Aug 2024 15:21:23 +0800 Subject: [PATCH 165/620] =?UTF-8?q?NDK=E6=8E=A5=E5=8F=A3=E8=AF=AD=E6=B3=95?= =?UTF-8?q?=E6=95=B4=E6=94=B9=20Signed-off-by:=20cuiruibin=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- filemanagement/file_uri/include/oh_file_uri.h | 2 +- filemanagement/fileshare/include/oh_file_share.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/filemanagement/file_uri/include/oh_file_uri.h b/filemanagement/file_uri/include/oh_file_uri.h index 799cb6eea..e7805faf8 100644 --- a/filemanagement/file_uri/include/oh_file_uri.h +++ b/filemanagement/file_uri/include/oh_file_uri.h @@ -27,7 +27,7 @@ */ #include "error_code.h" -#include "stdbool.h" +#include #include #include #ifdef __cplusplus diff --git a/filemanagement/fileshare/include/oh_file_share.h b/filemanagement/fileshare/include/oh_file_share.h index d37dbb98d..e89d335f5 100644 --- a/filemanagement/fileshare/include/oh_file_share.h +++ b/filemanagement/fileshare/include/oh_file_share.h @@ -17,6 +17,7 @@ #define FILE_MANAGEMENT_OH_FILE_SHARE_H #include "error_code.h" +#include /** * @addtogroup fileShare -- Gitee From 6a3b43d3393d911b4d4525974fd38754e84e2038 Mon Sep 17 00:00:00 2001 From: yzj688 Date: Mon, 26 Aug 2024 16:01:39 +0800 Subject: [PATCH 166/620] =?UTF-8?q?Drawing=20ndk=E8=AF=AD=E6=B3=95?= =?UTF-8?q?=E6=95=B4=E6=94=B9=20Signed-off-by:=20yzj688=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- graphic/graphic_2d/native_drawing/drawing_pixel_map.h | 4 ++-- graphic/graphic_2d/native_drawing/drawing_types.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_pixel_map.h b/graphic/graphic_2d/native_drawing/drawing_pixel_map.h index 668a915a0..9074062d1 100644 --- a/graphic/graphic_2d/native_drawing/drawing_pixel_map.h +++ b/graphic/graphic_2d/native_drawing/drawing_pixel_map.h @@ -51,14 +51,14 @@ extern "C" { * @since 12 * @version 1.0 */ -struct NativePixelMap_; +typedef struct NativePixelMap_; /** * @brief Introduces the native pixel map information defined by image framework. * @since 12 * @version 1.0 */ -struct OH_PixelmapNative; +typedef struct OH_PixelmapNative; /** * @brief Gets an OH_Drawing_PixelMap object. diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h index 0755375b7..e040acdfc 100644 --- a/graphic/graphic_2d/native_drawing/drawing_types.h +++ b/graphic/graphic_2d/native_drawing/drawing_types.h @@ -40,8 +40,9 @@ * @version 1.0 */ -#include +#include #include +#include #ifdef __cplusplus extern "C" { -- Gitee From 6f01199154bbdae02bab6719d88212ccea5829e0 Mon Sep 17 00:00:00 2001 From: Klein-CK Date: Mon, 26 Aug 2024 16:15:13 +0800 Subject: [PATCH 167/620] Addstdbool.h for native_displaySoloist Signed-off-by: Klein-CK Change-Id: I058e11b863edb6272e011b5dd102240377d41a77 --- .../graphic_2d/native_display_soloist/native_display_soloist.h | 1 + 1 file changed, 1 insertion(+) diff --git a/graphic/graphic_2d/native_display_soloist/native_display_soloist.h b/graphic/graphic_2d/native_display_soloist/native_display_soloist.h index 3f1311f3e..abbda4fde 100644 --- a/graphic/graphic_2d/native_display_soloist/native_display_soloist.h +++ b/graphic/graphic_2d/native_display_soloist/native_display_soloist.h @@ -39,6 +39,7 @@ */ #include +#include #ifdef __cplusplus extern "C" { #endif -- Gitee From 4b8e185e0e7690c561d4b97aa881e8261ffbb185 Mon Sep 17 00:00:00 2001 From: lipengfei Date: Mon, 26 Aug 2024 16:19:58 +0800 Subject: [PATCH 168/620] bugfix Signed-off-by: lipengfei --- backgroundtasks/transient/BUILD.gn | 6 +++--- backgroundtasks/transient/include/transient_task_type.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backgroundtasks/transient/BUILD.gn b/backgroundtasks/transient/BUILD.gn index 1a04c838e..3d4491020 100644 --- a/backgroundtasks/transient/BUILD.gn +++ b/backgroundtasks/transient/BUILD.gn @@ -15,14 +15,14 @@ import("//build/ohos.gni") import("//build/ohos/ndk/ndk.gni") ohos_ndk_library("libtransient_task_ndk") { - output_name = "transient_task_ndk" + output_name = "transient_task" output_extension = "so" ndk_description_file = "./libtransient_task.ndk.json" system_capability = "SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask" system_capability_headers = [ - "include/transient_task_api.h", - "include/transient_task_type.h", + "transient_task/transient_task_api.h", + "transient_task/transient_task_type.h", ] } diff --git a/backgroundtasks/transient/include/transient_task_type.h b/backgroundtasks/transient/include/transient_task_type.h index 7895f85b2..7c607704a 100644 --- a/backgroundtasks/transient/include/transient_task_type.h +++ b/backgroundtasks/transient/include/transient_task_type.h @@ -79,7 +79,7 @@ typedef enum TransientTask_ErrorCode { } TransientTask_ErrorCode; /** - * @brief Define DelaySuspendInfo. + * @brief Define DelaySuspendInfo for TransientTask. * * @since 13 * @version 1.0 -- Gitee From 1ba85eabd071f0f042b4198a10dee57f7174b7b6 Mon Sep 17 00:00:00 2001 From: lipengfei Date: Mon, 26 Aug 2024 17:05:38 +0800 Subject: [PATCH 169/620] codex Signed-off-by: lipengfei --- backgroundtasks/transient/include/transient_task_api.h | 2 +- backgroundtasks/transient/include/transient_task_type.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backgroundtasks/transient/include/transient_task_api.h b/backgroundtasks/transient/include/transient_task_api.h index 9beea8279..91ba7defe 100644 --- a/backgroundtasks/transient/include/transient_task_api.h +++ b/backgroundtasks/transient/include/transient_task_api.h @@ -35,7 +35,7 @@ * * @brief Declares the APIs for Transient task management. * - * @library libtransient_task_ndk + * @library libtransient_task.so * @kit BackgroundTasksKit * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @since 13 diff --git a/backgroundtasks/transient/include/transient_task_type.h b/backgroundtasks/transient/include/transient_task_type.h index 7c607704a..ac31d90b8 100644 --- a/backgroundtasks/transient/include/transient_task_type.h +++ b/backgroundtasks/transient/include/transient_task_type.h @@ -31,7 +31,7 @@ * * @brief Defines the data structures for the C APIs of transient task. * - * @library libtransient_task_ndk + * @library libtransient_task.so * @kit BackgroundTasksKit * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @since 11 @@ -53,7 +53,9 @@ typedef enum TransientTask_ErrorCode { */ ERR_TRANSIENT_TASK_OK = 0, /** - * @error Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameters types. + * @error Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameters types. */ ERR_TRANSIENT_TASK_INVALID_PARAM = 401, /** -- Gitee From c834c225f956d9952eeffa732c7fa2f08c0ab43f Mon Sep 17 00:00:00 2001 From: lipengfei Date: Mon, 26 Aug 2024 17:25:08 +0800 Subject: [PATCH 170/620] =?UTF-8?q?/**=20@}=20*/=20=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lipengfei --- backgroundtasks/transient/include/transient_task_api.h | 1 + backgroundtasks/transient/include/transient_task_type.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backgroundtasks/transient/include/transient_task_api.h b/backgroundtasks/transient/include/transient_task_api.h index 91ba7defe..74b467dc6 100644 --- a/backgroundtasks/transient/include/transient_task_api.h +++ b/backgroundtasks/transient/include/transient_task_api.h @@ -103,4 +103,5 @@ int32_t OH_BackgroundTaskManager_CancelSuspendDelay(int32_t requestId); #ifdef __cplusplus } #endif +/** @} */ #endif diff --git a/backgroundtasks/transient/include/transient_task_type.h b/backgroundtasks/transient/include/transient_task_type.h index ac31d90b8..17e50d477 100644 --- a/backgroundtasks/transient/include/transient_task_type.h +++ b/backgroundtasks/transient/include/transient_task_type.h @@ -103,5 +103,5 @@ typedef void (*TransientTask_Callback)(void); #ifdef __cplusplus } #endif - +/** @} */ #endif -- Gitee From 989ee8e6767c7a30bffa5373ced8f63cd6acbcd0 Mon Sep 17 00:00:00 2001 From: lipengfei Date: Mon, 26 Aug 2024 17:31:43 +0800 Subject: [PATCH 171/620] code check Signed-off-by: lipengfei --- backgroundtasks/transient/include/transient_task_type.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/backgroundtasks/transient/include/transient_task_type.h b/backgroundtasks/transient/include/transient_task_type.h index 17e50d477..6ddd4dbfa 100644 --- a/backgroundtasks/transient/include/transient_task_type.h +++ b/backgroundtasks/transient/include/transient_task_type.h @@ -19,9 +19,8 @@ /** * @addtogroup TransientTask * @{ - * + * @brief Provide C interface for the transient task management. - * * @since 13 * @version 1.0 */ @@ -44,7 +43,6 @@ extern "C" { #endif /** * @brief Enum for transient task error code. - * * @since 13 */ typedef enum TransientTask_ErrorCode { @@ -95,7 +93,6 @@ typedef struct TransientTask_DelaySuspendInfo { /** * @brief Define a callback function when delay time expired. - * * @since 13 */ typedef void (*TransientTask_Callback)(void); -- Gitee From d2eea5458cfeaa641108a34ef1d10a4465697ddd Mon Sep 17 00:00:00 2001 From: zhouchengchao Date: Tue, 27 Aug 2024 11:24:47 +0800 Subject: [PATCH 172/620] fix bool lib issue Signed-off-by: zhouchengchao --- arkui/window_manager/oh_window_event_filter.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arkui/window_manager/oh_window_event_filter.h b/arkui/window_manager/oh_window_event_filter.h index 2e4992809..783e8c5c2 100644 --- a/arkui/window_manager/oh_window_event_filter.h +++ b/arkui/window_manager/oh_window_event_filter.h @@ -37,6 +37,7 @@ * @kit ArkUI * @since 12 */ +#include "stdbool.h" #include "stdint.h" #include "oh_window_comm.h" #include "multimodalinput/oh_input_manager.h" -- Gitee From e45a88f85083bee628822d523115e87a5dcb5029 Mon Sep 17 00:00:00 2001 From: yangxuguang-huawei Date: Sun, 25 Aug 2024 14:21:41 +0800 Subject: [PATCH 173/620] feat: update version for StartNativeChildProcess Signed-off-by: yangxuguang-huawei --- .../child_process/libchild_process.ndk.json | 2 +- .../child_process/native_child_process.h | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ability/ability_runtime/child_process/libchild_process.ndk.json b/ability/ability_runtime/child_process/libchild_process.ndk.json index e42bbbc44..b00d0d189 100644 --- a/ability/ability_runtime/child_process/libchild_process.ndk.json +++ b/ability/ability_runtime/child_process/libchild_process.ndk.json @@ -4,7 +4,7 @@ "name": "OH_Ability_CreateNativeChildProcess" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_Ability_StartNativeChildProcess" } ] \ No newline at end of file diff --git a/ability/ability_runtime/child_process/native_child_process.h b/ability/ability_runtime/child_process/native_child_process.h index 821456513..3c9b18d38 100644 --- a/ability/ability_runtime/child_process/native_child_process.h +++ b/ability/ability_runtime/child_process/native_child_process.h @@ -48,6 +48,10 @@ extern "C" { * @brief Enumerates the error codes used by the native child process module. * @since 12 */ +/** + * @brief Enumerates the error codes used by the native child process module. + * @since 13 + */ typedef enum Ability_NativeChildProcess_ErrCode { /** * @error Operation successful. @@ -180,7 +184,7 @@ int OH_Ability_CreateNativeChildProcess(const char* libName, /** * @brief The info of the file descriptors passed to child process. - * @since 12 + * @since 13 */ typedef struct NativeChildProcess_Fd { /** the key of the file descriptor. */ @@ -195,7 +199,7 @@ typedef struct NativeChildProcess_Fd { /** * @brief The list of the info of the file descriptors passed to child process. - * @since 12 + * @since 13 */ typedef struct NativeChildProcess_FdList { /** the head of the list. @@ -206,7 +210,7 @@ typedef struct NativeChildProcess_FdList { /** * @brief Enumerates the isolation modes used by the native child process module. - * @since 12 + * @since 13 */ typedef enum NativeChildProcess_IsolationMode { /** @@ -222,7 +226,7 @@ typedef enum NativeChildProcess_IsolationMode { /** * @brief The options used by the child process. - * @since 12 + * @since 13 */ typedef struct NativeChildProcess_Options { /** the isolation mode used by the child process. @@ -236,7 +240,7 @@ typedef struct NativeChildProcess_Options { /** * @brief The arguments passed to the child process. - * @since 12 + * @since 13 */ typedef struct NativeChildProcess_Args { /** the entry parameter. */ @@ -267,7 +271,7 @@ typedef struct NativeChildProcess_Args { * Returns {@link NCP_ERR_MAX_CHILD_PROCESSES_REACHED} if the maximum number of native child processes is reached.\n * For details, see {@link Ability_NativeChildProcess_ErrCode}. * @see OH_Ability_OnNativeChildProcessStarted - * @since 12 + * @since 13 */ Ability_NativeChildProcess_ErrCode OH_Ability_StartNativeChildProcess( const char* entry, NativeChildProcess_Args args, -- Gitee From 3982b0e196832d5f14c51d24762cc0b7eb4ffcff Mon Sep 17 00:00:00 2001 From: hongzexuan Date: Tue, 27 Aug 2024 16:34:26 +0800 Subject: [PATCH 174/620] fix node_scroll_page Signed-off-by: hongzexuan Change-Id: Icdb22041fb367ab22c9dba486bd2c051b6d6c6dc --- arkui/ace_engine/native/native_node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 6f4531d7d..9856457cd 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -4449,7 +4449,7 @@ typedef enum { * @brief Scroll to the next or previous page. * * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n - * .value[0].i32 Indicates whether to scroll to next page. Value 1 indicates scroll to next page and value 0 + * .value[0].i32 Indicates whether to scroll to next page. Value 0 indicates scroll to next page and value 1 * indicates scroll to previous page. \n * .value[1]?.i32 Indicates whether to enable animation. Value 1 indicates enable and 0 indicates disable. \n * -- Gitee From 7a61d7dfbb3c3ee85b0603e97fc3706aaea4b300 Mon Sep 17 00:00:00 2001 From: zhangwuf Date: Tue, 27 Aug 2024 17:07:22 +0800 Subject: [PATCH 175/620] =?UTF-8?q?=E8=A7=A3=E5=86=B3diff=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=BB=93=E6=9E=9C=E5=90=8D=E7=A7=B0=E5=88=97=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E7=A9=BA=E7=9A=84=E6=83=85=E5=86=B5=E5=92=8Ccollect?= =?UTF-8?q?=5Fh=E5=B7=A5=E5=85=B7=E5=A2=9E=E5=8A=A0-D=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E8=A1=8C=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangwuf --- build-tools/capi_parser/src/bin/config.py | 2 +- .../src/coreImpl/diff/diff_processor_node.py | 3 ++- .../capi_parser/src/coreImpl/parser/parser.py | 26 +++++++++++++------ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/build-tools/capi_parser/src/bin/config.py b/build-tools/capi_parser/src/bin/config.py index d0bfeff8a..0fb2aeaeb 100644 --- a/build-tools/capi_parser/src/bin/config.py +++ b/build-tools/capi_parser/src/bin/config.py @@ -55,7 +55,7 @@ def run_tools(options): elif tool_name == ToolNameType["CHECK"].value: check.curr_entry(options.path, options.checker, options.output) elif tool_name == ToolNameType['COLLECT_H'].value: - parser.parser_direct(options.parser_path) + parser.parser_direct(options.parser_path, options.dependent_path) elif tool_name == ToolNameType['COLLECT_FILE'].value: parser.parser_file_level(options.output_path) elif tool_name == ToolNameType['CHECK_SYNTAX'].value: diff --git a/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py b/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py index 8d48a2641..14df24b0f 100644 --- a/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py +++ b/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py @@ -807,7 +807,8 @@ def get_ch_api_kind(dict_key): def collect_change_data_total(data: dict, diff_info_list): for element in diff_info_list: element.set_api_node_name(data['name']) - if (data['kind'] == Scene.STRUCT_DECL.value or data['kind'] == Scene.UNION_DECL.value) and (not data['name']): + if (data['kind'] == Scene.STRUCT_DECL.value or data['kind'] == Scene.UNION_DECL.value + or data['kind'] == Scene.ENUM_DECL.value) and (not data['name']): element.set_api_node_name(data['type']) element.set_current_api_unique_id(data['unique_id']) element.set_open_close_api(data['open_close_api']) diff --git a/build-tools/capi_parser/src/coreImpl/parser/parser.py b/build-tools/capi_parser/src/coreImpl/parser/parser.py index a7a04019e..9da03cafe 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/parser.py +++ b/build-tools/capi_parser/src/coreImpl/parser/parser.py @@ -404,20 +404,30 @@ def complete_kit_or_system(api_message: OneFileApiMessage, json_path): api_message.set_sub_system(sub_system_name) -def parser_direct(path): # 目录路径 +def get_dependent_path_all(dependent_path): + all_dependent_path_list = [] + for dir_path, _, _ in os.walk(dependent_path): + if 'sysroot_myself' not in dir_path and 'build-tools' not in dir_path: + all_dependent_path_list.append(dir_path) + + return all_dependent_path_list + + +def parser_direct(path, dependent_path): # 目录路径 file_path_list = [] link_include_path = [] # 装链接头文件路径 + link_include_path.extend(get_dependent_path_all(dependent_path)) dir_path = '' if os.path.isdir(path): - link_include_path.append(path) - file_path_total, link_include_total = get_dir_file_path(path) + if path not in link_include_path: + link_include_path.append(path) + file_path_total, _ = get_dir_file_path(path) file_path_list.extend(file_path_total) - link_include_path.extend(link_include_total) dir_path = path - else: - if path.endswith('.h'): - file_path_list.append(path) - dir_path = os.path.dirname(path) + elif path.endswith('.h'): + file_path_list.append(path) + dir_path = os.path.dirname(path) + if dir_path not in link_include_path: link_include_path.append(dir_path) data_total = parse_include.get_include_file(file_path_list, link_include_path, dir_path) generating_tables.get_api_data(data_total, StringConstant.PARSER_DIRECT_EXCEL_NAME.value) -- Gitee From 068a303fbcd0173553e9c5a948810065971beea5 Mon Sep 17 00:00:00 2001 From: liushang Date: Tue, 27 Aug 2024 20:05:45 +0800 Subject: [PATCH 176/620] change to api13 Signed-off-by: liushang --- .../image_processing.h | 34 ++++++++-------- .../image_processing/BUILD.gn | 2 +- .../libimage_processing.ndk.json | 40 +++++++++---------- .../image_processing_types.h | 28 ++++++------- 4 files changed, 52 insertions(+), 52 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index 81f503ecf..8465d8618 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -19,7 +19,7 @@ * * @brief Provide APIs for image quality processing. * - * @since 12 + * @since 13 */ /** @@ -33,7 +33,7 @@ * @library libimage_processing.so * @syscap SystemCapability.Multimedia.VideoProcessingEngine * @kit ImageKit - * @since 12 + * @since 13 */ #ifndef VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_H @@ -58,7 +58,7 @@ extern "C" { * @return {@link IMAGE_PROCESSING_SUCCESS} if initialization is successful. \n * {@link IMAGE_PROCESSING_ERROR_INITIALIZE_FAILED} if initialization is failed. \n * You can check if the device GPU is working properly. - * @since 12 + * @since 13 */ ImageProcessing_ErrorCode OH_ImageProcessing_InitializeEnvironment(void); @@ -74,7 +74,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_InitializeEnvironment(void); * @return {@link IMAGE_PROCESSING_SUCCESS} if deinitialization is successful. \n * {@link IMAGE_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if some image processing instance is not destroyed or * {@link OH_ImageProcessing_InitializeEnvironment} is not called. \n - * @since 12 + * @since 13 */ ImageProcessing_ErrorCode OH_ImageProcessing_DeinitializeEnvironment(void); @@ -85,7 +85,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_DeinitializeEnvironment(void); * @param destinationImageInfo Output image color space information pointer. * @return true if the color space conversion is supported. \n * false if the the color space conversion is unsupported. - * @since 12 + * @since 13 */ bool OH_ImageProcessing_IsColorSpaceConversionSupported( const ImageProcessing_ColorSpaceInfo* sourceImageInfo, @@ -99,7 +99,7 @@ bool OH_ImageProcessing_IsColorSpaceConversionSupported( * @param destinationImageInfo Output image color space information pointer. * @return true if the image composition is supported. \n * false if the image composition is unsupported. - * @since 12 + * @since 13 */ bool OH_ImageProcessing_IsCompositionSupported( const ImageProcessing_ColorSpaceInfo* sourceImageInfo, @@ -114,7 +114,7 @@ bool OH_ImageProcessing_IsCompositionSupported( * @param destinationGainmapInfo Output gainmap information pointer. * @return true if the image decomposition is supported. \n * false if the image decomposition is unsupported. - * @since 12 + * @since 13 */ bool OH_ImageProcessing_IsDecompositionSupported( const ImageProcessing_ColorSpaceInfo* sourceImageInfo, @@ -127,7 +127,7 @@ bool OH_ImageProcessing_IsDecompositionSupported( * @param sourceImageInfo Input image color space information pointer. * @return true if the image metadata generation is supported.. \n * false if the image metadata generation is unsupported. - * @since 12 + * @since 13 */ bool OH_ImageProcessing_IsMetadataGenerationSupported( const ImageProcessing_ColorSpaceInfo* sourceImageInfo); @@ -145,7 +145,7 @@ bool OH_ImageProcessing_IsMetadataGenerationSupported( * {@link IMAGE_PROCESSING_ERROR_CREATE_FAILED} if failed to create an image processing. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or *instance is not null. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if type is invalid. \n - * @since 12 + * @since 13 */ ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** imageProcessor, int32_t type); @@ -156,7 +156,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** imagePr * instance pointer to null after the instance is destroyed. * @return {@link IMAGE_PROCESSING_SUCCESS} if the instance is destroyed successfully. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. - * @since 12 + * @since 13 */ ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* imageProcessor); @@ -173,7 +173,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* imagePr * {@link IMAGE_PROCESSING_ERROR_INVALID_VALUE} if some property of the parameter is invalid. For example, the parameter * contains unsupported parameter key or value. \n * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. - * @since 12 + * @since 13 */ ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter(OH_ImageProcessing* imageProcessor, const OH_AVFormat* parameter); @@ -188,7 +188,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter(OH_ImageProcessing* im * @return {@link IMAGE_PROCESSING_SUCCESS} if getting parameter is successful. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n - * @since 12 + * @since 13 */ ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* imageProcessor, OH_AVFormat* parameter); @@ -211,7 +211,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* im * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. - * @since 12 + * @since 13 */ ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage); @@ -234,7 +234,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessin * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. - * @since 12 + * @since 13 */ ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage, OH_PixelmapNative* sourceGainmap, OH_PixelmapNative* destinationImage); @@ -257,7 +257,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* imagePr * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. - * @since 12 + * @since 13 */ ImageProcessing_ErrorCode OH_ImageProcessing_Decompose(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage, OH_PixelmapNative* destinationGainmap); @@ -278,7 +278,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Decompose(OH_ImageProcessing* image * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. - * @since 12 + * @since 13 */ ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage); @@ -302,7 +302,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. - * @since 12 + * @since 13 */ ImageProcessing_ErrorCode OH_ImageProcessing_EnhanceDetail(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage); diff --git a/multimedia/video_processing_engine/image_processing/BUILD.gn b/multimedia/video_processing_engine/image_processing/BUILD.gn index d3c02809b..ff1239898 100644 --- a/multimedia/video_processing_engine/image_processing/BUILD.gn +++ b/multimedia/video_processing_engine/image_processing/BUILD.gn @@ -26,7 +26,7 @@ ohos_ndk_library("libimage_processing_ndk") { ndk_description_file = "./libimage_processing.ndk.json" output_name = "image_processing" output_extension = "so" - min_compact_version = "12" + min_compact_version = "13" system_capability = "SystemCapability.Multimedia.VideoProcessingEngine" system_capability_headers = [ "multimedia/video_processing_engine/image_processing_types.h", diff --git a/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json b/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json index 8cb58693c..13425858f 100644 --- a/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json +++ b/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json @@ -1,86 +1,86 @@ [ { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_InitializeEnvironment" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_DeinitializeEnvironment" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_IsColorSpaceConversionSupported" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_IsCompositionSupported" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_IsDecompositionSupported" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_IsMetadataGenerationSupported" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_Create" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_Destroy" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_SetParameter" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_GetParameter" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_ConvertColorSpace" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_Compose" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_Decompose" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_GenerateMetadata" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_ImageProcessing_EnhanceDetail" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION", "type": "variable" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "IMAGE_PROCESSING_TYPE_COMPOSITION", "type": "variable" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "IMAGE_PROCESSING_TYPE_DECOMPOSITION", "type": "variable" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "IMAGE_PROCESSING_TYPE_METADATA_GENERATION", "type": "variable" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER", "type": "variable" } diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index cfd2a5473..5f9562325 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -19,7 +19,7 @@ * * @brief Provide image processing including color space conversion and metadata generation. * - * @since 12 + * @since 13 */ /** @@ -30,7 +30,7 @@ * @library libimage_processing.so * @syscap SystemCapability.Multimedia.VideoProcessingEngine * @kit ImageKit - * @since 12 + * @since 13 */ #ifndef VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_TYPES_H @@ -49,21 +49,21 @@ extern "C" { * instance. The pointer should be null before creating instance. * User can create multiple image processing instances for different processing types. * - * @since 12 + * @since 13 */ typedef struct OH_ImageProcessing OH_ImageProcessing; /** * @brief Forward declaration of OH_PixelmapNative. * - * @since 12 + * @since 13 */ typedef struct OH_PixelmapNative OH_PixelmapNative; /** * @brief Forward declaration of OH_AVFormat. * - * @since 12 + * @since 13 */ typedef struct OH_AVFormat OH_AVFormat; @@ -76,7 +76,7 @@ typedef struct OH_AVFormat OH_AVFormat; * the conversion is supported between single-layer images. * * @see OH_ImageProcessing_Create - * @since 12 + * @since 13 */ extern const int32_t IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION; @@ -88,7 +88,7 @@ extern const int32_t IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION; * query if the composition is supported from dual-layer HDR image to single-layer HDR image. * * @see OH_ImageProcessing_Create - * @since 12 + * @since 13 */ extern const int32_t IMAGE_PROCESSING_TYPE_COMPOSITION; @@ -100,7 +100,7 @@ extern const int32_t IMAGE_PROCESSING_TYPE_COMPOSITION; * query if the decomposition is supported from single-layer image to dual-layer HDR image. * * @see OH_ImageProcessing_Create - * @since 12 + * @since 13 */ extern const int32_t IMAGE_PROCESSING_TYPE_DECOMPOSITION; @@ -111,7 +111,7 @@ extern const int32_t IMAGE_PROCESSING_TYPE_DECOMPOSITION; * supported, {@link OH_ImageProcessing_Create} returns {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING}. * * @see OH_ImageProcessing_Create - * @since 12 + * @since 13 */ extern const int32_t IMAGE_PROCESSING_TYPE_METADATA_GENERATION; @@ -122,7 +122,7 @@ extern const int32_t IMAGE_PROCESSING_TYPE_METADATA_GENERATION; * its resolution. * * @see OH_ImageProcessing_Create - * @since 12 + * @since 13 */ extern const int32_t IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER; @@ -135,7 +135,7 @@ extern const int32_t IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER; * * @see OH_VideoProcessing_SetParameter * @see OH_VideoProcessing_GetParameter - * @since 12 + * @since 13 */ extern const char* IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL; @@ -145,7 +145,7 @@ extern const char* IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL; * @see OH_ImageProcessing_IsColorSpaceConversionSupported * @see OH_ImageProcessing_IsCompositionSupported * @see OH_ImageProcessing_IsDecompositionSupported - * @since 12 + * @since 13 */ typedef struct ImageProcessing_ColorSpaceInfo { /** define metadata type */ @@ -163,7 +163,7 @@ typedef struct ImageProcessing_ColorSpaceInfo { * * @see OH_ImageProcessing_SetParameter * @see OH_ImageProcessing_GetParameter - * @since 12 + * @since 13 */ typedef enum ImageDetailEnhancer_QualityLevel { /** No detail enhancement */ @@ -179,7 +179,7 @@ typedef enum ImageDetailEnhancer_QualityLevel { /** * @brief Image processing error code. * - * @since 12 + * @since 13 */ typedef enum ImageProcessing_ErrorCode { /** @error Operation is successful. */ -- Gitee From b5ac98ecc5d145a42214367d558f5061986e01be Mon Sep 17 00:00:00 2001 From: yzj688 Date: Wed, 28 Aug 2024 10:03:03 +0800 Subject: [PATCH 177/620] =?UTF-8?q?ndk=20=E6=8E=A5=E5=8F=A3=E8=AF=AD?= =?UTF-8?q?=E6=B3=95=E6=95=B4=E6=94=B9=20Signed-off-by:=20yzj688=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- graphic/graphic_2d/native_drawing/drawing_pixel_map.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_pixel_map.h b/graphic/graphic_2d/native_drawing/drawing_pixel_map.h index 9074062d1..ef29ce5b4 100644 --- a/graphic/graphic_2d/native_drawing/drawing_pixel_map.h +++ b/graphic/graphic_2d/native_drawing/drawing_pixel_map.h @@ -51,14 +51,14 @@ extern "C" { * @since 12 * @version 1.0 */ -typedef struct NativePixelMap_; +typedef struct NativePixelMap_ NativePixelMap_; /** * @brief Introduces the native pixel map information defined by image framework. * @since 12 * @version 1.0 */ -typedef struct OH_PixelmapNative; +typedef struct OH_PixelmapNative OH_PixelmapNative; /** * @brief Gets an OH_Drawing_PixelMap object. -- Gitee From 74def22680a61c59dffb37057e2b3ee66c216818 Mon Sep 17 00:00:00 2001 From: liuyuxiu Date: Wed, 28 Aug 2024 10:09:19 +0800 Subject: [PATCH 178/620] qos.h yellow and blue gap bugfix Signed-off-by: liuyuxiu --- resourceschedule/qos_manager/c/qos.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resourceschedule/qos_manager/c/qos.h b/resourceschedule/qos_manager/c/qos.h index 6a04eb6f3..b264a23d9 100644 --- a/resourceschedule/qos_manager/c/qos.h +++ b/resourceschedule/qos_manager/c/qos.h @@ -84,7 +84,7 @@ typedef enum QoS_Level { * * @param level Indicates the level to set. Specific level can be referenced {@link QoS_Level}. * @return Returns 0 if the operation is successful; returns -1 if level is out of range or - internal error failed. + * internal error failed. * @see QoS_Level * @since 12 */ @@ -94,7 +94,7 @@ int OH_QoS_SetThreadQoS(QoS_Level level); * @brief Cancel the QoS level of the current thread. * * @return Returns 0 if the operation is successful; returns -1 if not set QoS for current thread - * or internal error failed. + * or internal error failed. * @see QoS_Level * @since 12 */ -- Gitee From 5fee732a60907eb036072eaae82beb1d46828c55 Mon Sep 17 00:00:00 2001 From: dujingcheng Date: Wed, 28 Aug 2024 03:33:36 +0000 Subject: [PATCH 179/620] add accessi Signed-off-by: dujingcheng --- .../native/native_interface_accessibility.h | 923 ++++++++++++++++++ .../native/native_interface_xcomponent.h | 13 + 2 files changed, 936 insertions(+) create mode 100644 arkui/ace_engine/native/native_interface_accessibility.h diff --git a/arkui/ace_engine/native/native_interface_accessibility.h b/arkui/ace_engine/native/native_interface_accessibility.h new file mode 100644 index 000000000..0b7eb95a0 --- /dev/null +++ b/arkui/ace_engine/native/native_interface_accessibility.h @@ -0,0 +1,923 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup ArkUI_AccessibilityProvider + * @{ + * + * @brief + * + * @since 13 + * @version 1.0 + */ + +/** + * @file native_interface_accessibility.h + * + * @brief + * + * @since 13 + * @version 1.0 + */ +#ifndef _NATIVE_INTERFACE_ACCESSIBILITY_H +#define _NATIVE_INTERFACE_ACCESSIBILITY_H + +#include + +#ifdef __cplusplus +extern "C"{ +#endif + +/** + * @brief Provides an encapsulated ArkUI_AccessibilityElementInfo instance. + * + * @since 13 + */ +typedef struct ArkUI_AccessibilityElementInfo ArkUI_AccessibilityElementInfo; + +/** + * @brief Defines the accessibility event info. + * + * @since 13 + */ +typedef struct ArkUI_AccessibilityEventInfo ArkUI_AccessibilityEventInfo; + +/** + * @brief Definesthe accessibility native provider. + * + * @since 13 + */ +typedef struct ArkUI_AccessibilityProvider ArkUI_AccessibilityProvider; + +/** + * @brief Provides an encapsulated OH_NativeAccessibilityDictionary instance, Implement the function of cpp dictionary. + * + * @since 13 + * @version 1.0 + */ +typedef struct ArkUI_AccessibilityActionArguments ArkUI_AccessibilityActionArguments; + +/** + * @brief Enumerates the API accessibility actions. + * + * @since 13 + * @version 1.0 + */ +typedef enum { + /** Invalid */ + ARKUI_NATIVE_ACCESSIBILITY_ACTION_INVALID = 0, + /** After receiving the event, the component needs to respond to the click. */ + ARKUI_NATIVE_ACCESSIBILITY_ACTION_CLICK = 0x00000010, + /** After receiving the event, the component needs to respond to the long click. */ + ARKUI_NATIVE_ACCESSIBILITY_ACTION_LONG_CLICK = 0x00000020, + /** Indicates the operation of obtaining the accessibility focus. The specific component is focused */ + ARKUI_NATIVE_ACCESSIBILITY_ACTION_ACCESSIBILITY_FOCUS = 0x00000040, + /** Indicates the operation of clearing the accessibility focus. */ + ARKUI_NATIVE_ACCESSIBILITY_ACTION_CLEAR_ACCESSIBILITY_FOCUS = 0x00000080, + /** The scrolling component responds to forward scrolling action. */ + ARKUI_NATIVE_ACCESSIBILITY_ACTION_SCROLL_FORWARD = 0x00000100, + /** The scrolling component responds to backwrad scrolling action. */ + ARKUI_NATIVE_ACCESSIBILITY_ACTION_SCROLL_BACKWARD = 0x00000200, + /** Coping the selected content for the text component. */ + ARKUI_NATIVE_ACCESSIBILITY_ACTION_COPY = 0x00000400, + /** Paste the selected content for the text component. */ + ARKUI_NATIVE_ACCESSIBILITY_ACTION_PASTE = 0x00000800, + /** Cut the selected content for the text component. */ + ARKUI_NATIVE_ACCESSIBILITY_ACTION_CUT = 0x00001000, + /** Indicates the selection operation. The selectTextBegin, selectTextEnd, and selectTextInForWard parameters need to be set. Select a text segment in the edit box. */ + ARKUI_NATIVE_ACCESSIBILITY_ACTION_SET_SELECTION = 0x00002000, + /** Set the text Content for the text component. */ + ARKUI_NATIVE_ACCESSIBILITY_ACTION_SET_TEXT = 0x00004000, + /** Set the cursor position for the text component. */ + ARKUI_NATIVE_ACCESSIBILITY_ACTION_SET_CURSOR_POSITION = 0x00100000, +} ArkUI_Accessibility_ActionType; + +/** + * @brief Enumerates the API accessibility event types. + * + * @since 13 + * @version 1.0 + */ +typedef enum { + /** Invalid */ + ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_INVALID = 0, + /** Clicked event, which is sent after the UI component responds. */ + ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_CLICKED_EVENT = 0x00000001, + /** Long-Clicked event, which is sent after the UI component responds. */ + ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_LONG_CLICKED_EVENT = 0x00000002, + /** Selected event, which is sent after the UI component responds. */ + ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_SELECTED_EVENT = 0x00000004, + /** Text update event, needs to be send when the text is updated. */ + ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_TEXT_UPDATE_EVENT = 0x00000010, + /** Page update event, which is sent when the page jumps, switchs, changes in size, or moves. */ + ARKUI_NATIVE_ACCESSIBILITY_TYPE_PAGE_STATE_UPDATE = 0x00000020, + /** Content update event, which is sent when the page content changes. */ + ARKUI_NATIVE_ACCESSIBILITY_TYPE_PAGE_CONTENT_UPDATE = 0x00000800, + /** scrolled event, this event is send when a scrolling event occurs on a component that can be scrolled. */ + ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_SCROLLED_EVENT = 0x000001000, + /** Accessibility focus event, which is send after the UI component responds. */ + ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_ACCESSIBILITY_FOCUSED_EVENT = 0x00008000, + /** Accessibility focus clear event, which is send after the UI component responds. */ + ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED_EVENT = 0x00010000, + /** Request focus for accessibility event, proactively reqeust to focus on a specified node. */ + ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_REQUEST_FOCUS_FOR_ACCESSIBILITY = 0x02000000, + /** Page open event. the event is reported when the UI component */ + ARKUI_NATIVE_ACCESSIBILITY_TYPE_PAGE_OPEN = 0x20000000, + /** Page close event. the event is reported when the UI component */ + ARKUI_NATIVE_ACCESSIBILITY_TYPE_PAGE_CLOSE = 0x08000000, + /** Announce for accessibility event, requesting to actively play the specified content event. */ + ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_ANNOUNCE_FOR_ACCESSIBILITY = 0x10000000, +} ArkUI_AccessibilityEventType; + +/** + * @brief Defines the accessible of action + * + * @since 13 + * @version 1.0 + */ +typedef struct { + /** action type. */ + ArkUI_Accessibility_ActionType actionType; + /** the description message of action. */ + const char* description; +} ArkUI_AccessibleAction; + +/** + * @brief Defines the accessible of rect. + * + * @since 13 + * @version 1.0 + */ +typedef struct { + /** the left top x pixel corrdinates. */ + int32_t leftTopX; + /** the left top y pixel corrdinates. */ + int32_t leftTopY; + /** the right bottom x pixel corrdinates. */ + int32_t rightBottomX; + /** the right bottom y pixel corrdinates. */ + int32_t rightBottomY; +} ArkUI_AccessibleRect; + +/** + * @brief Defines the accessible of range info. + * + * @since 13 + * @version 1.0 + */ +typedef struct { + /** the min value. */ + double min; + /** the max value. */ + double max; + /** the current value. */ + double current; +} ArkUI_AccessibleRangeInfo; + +/** + * @brief Defines the accessible of grid info. + * + * @since 13 + * @version 1.0 + */ +typedef struct { + /** The number of row. */ + int32_t rowCount; + /** The number of column. */ + int32_t columnCount; + /** 0: select one line only, otherwise select multilines. */ + int32_t selectionMode; +} ArkUI_AccessibleGridInfo; + +/** + * @brief Defines the accessible of grid item info. + * + * @since 13 + * @version 1.0 + */ +typedef struct { + /** true: The item isHeading, otherwise is not */ + bool heading; + /** true: The item selected, otherwise is not */ + bool selected; + /** the index of column */ + int32_t columnIndex; + /** the index of row */ + int32_t rowIndex; + /** the column spanned */ + int32_t columnSpan; + /** the row spanned */ + int32_t rowSpan; +} ArkUI_AccessibleGridItemInfo; + +/** + * @brief Enumerates the API accessibility ErrorCode states. + * + * @since 13 + * @version 1.0 + */ +enum AcessbilityErrorCode{ + /** Successful. */ + OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS = 0, + /** Failed. */ + OH_ARKUI_ACCESSIBILITY_RESULT_FAILED = -1, + /** Invalid parameters. */ + OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER = -2, + /** Out of memory. */ + OH_ARKUI_ACCESSIBILITY_RESULT_OUT_OF_MEMORY = -3, +} ; + +/** + * @brief Enumerates the API accessibility search mode. + * + * @since 13 + * @version 1.0 + */ +typedef enum { + /** predecessors */ + NATIVE_SEARCH_MODE_PREFETCH_PREDECESSORS = 1 << 0, + /** slbings */ + NATIVE_SEARCH_MODE_PREFETCH_SIBLINGS = 1 << 1, + /** children */ + NATIVE_SEARCH_MODE_PREFETCH_CHILDREN = 1 << 2, + /** recusive children */ + NATIVE_SEARCH_MODE_PREFETCH_RECURSIVE_CHILDREN = 1 << 3, +} ArkUI_AccessibilitySearchMode; + +/** + * @brief Enumerates the API accessibility focus type. + * + * @since 13 + * @version 1.0 + */ +typedef enum { + /** Invalid */ + NATIVE_FOCUS_TYPE_INVALID = -1, + /** Input focus type */ + NATIVE_FOCUS_TYPE_INPUT = 1 << 0, + /** Accessibility focus type */ + NATIVE_FOCUS_TYPE_ACCESSIBILITY = 1 << 1, +} ArkUI_AccessibilityFocusType; + +/** + * @brief Enumerates the API accessibility focus move direction. + * + * @since 13 + * @version 1.0 + */ +typedef enum { + /** Invalid */ + NATIVE_DIRECTION_INVALID = 0, + /** up direction. */ + NATIVE_DIRECTION_UP = 0x00000001, + /** down direction. */ + NATIVE_DIRECTION_DOWN = 0x00000002, + /** left direction. */ + NATIVE_DIRECTION_LEFT = 0x00000004, + /** right direction. */ + NATIVE_DIRECTION_RIGHT = 0x00000008, + /** forward direction. */ + NATIVE_DIRECTION_FORWARD = 0x00000010, + /** backward direction. */ + NATIVE_DIRECTION_BACKWARD = 0x00000020, +} ArkUI_AccessibilityFocusMoveDirection; + +/** + * @brief Provides an encapsulated ArkUI_AccessibilityElementInfoList instance. + * + * @since 13 + * @version 1.0 + */ +typedef struct ArkUI_AccessibilityElementInfoList ArkUI_AccessibilityElementInfoList; + +/** + * @brief Registers the accessibility provider callbacks + * + * @since 13 + * @version 1.0 + */ +typedef struct ArkUI_AccessibilityProviderCallbacks { + /** Called when need to get element infos based on a specified node. */ + int32_t (*FindAccessibilityNodeInfosById)(int64_t elementId, ArkUI_AccessibilitySearchMode mode, int32_t requestId, ArkUI_AccessibilityElementInfoList* elementList); + /** Called when need to get element infos based on a specified node and text content. */ + int32_t (*FindAccessibilityNodeInfosByText)(int64_t elementId, const char* text, int32_t requestId, ArkUI_AccessibilityElementInfoList* elementList); + /** Called when need to get the focused element info based on a specified node. */ + int32_t (*FindFocusedAccessibilityNode)(int64_t elementId, ArkUI_AccessibilityFocusType focusType, int32_t requestId, ArkUI_AccessibilityElementInfo* elementinfo); + /** Query the node that can be focused based on the reference node. Query the next node that can be focused based on the mode and direction. */ + int32_t (*FindNextFocusAccessibilityNode)(int64_t elementId, ArkUI_AccessibilityFocusMoveDirection direction, int32_t requestId, ArkUI_AccessibilityElementInfo* elementList); + /** Performing the Action operation on a specified node. */ + int32_t (*ExecuteAccessibilityAction)(int64_t elementId, ArkUI_Accessibility_ActionType action, ArkUI_AccessibilityActionArguments actionArguments, int32_t requestId); + /** Clears the focus status of the currently focused node */ + int32_t (*ClearFocusedFocusAccessibilityNode)(); + /** Queries the current cursor position of a specified node. */ + int32_t (*GetAccessibilityNodeCursorPosition)(int64_t elementId, int32_t requestId, int32_t* index); +} ArkUI_AccessibilityProviderCallbacks; + +/** + * @brief Registers a callback for this ArkUI_AccessibilityProvider instance. + * + * @param provider Indicates the pointer to this ArkUI_AccessibilityProvider instance. + * @param callbacks Indicates the pointer to a GetAccessibilityNodeCursorPosition callback. + * @return Returns the status code of the execution. + * @since 13 + * @version 1.0 + */ +int32_t OH_ArkUI_AccessibilityProviderRegisterCallback( + ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityProviderCallbacks* callbacks); + +/** + * @brief send accessibility event info. + * + * @param provider Indicates the pointer to this ArkUI_AccessibilityProvider instance. + * @param eventInfo Indicates the pointer to the accessibility event info. + * @param callback Indicates the pointer to a SendAccessibilityAsyncEvent callback. + * @return Returns the status code of the execution. + * @since 13 + * @version 1.0 + */ +void OH_ArkUI_SendAccessibilityAsyncEvent( + ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityEventInfo* eventInfo, void (*callback)(int32_t errorCode)); + +/** + * @brief Adds an element to the list. + * + * @param list Indicates the pointer to the accessibility element list. + * @return Returns the pointer to the accessibility elementInfo. + * @since 13 + * @version 1.0 + */ +ArkUI_AccessibilityElementInfo* OH_ArkUI_AddAndGetAccessibilityElementInfo(ArkUI_AccessibilityElementInfoList* list); + +/** +* @brief Sets the page id of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param pageId Indicates the page id. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoPageId(ArkUI_AccessibilityElementInfo* elementInfo, int32_t pageId); + +/** +* @brief Sets the page id of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param componentId Indicates the component id. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoComponentId(ArkUI_AccessibilityElementInfo* elementInfo, int32_t componentId); + +/** +* @brief Sets the parent id of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param parentId Indicates the parent id. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoParentId(ArkUI_AccessibilityElementInfo* elementInfo, int32_t parentId); + +/** +* @brief Sets the component type of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param componentType Indicates the component type. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoComponentType(ArkUI_AccessibilityElementInfo* elementInfo, const char* componentType); + +/** +* @brief Sets the component contents of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param contents Indicates the component contents. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoContents(ArkUI_AccessibilityElementInfo* elementInfo, const char* contents); + +/** +* @brief Sets the hint text of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param hintText Indicates the hint text. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoHintText(ArkUI_AccessibilityElementInfo* elementInfo, const char* hintText); + +/** +* @brief Sets the accessibility text of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param accessibilityText Indicates the accessibility text. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoAccessibilityText(ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityText); + +/** +* @brief Sets the accessibility description of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param accessibilityDescription Indicates the accessibility description. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoAccessibilityDescription(ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityDescription); + +/** +* @brief Sets the child node ids of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param childCount Indicates the child count. +* @param childNodeIds Indicates the child node ids. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoChildNodeIds(ArkUI_AccessibilityElementInfo* elementInfo, int32_t childCount, int64_t* childNodeIds); + +/** +* @brief Sets the child count of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param operationActions Indicates All actions supported by the element. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoOperationActions(ArkUI_AccessibilityElementInfo* elementInfo, int32_t operationCount, ArkUI_AccessibleAction* operationActions); + +/** +* @brief Sets the screen rect of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param screenRect Indicates screen rect. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoScreenRect(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRect* screenRect); + +/** +* @brief Sets the checkable of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param checkable Indicates checkable. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoCheckable(ArkUI_AccessibilityElementInfo* elementInfo, bool checkable); + +/** +* @brief Sets the checked of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param checked Indicates whether the element is checked. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoChecked(ArkUI_AccessibilityElementInfo* elementInfo, bool checked); + +/** +* @brief Sets the focusable of the accessibility element information. +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param focusable Indicates whether the element is focusable. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoFocusable(ArkUI_AccessibilityElementInfo* elementInfo, bool focusable); + +/** +* @brief Sets the isFocused of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param isFocused Indicates whether the element is focused. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoFocused(ArkUI_AccessibilityElementInfo* elementInfo, bool isFocused); + +/** +* @brief Sets the isVisible of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param isVisible Indicates whether the element is visible. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoVisible(ArkUI_AccessibilityElementInfo* elementInfo, bool isVisible); + +/** +* @brief Sets the accessibilityFocused of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param accessibilityFocused Indicates whether the element is accessibility focused. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoAccessibilityFocused(ArkUI_AccessibilityElementInfo* elementInfo, bool accessibilityFocused); + +/** +* @brief Sets the selected of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param selected Indicates whether the element is selected. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoSelected(ArkUI_AccessibilityElementInfo* elementInfo, bool selected); + +/** +* @brief Sets the clickable of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param clickable Indicates whether the element is clickable. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoClickable(ArkUI_AccessibilityElementInfo* elementInfo, bool clickable); + +/** +* @brief Sets the longClickable of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param longClickable Indicates whether the element is long clickable. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoLongClickable(ArkUI_AccessibilityElementInfo* elementInfo, bool longClickable); + +/** +* @brief Sets the isEnabled of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param isEnable Indicates whether the element is enable. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoEnabled(ArkUI_AccessibilityElementInfo* elementInfo, bool isEnabled); + +/** +* @brief Sets the isPassword of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param isPassword Indicates whether the element is a password. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoIsPassword(ArkUI_AccessibilityElementInfo* elementInfo, bool isPassword); + +/** +* @brief Sets the scrollable of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param scrollable Indicates whether the element is scrollable. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoScrollable(ArkUI_AccessibilityElementInfo* elementInfo, bool scrollable); + +/** +* @brief Sets the editable of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param editable Indicates whether the element is editable. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoEditable(ArkUI_AccessibilityElementInfo* elementInfo, bool editable); + +/** +* @brief Sets the isHint of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param isHint Indicates whether the element is in the hint state. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoIsHint(ArkUI_AccessibilityElementInfo* elementInfo, bool isHint); + +/** +* @brief Sets the rangeInfo of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param rangeInfo Indicates element's range info. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoRangeInfo(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRangeInfo* rangeInfo); + +/** +* @brief Sets the grid of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param gridInfo Indicates element's grid info. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoGridInfo(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridInfo* gridInfo); + +/** +* @brief Sets the gridItem of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param gridItem Indicates element's grid item info. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoGridItemInfo(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridItemInfo* gridItem); + +/** +* @brief Sets the textBeginSelected of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param textBeginSelected Indicates the start position of the selection. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoTextBeginSelected(ArkUI_AccessibilityElementInfo* elementInfo, int32_t textBeginSelected); + +/** +* @brief Sets the textEndSelected of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param textEndSelected Indicates the end position of the selection. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoTextEndSelected(ArkUI_AccessibilityElementInfo* elementInfo, int32_t textEndSelected); + +/** +* @brief Sets the currentItemIndex of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param currentItemIndex Indicates index of the current item. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoCurrentItemIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t currentItemIndex); + +/** +* @brief Sets the beginItemIndex of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param beginItemIndex Indicates index of the begin item. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoBeginItemIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t beginItemIndex); + +/** +* @brief Sets the endItemIndex of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param endItemIndex Indicates index of the end item. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoEndItemIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t endItemIndex); + +/** +* @brief Sets the itemCount of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param itemCount Indicates total number of items. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoItemCount(ArkUI_AccessibilityElementInfo* elementInfo, int32_t itemCount); + +/** +* @brief Sets the offset of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param offset Indicates pixel offset for scrolling relative to the top coordinate of the element. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoAccessibilityOffset(ArkUI_AccessibilityElementInfo* elementInfo, int32_t offset); + +/** +* @brief Sets the accessibilityGroup of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param accessibilityGroup Indicates accessibility group. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoAccessibilityGroup(ArkUI_AccessibilityElementInfo* elementInfo, bool accessibilityGroup); + +/** +* @brief Sets the accessibilityLevel of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param accessibilityLevel Indicates accessibility level. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoAccessibilityLevel(ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityLevel); + +/** +* @brief Sets the zIndex of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param zIndex Indicates z index. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoZIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t zIndex); + +/** +* @brief Sets the opacity of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param opacity Indicates opacity. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoAccessibilityOpacity(ArkUI_AccessibilityElementInfo* elementInfo, float opacity); + +/** +* @brief Sets the backgroundColor of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param backgroundColor Indicates background color. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoBackgroundColor(ArkUI_AccessibilityElementInfo* elementInfo, const char* backgroundColor); + +/** +* @brief Sets the backgroundImage of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param backgroundImage Indicates background image. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoBackgroundImage(ArkUI_AccessibilityElementInfo* elementInfo, const char* backgroundImage); + +/** +* @brief Sets the blur of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param blur Indicates blur. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoBlur(ArkUI_AccessibilityElementInfo* elementInfo, const char* blur); + +/** +* @brief Sets the hitTestBehavior of the accessibility element information. +* +* @param elementInfo Indicates the pointer to the accessibility element information. +* @param hitTestBehavior Indicates hitTest behavior. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityElementInfoHitTestBehavior(ArkUI_AccessibilityElementInfo* elementInfo, const char* hitTestBehavior); + +/** + * @brief Create an accessibility eventInfo. + * + * @return Returns the pointer to the accessibility event info. + * @since 13 + * @version 1.0 + */ +ArkUI_AccessibilityEventInfo* OH_ArkUI_CreateAccessibilityEventInfo(void); + +/** + * @brief Destorys an accessibility eventInfo. + * + * @param eventInfo Indicates the pointer to to the accessibility event info to be destoryed. + * @since 13 + * @version 1.0 + */ +void OH_ArkUI_DestoryAccessibilityEventInfo(ArkUI_AccessibilityEventInfo* eventInfo); + +/** +* @brief Sets the eventType of the accessibility event information. +* +* @param eventInfo Indicates the pointer to the accessibility event information. +* @param eventType Indicates event type. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityEventEventType(ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityEventType eventType); + +/** +* @brief Sets the pageId of the accessibility event information. +* +* @param eventInfo Indicates the pointer to the accessibility event information. +* @param pageId Indicates page id. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityEventPageId(ArkUI_AccessibilityEventInfo* eventInfo, int32_t pageId); + +/** +* @brief Sets the textAnnouncedForAccessibility of the accessibility event information. +* +* @param eventInfo Indicates the pointer to the accessibility event information. +* @param textAnnouncedForAccessibility Indicates text announced for accessibility. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityEventTextAnnouncedForAccessibility(ArkUI_AccessibilityEventInfo* eventInfo, const char* textAnnouncedForAccessibility); + +/** +* @brief Sets the requestFocusId of the accessibility event information. +* +* @param eventInfo Indicates the pointer to the accessibility event information. +* @param requestFocusId Indicates ID of the request for active focus. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityEventRequestFocusId(ArkUI_AccessibilityEventInfo* eventInfo, int32_t requestFocusId); + +/** +* @brief Sets the elementInfo of the accessibility event information. +* +* @param eventInfo Indicates the pointer to the accessibility event information. +* @param elementInfo Indicates element Info. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_SetAccessibilityEventElementInfo(ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityElementInfo* elementInfo); + +/** +* @brief Gets the value of the accessibility action argument by key. +* +* @param arguments Indicates the pointer to the accessibility action arguments. +* @param key Indicates key. +* @param value Indicates value. +* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. +* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @since 13 +*/ +int32_t OH_ArkUI_FindAccessibilityActionArgumentByKey(ArkUI_AccessibilityActionArguments* arguments, const char* key, char* value); +#ifdef __cplusplus +}; +#endif +#endif // _NATIVE_INTERFACE_ACCESSIBILITY_H diff --git a/arkui/ace_engine/native/native_interface_xcomponent.h b/arkui/ace_engine/native/native_interface_xcomponent.h index bbf720155..39d8a9da1 100644 --- a/arkui/ace_engine/native/native_interface_xcomponent.h +++ b/arkui/ace_engine/native/native_interface_xcomponent.h @@ -46,6 +46,7 @@ #include "arkui/native_type.h" #include "arkui/ui_input_event.h" +#include "native_interface_accessibility.h" #include "native_xcomponent_key_event.h" #ifdef __cplusplus @@ -815,6 +816,18 @@ int32_t OH_NativeXComponent_GetTouchEventSourceType( */ OH_NativeXComponent* OH_NativeXComponent_GetNativeXComponent(ArkUI_NodeHandle node); +/** + * @brief Obtains the accessibility handle by the ArkUI XComponent. + * + * @param component Indicates the pointer to this OH_NativeXComponent instance. + * @param provider Indicates the pointer to pointer of ArkUI_AccessibilityProvider instance. + * @return Returns the status code of the execution. + * @since 13 + * @version 1.0 + */ +int32_t OH_NativeXComponent_GetNativeAccessibilityProvider( + OH_NativeXComponent* component, ArkUI_AccessibilityProvider** handle); + #ifdef __cplusplus }; #endif -- Gitee From c333dcffdfcf2e961084ef3807d376e292593556 Mon Sep 17 00:00:00 2001 From: yangxuguang-huawei Date: Wed, 28 Aug 2024 14:38:20 +0800 Subject: [PATCH 180/620] fix: chenge to API13 Signed-off-by: yangxuguang-huawei Change-Id: I8a18a38402a443cb53be25babdf6121158d61a63 --- ability/ability_runtime/child_process/native_child_process.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ability/ability_runtime/child_process/native_child_process.h b/ability/ability_runtime/child_process/native_child_process.h index 3c9b18d38..84c0ddf7b 100644 --- a/ability/ability_runtime/child_process/native_child_process.h +++ b/ability/ability_runtime/child_process/native_child_process.h @@ -48,10 +48,6 @@ extern "C" { * @brief Enumerates the error codes used by the native child process module. * @since 12 */ -/** - * @brief Enumerates the error codes used by the native child process module. - * @since 13 - */ typedef enum Ability_NativeChildProcess_ErrCode { /** * @error Operation successful. @@ -60,6 +56,7 @@ typedef enum Ability_NativeChildProcess_ErrCode { /** * @error Operation not permitted. + * @since 13 */ NCP_ERR_NO_PERMISSION = 201, -- Gitee From 699a3995021b62bb99e06b5644b8e66ee0880230 Mon Sep 17 00:00:00 2001 From: lihui Date: Wed, 28 Aug 2024 11:31:08 +0800 Subject: [PATCH 181/620] =?UTF-8?q?=E6=96=B0=E5=A2=9Enative=20image?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=80=82=E9=85=8D=E4=B8=89=E6=96=B9wx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lihui --- .../native_image/libnative_image.ndk.json | 8 ++++++ .../graphic_2d/native_image/native_image.h | 28 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/graphic/graphic_2d/native_image/libnative_image.ndk.json b/graphic/graphic_2d/native_image/libnative_image.ndk.json index 4d9f20d89..cc12b88ad 100644 --- a/graphic/graphic_2d/native_image/libnative_image.ndk.json +++ b/graphic/graphic_2d/native_image/libnative_image.ndk.json @@ -22,5 +22,13 @@ { "first_introduced": "12", "name": "OH_ConsumerSurface_Create" + }, + { + "first_introduced": "13", + "name": "OH_ConsumerSuface_SetDefaultUsage" + }, + { + "first_introduced": "13", + "name": "OH_ConsumerSuface_SetDefaultSize" } ] \ No newline at end of file diff --git a/graphic/graphic_2d/native_image/native_image.h b/graphic/graphic_2d/native_image/native_image.h index 0a12a14dc..acac1ca3a 100644 --- a/graphic/graphic_2d/native_image/native_image.h +++ b/graphic/graphic_2d/native_image/native_image.h @@ -300,6 +300,34 @@ int32_t OH_NativeImage_ReleaseNativeWindowBuffer(OH_NativeImage* image, */ OH_NativeImage* OH_ConsumerSurface_Create(); +/** + * @brief Set the default usage of the OH_NativeImage.\n + * This interface dose not support concurrency.\n + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeImage + * @param image Indicates the pointer to a OH_NativeImage instance. + * @param usage Indicates the usage of the OH_NativeImage.Refer to the enum OH_NativeBuffer_Usage. + * @return {@link NATIVE_ERROR_OK} 0 - Success. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - image is NULL. + * @since 13 + * @version 1.0 + */ +int32_t OH_ConsumerSuface_SetDefaultUsage(OH_NativeImage* image, uint64_t usage); + +/** + * @brief Set the default size of the OH_NativeImage.\n + * This interface dose not support concurrency.\n + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeImage + * @param image Indicates the pointer to a OH_NativeImage instance. + * @param width Indicates the width of the OH_NativeImage, and it should be greater than 0. + * @param height Indicates the height of the OH_NativeImage, and it should be greater than 0. + * @return {@link NATIVE_ERROR_OK} 0 - Success. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - image is NULL or width, height less than or equal to 0. + * @since 13 + * @version 1.0 + */ +int32_t OH_ConsumerSuface_SetDefaultSize(OH_NativeImage* image, int32_t width, int32_t height); #ifdef __cplusplus } #endif -- Gitee From 76df4148e0755903a7c62bc49ffbe1cf9feb3a5f Mon Sep 17 00:00:00 2001 From: qianqiuhong Date: Wed, 28 Aug 2024 16:31:23 +0800 Subject: [PATCH 182/620] =?UTF-8?q?=E5=A2=9E=E5=8A=A0NODE=5FFOCUS=5FSTATUS?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qianqiuhong --- arkui/ace_engine/native/native_node.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 82fb26773..2b843bc50 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -1354,7 +1354,9 @@ typedef enum { /** * @brief Defines the focused state. This attribute can be set and obtained as required through APIs. - * + * @note Setting the parameter to 0 shifts focus from the currently focused component on the current level + * of the page to the root container. + * * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n * .value[0].i32: The parameter type is 1 or 0. * \n -- Gitee From c0133f96b99d18412840768d77eecb7d217c7a81 Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Wed, 28 Aug 2024 11:54:54 +0000 Subject: [PATCH 183/620] add device listener capi Signed-off-by: hellohyh001 --- .../kits/c/input/oh_input_manager.h | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 4c3a94b31..bd365ec46 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -228,6 +228,27 @@ typedef enum Input_Result { INPUT_REPEAT_INTERCEPTOR = 4200001 } Input_Result; +/** 设备类型未知 */ +static const char* const Input_Device_Type_UNKNOWN = "ohos.input.device.unknown"; + +/** 设备类型键盘 */ +static const char* const Input_Device_Type_KEYBOARD = "ohos.input.device.keyboard"; + +/** 设备类型鼠标 */ +static const char* const Input_Device_Type_MOUSE = "ohos.input.device.mouse"; + +/** 设备类型触摸板 */ +static const char* const Input_Device_Type_TOUCHPAD = "ohos.input.device.touchpad"; + +/** 设备类型触屏 */ +static const char* const Input_Device_Type_TOUCHSCREEN = "ohos.input.device.touchscreen"; + +/** 设备类型遥感 */ +static const char* const Input_Device_Type_JOYSTICK = "ohos.input.device.joystick"; + +/** 设备类型轨迹球 */ +static const char* const Input_Device_Type_TRACKBALL = "ohos.input.device.trackball"; + /** * @brief Defines a lifecycle callback for keyEvent. If the callback is triggered, keyEvent will be destroyed. * @@ -260,6 +281,18 @@ typedef void (*Input_TouchEventCallback)(const Input_TouchEvent* touchEvent); */ typedef void (*Input_AxisEventCallback)(const Input_AxisEvent* axisEvent); +/** + * @brief 定义一个回调函数用于设备id和设备类型 + * @since 13 + */ +typedef void (*Input_DeviceAddedCallback)(int32_t deviceId, const char* deviceType); + +/** + * @brief 定义一个回调函数用于设备id和设备类型 + * @since 13 + */ +typedef void (*Input_DeviceRemovedCallback)(int32_t deviceId, const char* deviceType); + /** * @brief Defines the structure for the interceptor of event callbacks, * including mouseCallback, touchCallback, and axisCallback. @@ -274,6 +307,16 @@ typedef struct Input_InterceptorEventCallback { Input_AxisEventCallback axisCallback; } Input_InterceptorEventCallback; +/** + * @brief 定义一个结构体用于监听设备设插拔 + * 包含了 addedCallback, removedCallback + * @since 13 + */ +typedef struct Input_DeviceListener { + Input_DeviceAddedCallback OnDeviceAdded; + Input_DeviceRemovedCallback OnDeviceRemoved; +}; + /** * @brief Defines event interceptor options. * @since 12 @@ -1200,6 +1243,45 @@ Input_Result OH_Input_RemoveKeyEventInterceptor(void); * @since 12 */ Input_Result OH_Input_RemoveInputEventInterceptor(void); + +/** + * @brief 按键键值转换成字符串 + * + * @param keyCode 要转成字符串的按键键值 + + * @return 如果返回一个字符串则表示成功,如果返回NULL则表示失败。 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +const char* KeyCodeToString(int32_t keyCode); + +/** + * @brief 注册设备热插拔的监听器 + * + * @param listener 用于监听设备热插拔的监听器. + * + * @return OH_Input_RegisterDeviceListener status code, specifically, + * {@link INPUT_SUCCESS} if the operation is successful;\n + * {@link INPUT_PARAMETER_ERROR} listener 为NULL 或 listener 已被注册 + * {@link INPUT_SERVICE_EXCEPTION} 服务端连接异常 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_RegisterDeviceListener(Input_DeviceListener* listener); + +/** + * @brief 取消注册设备热插拔的监听器 + * + * @param listener 用于监听设备热插拔的监听器. + * + * @return OH_Input_UnregisterDeviceListener status code, specifically, + * {@link INPUT_SUCCESS} if the operation is successful;\n + * {@link INPUT_PARAMETER_ERROR} listener 为 NULL, listener 未注册或已被取消注册 + * {@link INPUT_SERVICE_EXCEPTION} 服务端连接异常 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_UnregisterDeviceListener(Input_DeviceListener* listener); #ifdef __cplusplus } #endif -- Gitee From b51eaa01b82b06ca8e36d96ca55b6d2cca3d629e Mon Sep 17 00:00:00 2001 From: sunbees Date: Wed, 28 Aug 2024 19:57:46 +0800 Subject: [PATCH 184/620] fix xcomponent ndk macro Signed-off-by: sunbees Change-Id: If365f3419dd8fba2a58816e8926886dec6128f09 --- arkui/ace_engine/native/native_interface_xcomponent.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_interface_xcomponent.h b/arkui/ace_engine/native/native_interface_xcomponent.h index bbf720155..7175eae72 100644 --- a/arkui/ace_engine/native/native_interface_xcomponent.h +++ b/arkui/ace_engine/native/native_interface_xcomponent.h @@ -53,6 +53,7 @@ extern "C" { #endif #define OH_NATIVE_XCOMPONENT_OBJ ("__NATIVE_XCOMPONENT_OBJ__") +#define OH_NATIVE_XCOMPONENT_MAX_TOUCH_POINTS_NUMBER 10 const uint32_t OH_XCOMPONENT_ID_LEN_MAX = 128; const uint32_t OH_MAX_TOUCH_POINTS_NUMBER = 10; @@ -258,7 +259,7 @@ typedef struct { /** Timestamp of the current touch event. */ int64_t timeStamp; /** Array of the current touch points. */ - OH_NativeXComponent_TouchPoint touchPoints[OH_MAX_TOUCH_POINTS_NUMBER]; + OH_NativeXComponent_TouchPoint touchPoints[OH_NATIVE_XCOMPONENT_MAX_TOUCH_POINTS_NUMBER]; /** Number of current touch points. */ uint32_t numPoints; } OH_NativeXComponent_TouchEvent; -- Gitee From 2a12c28459292abe74ac71e3d713725c4014da3f Mon Sep 17 00:00:00 2001 From: lixiangpeng5 Date: Wed, 28 Aug 2024 15:20:47 +0000 Subject: [PATCH 185/620] add capi for linear acc and game rotation vector Signed-off-by: lixiangpeng5 Change-Id: Ida167a634827cb5259a674d2ee83a653a05fc202 --- sensors/sensor/oh_sensor_type.h | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/sensors/sensor/oh_sensor_type.h b/sensors/sensor/oh_sensor_type.h index 6f2cc925a..382fb377b 100644 --- a/sensors/sensor/oh_sensor_type.h +++ b/sensors/sensor/oh_sensor_type.h @@ -91,11 +91,21 @@ typedef enum Sensor_Type { * @since 11 */ SENSOR_TYPE_GRAVITY = 257, + /** + * Linear acceleration sensor. + * @since 13 + */ + SENSOR_TYPE_LINEAR_ACCELERATION = 258, /** * Rotation vector sensor. * @since 11 */ SENSOR_TYPE_ROTATION_VECTOR = 259, + /** + * Game rotation vector sensor. + * @since 13 + */ + SENSOR_TYPE_ID_GAME_ROTATION_VECTOR = 262, /** * Pedometer detection sensor. * @since 11 @@ -342,6 +352,45 @@ int32_t OH_SensorEvent_GetAccuracy(Sensor_Event* sensorEvent, Sensor_Accuracy *a * returns an error code defined in {@link Sensor_Result} otherwise. * @since 11 */ +/** + * @brief Obtains sensor data. The data length and content depend on the sensor type. + * The format of the sensor data reported is as follows: + * SENSOR_TYPE_ACCELEROMETER: data[0], data[1], and data[2], indicating the acceleration around + * the x, y, and z axes of the device, respectively, in m/s2. + * SENSOR_TYPE_GYROSCOPE: data[0], data[1], and data[2], indicating the angular velocity of rotation around + * the x, y, and z axes of the device, respectively, in rad/s. + * SENSOR_TYPE_AMBIENT_LIGHT: data[0], indicating the ambient light intensity, in lux. Since api version 12, + * two additional data will be returned, where data[1] indicating the color temperature, in kelvin; data[2] + * indicating the infrared luminance, in cd/m2. + * SENSOR_TYPE_MAGNETIC_FIELD: data[0], data[1], and data[2], indicating the magnetic field strength around + * the x, y, and z axes of the device, respectively, in μT. + * SENSOR_TYPE_BAROMETER: data[0], indicating the atmospheric pressure, in hPa. + * SENSOR_TYPE_HALL: data[0], indicating the opening/closing state of the flip cover. The value 0 means that + * the flip cover is opened, and a value greater than 0 means that the flip cover is closed. + * SENSOR_TYPE_PROXIMITY: data[0], indicates the approaching state. The value 0 means the two objects are close + * to each other, and a value greater than 0 means that they are far away from each other. + * SENSOR_TYPE_ORIENTATION: data[0], data[1], and data[2], indicating the rotation angles of a device around + * the z, x, and y axes, respectively, in degree. + * SENSOR_TYPE_GRAVITY: data[0], data[1], and data[2], indicating the gravitational acceleration around + * the x, y, and z axes of a device, respectively, in m/s2. + * SENSOR_TYPE_ROTATION_VECTOR: data[0], data[1] and data[2], indicating the rotation angles of a device around + * the x, y, and z axes, respectively, in degree. data[3] indicates the rotation vector. + * SENSOR_TYPE_PEDOMETER_DETECTION: data[0], indicating the pedometer detection status. + * The value 1 means that the number of detected steps changes. + * SENSOR_TYPE_PEDOMETER: data[0], indicating the number of steps a user has walked. + * SENSOR_TYPE_HEART_RATE: data[0], indicating the heart rate value. + * SENSOR_TYPE_LINEAR_ACCELERATION: data[0], data[1], and data[2], indicating the acceleration around + * the x, y, and z axes of the device, respectively, in m/s2. + * SENSOR_TYPE_ID_GAME_ROTATION_VECTOR: data[0], data[1] and data[2], indicating the rotation angles of a device around + * the x, y, and z axes, respectively, in degree. data[3] indicates the rotation vector. + * + * @param sensorEvent - Pointer to the sensor data information. + * @param data - Double pointer to the sensor data. + * @param length - Pointer to the array length. + * @return Returns SENSOR_SUCCESS if the operation is successful; + * returns an error code defined in {@link Sensor_Result} otherwise. + * @since 13 + */ int32_t OH_SensorEvent_GetData(Sensor_Event* sensorEvent, float **data, uint32_t *length); /** -- Gitee From 57dee640ab1b53ad50e0ce6c778b41e050fe11a7 Mon Sep 17 00:00:00 2001 From: dujingcheng Date: Wed, 28 Aug 2024 07:22:46 +0000 Subject: [PATCH 186/620] fxi Signed-off-by: dujingcheng --- arkui/ace_engine/native/BUILD.gn | 1 + arkui/ace_engine/native/libace.ndk.json | 220 ++++++++++++++++++ .../native/native_interface_accessibility.h | 2 +- .../native/native_interface_xcomponent.h | 2 +- .../kit_sub_system/c_file_kit_sub_system.json | 5 + 5 files changed, 228 insertions(+), 2 deletions(-) diff --git a/arkui/ace_engine/native/BUILD.gn b/arkui/ace_engine/native/BUILD.gn index 92f05cac4..99ad7f778 100644 --- a/arkui/ace_engine/native/BUILD.gn +++ b/arkui/ace_engine/native/BUILD.gn @@ -32,6 +32,7 @@ if (!is_arkui_x) { "native_dialog.h", "native_gesture.h", "native_interface.h", + "native_interface_accessibility.h", "native_node.h", "native_node_napi.h", "native_type.h", diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 7e3b610ab..94884c361 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2134,5 +2134,225 @@ { "first_introduced": "12", "name": "OH_ArkUI_SystemFontStyleEvent_GetFontWeightScale" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_AccessibilityProviderRegisterCallback" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SendAccessibilityAsyncEvent" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_AddAndGetAccessibilityElementInfo" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoPageId" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoComponentId" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoParentId" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoComponentType" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoContents" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoHintText" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoAccessibilityText" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoAccessibilityDescription" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoChildNodeIds" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoOperationActions" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoScreenRect" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoCheckable" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoChecked" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoFocusable" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoFocused" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoVisible" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoAccessibilityFocused" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoSelected" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoClickable" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoLongClickable" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoEnabled" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoIsPassword" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoScrollable" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoEditable" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoIsHint" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoRangeInfo" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoGridInfo" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoGridItemInfo" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoTextBeginSelected" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoTextEndSelected" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoCurrentItemIndex" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoBeginItemIndex" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoEndItemIndex" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoItemCount" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoAccessibilityOffset" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoAccessibilityGroup" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoAccessibilityLevel" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoZIndex" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoAccessibilityOpacity" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoBackgroundColor" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoBackgroundImage" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoBlur" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoHitTestBehavior" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_CreateAccessibilityEventInfo" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_DestoryAccessibilityEventInfo" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityEventEventType" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityEventPageId" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityEventTextAnnouncedForAccessibility" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityEventRequestFocusId" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityEventElementInfo" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_FindAccessibilityActionArgumentByKey" + }, + { + "first_introduced": "13", + "name": "OH_NativeXComponent_GetNativeAccessibilityProvider" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_interface_accessibility.h b/arkui/ace_engine/native/native_interface_accessibility.h index 0b7eb95a0..0fc10b641 100644 --- a/arkui/ace_engine/native/native_interface_accessibility.h +++ b/arkui/ace_engine/native/native_interface_accessibility.h @@ -318,7 +318,7 @@ typedef struct ArkUI_AccessibilityProviderCallbacks { /** Query the node that can be focused based on the reference node. Query the next node that can be focused based on the mode and direction. */ int32_t (*FindNextFocusAccessibilityNode)(int64_t elementId, ArkUI_AccessibilityFocusMoveDirection direction, int32_t requestId, ArkUI_AccessibilityElementInfo* elementList); /** Performing the Action operation on a specified node. */ - int32_t (*ExecuteAccessibilityAction)(int64_t elementId, ArkUI_Accessibility_ActionType action, ArkUI_AccessibilityActionArguments actionArguments, int32_t requestId); + int32_t (*ExecuteAccessibilityAction)(int64_t elementId, ArkUI_Accessibility_ActionType action, ArkUI_AccessibilityActionArguments *actionArguments, int32_t requestId); /** Clears the focus status of the currently focused node */ int32_t (*ClearFocusedFocusAccessibilityNode)(); /** Queries the current cursor position of a specified node. */ diff --git a/arkui/ace_engine/native/native_interface_xcomponent.h b/arkui/ace_engine/native/native_interface_xcomponent.h index 39d8a9da1..ae0edc011 100644 --- a/arkui/ace_engine/native/native_interface_xcomponent.h +++ b/arkui/ace_engine/native/native_interface_xcomponent.h @@ -43,10 +43,10 @@ #include #endif +#include "arkui/native_interface_accessibility.h" #include "arkui/native_type.h" #include "arkui/ui_input_event.h" -#include "native_interface_accessibility.h" #include "native_xcomponent_key_event.h" #ifdef __cplusplus diff --git a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json index 668e349de..2e7636057 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json +++ b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json @@ -16,6 +16,11 @@ "kitName": "ArkUI", "subSystem": "ArkUI开发框架" }, + { + "filePath": "arkui/ace_engine/native/native_interface_accessibility.h", + "kitName": "ArkUI", + "subSystem": "ArkUI开发框架" + }, { "filePath": "arkui/ace_engine/native/native_xcomponent_key_event.h", "kitName": "ArkUI", -- Gitee From e89e3317cd67bbd64f89468ac05560825dab0a12 Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Thu, 29 Aug 2024 06:34:39 +0000 Subject: [PATCH 187/620] System shortcut key capi interface Signed-off-by: hellohyh001 Change-Id: Iaf5a3935b13ef855b180317305f0ead886fe0f04 --- .../kits/c/input/oh_input_manager.h | 114 ++++++++++++++++++ multimodalinput/kits/c/ohinput.ndk.json | 40 ++++++ 2 files changed, 154 insertions(+) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 3cade9b3a..9e11c5523 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -208,6 +208,13 @@ typedef struct Input_TouchEvent Input_TouchEvent; */ typedef struct Input_AxisEvent Input_AxisEvent; +/** + * @brief Defines the hot key structure. + * + * @since 13 + */ +typedef struct Input_Hotkey Input_Hotkey; + /** * @brief Enumerates error codes. * @@ -1214,6 +1221,113 @@ Input_Result OH_Input_RemoveInputEventInterceptor(void); */ Input_Result OH_Input_GetIntervalSinceLastInput(int64_t *timeInterval); +/** + * @brief Creates a hot key object. + * + * @return Returns an {@Link Input_Hotkey} pointer object if the operation is successful. Otherwise, a null pointer is + * returned. The possible cause is memory allocation failure. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Hotkey *OH_Input_CreateHotkey(void); + +/** + * @brief Destroys a hot key object. + * + * @param hotkey Hot key object. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +void OH_Input_DestroyHotkey(Input_Hotkey **hotkey); + +/** + * @brief Sets a modifier key. + * + * @param hotkey Hotkey key object. + * @param preKeys List of modifier keys. + * @param size Number of modifier keys. One or two modifier keys are supported. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +void OH_Input_SetPreKeys(Input_Hotkey *hotkey, int32_t *preKeys, int32_t size); + +/** + * @brief Obtains a modifier key. + * + * @param hotkey Hotkey key object. + * @param preKeys List of modifier keys. + * @param preKeyCount Number of modifier keys. + * @return OH_Input_GetPreKeys status code, specifically, + * {@link INPUT_SUCCESS} if the operation is successful;\n + * {@link INPUT_PARAMETER_ERROR} The hotkey is NULL or the pressedKeys is NULL or the pressedKeyCount + * is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetPreKeys(const Input_Hotkey *hotkey, int32_t **preKeys, int32_t *preKeyCount); + +/** + * @brief Sets a modified key. + * + * @param hotkey Hotkey key object. + * @param finalKey Modified key. Only one modified key is supported. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +void OH_Input_SetFinalKey(Input_Hotkey *hotkey, int32_t finalKey); + +/** + * @brief Obtains a modified key. + * + * @param hotkey Hotkey key object. + * @param finalKeyCode Returns the key value of the decorated key. + * @return OH_Input_GetfinalKey status code, specifically, + * {@link INPUT_SUCCESS} if the operation is successful;\n + * {@link INPUT_PARAMETER_ERROR} The hotkey is NULL or the finalKeyCode is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetFinalKey(const Input_Hotkey *hotkey, int32_t *finalKeyCode); + +/** + * @brief Creates an array of {@Link Input_Hotkey} instances. + * + * @param count Number of {@Link Input_Hotkey} instances to be created. The count must be the same as the number of + * system shortcut keys. + * @return Returns a pointer to an array of {@Link Input_Hotkey} instances if the operation is successful. If the + * operation fails, a null pointer is returned. The possible cause is memory allocation failure or count is not equal + * to the number of system hotkeys. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Hotkey **OH_Input_CreateAllSystemHotkeys(int32_t count); + +/** + * @brief Destroys an array of {@link Input_Hotkey} instances and reclaims memory. + * + * @param hotkeys Pointer to an array of {@Link Input_Hotkey } instances created by the + * {@Link OH_Input_CreateAllSystemHotkeys} method. + * @param count Count of the array to be destroyed, which must be the same as the number of system shortcut keys. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +void OH_Input_DestroyAllSystemHotkeys(Input_Hotkey **hotkeys, int32_t count); + +/** + * @brief Obtains all hot keys supported by the system. + * + * @param hotkey Array of {@Link Input_Hotkey} instances. + * When calling this API for the first time, you can pass NULL to obtain the array length. + * @param count Number of hot keys supported by the system. + * @return OH_Input_GetAllSystemHotkeys status code, specifically, + * {@link INPUT_SUCCESS} if the operation is successful;\n + * {@link INPUT_PARAMETER_ERROR} The hotkey or count is NULL, or the value of count does not match the number + * of system shortcut keys supported by the system. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetAllSystemHotkeys(Input_Hotkey **hotkey, int32_t *count); + #ifdef __cplusplus } #endif diff --git a/multimodalinput/kits/c/ohinput.ndk.json b/multimodalinput/kits/c/ohinput.ndk.json index cfbe993ae..60da3d2a8 100644 --- a/multimodalinput/kits/c/ohinput.ndk.json +++ b/multimodalinput/kits/c/ohinput.ndk.json @@ -314,5 +314,45 @@ { "first_introduced": "12", "name": "OH_Input_RemoveInputEventInterceptor" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetIntervalSinceLastInput" + }, + { + "first_introduced": "13", + "name": "OH_Input_CreateAllSystemHotkeys" + }, + { + "first_introduced": "13", + "name": "OH_Input_DestroyAllSystemHotkeys" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetAllSystemHotkeys" + }, + { + "first_introduced": "13", + "name": "OH_Input_CreateHotkey" + }, + { + "first_introduced": "13", + "name": "OH_Input_DestroyHotkey" + }, + { + "first_introduced": "13", + "name": "OH_Input_SetPreKeys" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetPreKeys" + }, + { + "first_introduced": "13", + "name": "OH_Input_SetFinalKey" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetFinalKey" } ] \ No newline at end of file -- Gitee From 60e08afae8b5f3c64e23462c4c74c42aa0fbeedf Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Thu, 29 Aug 2024 07:19:07 +0000 Subject: [PATCH 188/620] 1 Signed-off-by: hellohyh001 --- multimodalinput/kits/c/input/oh_input_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index bd365ec46..98d9c5f6c 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -1253,7 +1253,7 @@ Input_Result OH_Input_RemoveInputEventInterceptor(void); * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ -const char* KeyCodeToString(int32_t keyCode); +const char* OH_Input_KeyCodeToString(int32_t keyCode); /** * @brief 注册设备热插拔的监听器 -- Gitee From 3dbf3dc7d35e548bb799f01e4bcf303b5c4bfd8e Mon Sep 17 00:00:00 2001 From: houpengtao Date: Tue, 23 Jul 2024 12:08:29 +0800 Subject: [PATCH 189/620] add paste board ndk Signed-off-by: houpengtao --- distributeddatamgr/pasteboard/BUILD.gn | 36 +++ .../pasteboard/include/oh_pasteboard.h | 275 ++++++++++++++++++ .../include/oh_pasteboard_err_code.h | 83 ++++++ .../pasteboard/libpasteboard.ndk.json | 58 ++++ 4 files changed, 452 insertions(+) create mode 100644 distributeddatamgr/pasteboard/BUILD.gn create mode 100644 distributeddatamgr/pasteboard/include/oh_pasteboard.h create mode 100644 distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h create mode 100644 distributeddatamgr/pasteboard/libpasteboard.ndk.json diff --git a/distributeddatamgr/pasteboard/BUILD.gn b/distributeddatamgr/pasteboard/BUILD.gn new file mode 100644 index 000000000..4cdf98a13 --- /dev/null +++ b/distributeddatamgr/pasteboard/BUILD.gn @@ -0,0 +1,36 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") +import("//foundation/distributeddatamgr/pasteboard/pasteboard.gni") + +ohos_ndk_headers("pasteboard_ndk_header") { + dest_dir = "$ndk_headers_out_dir/database/pasteboard/" + sources = [ + "./include/oh_pasteboard.h", + "./include/oh_pasteboard_err_code.h", + ] +} + +ohos_ndk_library("libpasteboard") { + output_name = "pasteboard" + output_extension = "so" + system_capability = "SystemCapability.MiscServices.Pasteboard" + ndk_description_file = "./libpasteboard.ndk.json" + min_compact_version = "13" + system_capability_headers = [ + "$ndk_headers_out_dir/database/pasteboard/oh_pasteboard.h", + "$ndk_headers_out_dir/database/pasteboard/oh_pasteboard_err_code.h", + ] +} diff --git a/distributeddatamgr/pasteboard/include/oh_pasteboard.h b/distributeddatamgr/pasteboard/include/oh_pasteboard.h new file mode 100644 index 000000000..6ac4336a2 --- /dev/null +++ b/distributeddatamgr/pasteboard/include/oh_pasteboard.h @@ -0,0 +1,275 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup Pasteboard + * @{ + * + * @brief Provides the copy and paste support for the system Pasteboard. + * You can use the APIs of this module to operate the Pasteboard content of the plain text, HTML, + * URI, Want, pixel map, and other types. + * + * @since 13 + */ + +/** + * @file OH_Pasteboard.h + * + * @brief Provides APIs and enums of the Pasteboard module. + * + * @kit BasicServicesKit + * @library libpasteboard.so + * @syscap SystemCapability.MiscServices.Pasteboard + * + * @since 13 + */ + +#ifndef OH_PASTEBOARD_H +#define OH_PASTEBOARD_H + +#include +#include +#include "database/udmf/udmf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the types of data changes that can be observed. + * + * @since 13 + */ +typedef enum Pasteboard_NotifyType { + /** + * @brief Change of the Pasteboard data in the local device. + */ + NOTIFY_LOCAL_DATA_CHANGE = 1, + /** + * @brief Change of the Pasteboard data in the remote devices. + */ + NOTIFY_REMOTE_DATA_CHANGE = 2 +} Pasteboard_NotifyType; + +/** + * @brief Defines the callback function used to return the Pasteboard data changed. + * + * @param context The context set by {@link OH_PasteboardObserver_SetData} function. + * @param type The types of data changes. For details, see {@link Pasteboard_NotifyType}. + * @since 13 + */ +typedef void (*Pasteboard_Notify)(void* context, Pasteboard_NotifyType type); + +/** + * @brief Defines the callback function used free the context. + * @param context Pointer to the context which is to be free. + * @since 13 + */ +typedef void (*Pasteboard_Finalize)(void* context); + +/** + * @brief Defines the Pasteboard subscriber information + * + * @since 13 + */ +typedef struct OH_PasteboardObserver OH_PasteboardObserver; + +/** + * @brief Creates a {@link OH_PasteboardObserver} instance. + * + * @return Returns the pointer to the {@link OH_PasteboardObserver} instance created if the operation is successful. + * Returns nullptr if the operation is failed. + * @see OH_PasteboardObserver. + * @since 13 + */ +OH_PasteboardObserver* OH_PasteboardObserver_Create(); + +/** + * @brief Destroy a {@link OH_PasteboardObserver} instance. + * + * @param observer Pointer to the {@link OH_PasteboardObserver} instance to destroy. + * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_PasteboardObserver PASTEBOARD_ErrCode. + * @since 13 + */ +int OH_PasteboardObserver_Destroy(OH_PasteboardObserver* observer); + +/** + * @brief Sets a callback function to return the Pasteboard data changed. + * + * @param observer Pointer to the {@link OH_PasteboardObserver} instance. + * @param context Pointer to the context set, which is the first parameter in Pasteboard_Notify. + * @param callback Callback to set. For details, see {@link Pasteboard_Notify}. + * @param finalize Optional callback that can free context when destroy observer. + * For details, see {@link Pasteboard_Finalize}. + * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_PasteboardObserver Pasteboard_Notify PASTEBOARD_ErrCode. + * @since 13 + */ +int OH_PasteboardObserver_SetData(OH_PasteboardObserver* observer, void* context, + const Pasteboard_Notify callback, const Pasteboard_Finalize finalize); + +/** + * @brief Represents the Pasteboard information. + * + * @since 13 + */ +typedef struct OH_Pasteboard OH_Pasteboard; + +/** + * @brief Creates a {@link OH_Pasteboard} instance. + * + * @return Returns the pointer to the {@link OH_Pasteboard} instance created if the operation is successful. + * Returns nullptr if the memory is not enough. + * @see OH_Pasteboard. + * @since 13 + */ +OH_Pasteboard* OH_Pasteboard_Create(); + +/** + * @brief Destroy a {@link OH_Pasteboard} instance. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance to destroy. + * @see OH_Pasteboard. + * @since 13 + */ +void OH_Pasteboard_Destroy(OH_Pasteboard* pasteboard); + +/** + * @brief Subscribes to the Pasteboard data change. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param type Event type to subscribe to. + * @param observer - Pointer to the observer information, which specifies the callback used to + * reporting the pasteboard data change. For details, see {@link OH_PasteboardObserver}. + * @return Returns the status code of the execution. For details, {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_Pasteboard OH_PasteboardObserver PASTEBOARD_ErrCode. + * @since 13 + */ +int OH_Pasteboard_Subscribe(OH_Pasteboard* pasteboard, int type, const OH_PasteboardObserver* observer); + +/** + * @brief Unsubscribes from the Pasteboard data change. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param type Event type to subscribe to. + * @param observer - Pointer to the observer information, which specifies the callback used to + * reporting the pasteboard data change. For details, see {@link OH_PasteboardObserver}. + * @return Returns the status code of the execution. For details, {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_Pasteboard OH_PasteboardObserver PASTEBOARD_ErrCode. + * @since 13 + */ +int OH_Pasteboard_Unsubscribe(OH_Pasteboard* pasteboard, int type, const OH_PasteboardObserver* observer); + +/** + * @brief Checks whether the Pasteboard data is from a remote device. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @return Returns a boolean value, which indicates whether the the data is from a remote device. + * The value {@code false} means Pasteboard data is not from a remote device. + * The value {@code true} means the opposite. + * @see OH_Pasteboard. + * @since 13 + */ +bool OH_Pasteboard_IsRemoteData(OH_Pasteboard* pasteboard); + +/** + * @brief Obtains the source of Pasteboard data. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param source Pointer to the source data. + * @param len Length of the source data. + * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_Pasteboard PASTEBOARD_ErrCode. + * @since 13 + */ +int OH_Pasteboard_GetDataSource(OH_Pasteboard* pasteboard, char* source, unsigned int len); + +/** + * @brief Checks whether the Pasteboard has the specified type of data. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param type Poniter to the type of data to check. + * @return Returns a boolean value, which indicates whether the Pasteboard has the specified type of data. + * The value {@code true} means the Pasteboard has the specified type of data. + * The value {@code false} means the opposite. + * @see OH_Pasteboard. + * @since 13 + */ +bool OH_Pasteboard_HasType(OH_Pasteboard* pasteboard, const char* type); + +/** + * @brief Checks whether there is data in the Pasteboard. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @return Returns a boolean value, which indicates whether there is data in the Pasteboard. + * The value {@code true} means there is data in Pasteboard. + * The value {@code false} means the opposite. + * @see OH_Pasteboard. + * @since 13 + */ +bool OH_Pasteboard_HasData(OH_Pasteboard* pasteboard); + +/** + * @brief Obtains data from the Pasteboard. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param status The status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * @return Returns the pointer to the {@link OH_UdmfData} instance. + * @see OH_Pasteboard OH_UdmfData PASTEBOARD_ErrCode. + * @since 13 + */ +OH_UdmfData* OH_Pasteboard_GetData(OH_Pasteboard* pasteboard, int* status); + +/** + * @brief Writes data to the Pasteboard. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param data Pointer to the {@link OH_UdmfData} instance. + * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_Pasteboard OH_UdmfData PASTEBOARD_ErrCode. + * @since 13 + */ +int OH_Pasteboard_SetData(OH_Pasteboard* pasteboard, OH_UdmfData* data); + +/** + * @brief Clears the data in the Pastedboard. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. + * Returns {@link ERR_OK} if the operation is successful. + * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. + * @see OH_Pasteboard PASTEBOARD_ErrCode. + * @since 13 + */ +int OH_Pasteboard_ClearData(OH_Pasteboard* pasteboard); +#ifdef __cplusplus +}; +#endif + +/** @} */ +#endif \ No newline at end of file diff --git a/distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h b/distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h new file mode 100644 index 000000000..36f30f1a9 --- /dev/null +++ b/distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup Pasteboard + * @{ + * + * @brief Provides the copy and paste support for the system Pasteboard. + * You can use the APIs of this module to operate the Pasteboard content of the plain text, HTML, + * URI, Want, pixel map, and other types. + * + * @since 13 + */ + +/** + * @file oh_pasteboard_err_code.h + * + * @brief Declaration error code information. + * + * @kit BasicServicesKit + * @library libpasteboard.so + * @syscap SystemCapability.MiscServices.Pasteboard + * + * @since 13 + */ + + +#ifndef OH_PASTEBOARD_ERR_CODE_H +#define OH_PASTEBOARD_ERR_CODE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the error codes. + * + * @since 13 + */ +typedef enum PASTEBOARD_ErrCode { + /** + * @error The operation is successful. + */ + ERR_OK = 0, + /** + * @error Permission verification failed. + */ + ERR_PERMISSION_ERROR = 201, + /** + * @error Invalid parameter is detected. + */ + ERR_INVALID_PARAMETER = 401, + /** + * @error The capability is not supported. + */ + ERR_DEVICE_NOT_SUPPORTED = 801, + /** + * @error Inner error. + */ + ERR_INNER_ERROR = 12900000, + /** + * @error Another copy is in progress. + */ + ERR_BUSY = 12900003, +} PASTEBOARD_ErrCode; +#ifdef __cplusplus +}; +#endif + +/** @} */ +#endif diff --git a/distributeddatamgr/pasteboard/libpasteboard.ndk.json b/distributeddatamgr/pasteboard/libpasteboard.ndk.json new file mode 100644 index 000000000..37b1151fb --- /dev/null +++ b/distributeddatamgr/pasteboard/libpasteboard.ndk.json @@ -0,0 +1,58 @@ +[ + { + "first_introduced": "13", + "name": "OH_PasteboardObserver_Create" + }, + { + "first_introduced": "13", + "name": "OH_PasteboardObserver_Destroy" + }, + { + "first_introduced": "13", + "name": "OH_PasteboardObserver_SetData" + }, + { + "first_introduced": "13", + "name": "OH_Pasteboard_Create" + }, + { + "first_introduced": "13", + "name": "OH_PasteBoard_Destroy" + }, + { + "first_introduced": "13", + "name": "OH_PasteBoard_Subcribe" + }, + { + "first_introduced": "13", + "name": "OH_PasteBoard_Unsubcribe" + }, + { + "first_introduced": "13", + "name": "OH_PasteBoard_IsRemoteData" + }, + { + "first_introduced": "13", + "name": "OH_PasteBoard_GetDataSrouce" + }, + { + "first_introduced": "13", + "name": "OH_PasteBoard_HasType" + }, + { + "first_introduced": "13", + "name": "OH_PasteBoard_HasData" + }, + { + "first_introduced": "13", + "name": "OH_PasteBoard_GetData" + }, + { + "first_introduced": "13", + "name": "OH_PasteBoard_SetData" + }, + { + "first_introduced": "13", + "name": "OH_PasteBoard_ClearData" + } +] \ No newline at end of file -- Gitee From fb6686ea747fa4ff0e78322d8c98cebc562205b9 Mon Sep 17 00:00:00 2001 From: houpengtao Date: Sat, 27 Jul 2024 11:00:09 +0800 Subject: [PATCH 190/620] add record provider c api Signed-off-by: houpengtao --- distributeddatamgr/pasteboard/BUILD.gn | 36 --- .../pasteboard/include/oh_pasteboard.h | 305 ------------------ .../include/oh_pasteboard_err_code.h | 77 ----- .../pasteboard/libpasteboard.ndk.json | 62 ---- distributeddatamgr/udmf/include/udmf.h | 79 +++++ 5 files changed, 79 insertions(+), 480 deletions(-) delete mode 100644 distributeddatamgr/pasteboard/BUILD.gn delete mode 100644 distributeddatamgr/pasteboard/include/oh_pasteboard.h delete mode 100644 distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h delete mode 100644 distributeddatamgr/pasteboard/libpasteboard.ndk.json diff --git a/distributeddatamgr/pasteboard/BUILD.gn b/distributeddatamgr/pasteboard/BUILD.gn deleted file mode 100644 index 8887b53ac..000000000 --- a/distributeddatamgr/pasteboard/BUILD.gn +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/ohos.gni") -import("//build/ohos/ndk/ndk.gni") -import("//foundation/distributeddatamgr/pasteboard/pasteboard.gni") - -ohos_ndk_headers("pasteboard_ndk_header") { - dest_dir = "$ndk_headers_out_dir/database/pasteboard/" - sources = [ - "./include/oh_pasteboard.h", - "./include/oh_pasteboard_err_code.h", - ] -} - -ohos_ndk_library("libpasteboard_ndk") { - output_name = "pasteboard" - output_extension = "so" - system_capability = "SystemCapability.MiscServices.Pasteboard" - ndk_description_file = "./libpasteboard.ndk.json" - min_compact_version = "12" - system_capability_headers = [ - "$ndk_headers_out_dir/database/pasteboard/oh_pasteboard.h", - "$ndk_headers_out_dir/database/pasteboard/oh_pasteboard_err_code.h", - ] -} diff --git a/distributeddatamgr/pasteboard/include/oh_pasteboard.h b/distributeddatamgr/pasteboard/include/oh_pasteboard.h deleted file mode 100644 index 7b7affb65..000000000 --- a/distributeddatamgr/pasteboard/include/oh_pasteboard.h +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @addtogroup Pasteboard - * @{ - * - * @brief Provides the copy and paste support for the system Pasteboard. - * You can use the APIs of this module to operate the Pasteboard content of the plain text, HTML, - * URI, Want, pixel map, and other types. - * - * @since 12 - */ - -/** - * @file OH_Pasteboard.h - * - * @brief Provides APIs and enums of the Pasteboard module. - * - * @kit BasicServicesKit - * @library libpasteboard_ndk.so - * @syscap SystemCapability.MiscServices.Pasteboard - * - * @since 12 - */ - -#ifndef OH_PASTEBOARD_H -#define OH_PASTEBOARD_H - -#include -#include -#include "udmf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Enumerates the types of data changes that can be observed. - * - * @since 12 - */ -typedef enum Pasteboard_SubscribeType { - /** - * @brief Change of the Pasteboard data in the local device. - */ - PASTEBOARD_SUBSCRIBE_TYPE_LOCAL = 1, - /** - * @brief Change of the Pasteboard data in the remote devices. - */ - PASTEBOARD_SUBSCRIBE_TYPE_REMOTE = 2 -} Pasteboard_SubscribeType; - -/** - * @brief Defines the callback function used to return the Pasteboard data changed. - * - * @param context The context set by {@link OH_PasteboardSubscriber_SetContext} function. - * @param type The types of data changes. For details, see {@link Pasteboard_SubscribeType}. - * @since 12 - */ -typedef void (*Pasteboard_SubscribeCallback)(void* context, Pasteboard_SubscribeType type); - -/** - * @brief Defines the Pasteboard subscriber information - * - * @since 12 - */ -typedef struct OH_PasteboardSubscriber OH_PasteboardSubscriber; - -/** - * @brief Creates a {@link OH_PasteboardSubscriber} instance. - * - * @return Returns the pointer to the {@link OH_PasteboardSubscriber} instance created if the operation is successful. - * Returns nullptr if the operation is failed. - * @see OH_PasteboardSubscriber. - * @since 12 - */ -OH_PasteboardSubscriber* OH_PasteboardSubscriber_Create(); - -/** - * @brief Destroy a {@link OH_PasteboardSubscriber} instance. - * - * @param subscriber Pointer to the {@link OH_PasteboardSubscriber} instance to destroy. - * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. - * Returns {@link ERR_OK} if the operation is successful. - * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. - * @see OH_PasteboardSubscriber PASTEBOARD_ErrCode. - * @since 12 - */ -int OH_PasteboardSubscriber_Destroy(OH_PasteboardSubscriber* subscriber); - -/** - * @brief Sets a callback function to return the Pasteboard data changed. - * - * @param subscriber Pointer to the {@link OH_PasteboardSubscriber} instance. - * @param callback Callback to set. For details, see {@link Pasteboard_SubscribeCallback}. - * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. - * Returns {@link ERR_OK} if the operation is successful. - * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. - * @see OH_PasteboardSubscriber Pasteboard_SubscribeCallback PASTEBOARD_ErrCode. - * @since 12 - */ -int OH_PasteboardSubscriber_SetCallback(OH_PasteboardSubscriber* subscriber, const Pasteboard_SubscribeCallback callback); - -/** - * @brief Obtains the callback used to return the Pasteboard data changed. - * - * @param subscriber Pointer to the {@link OH_PasteboardSubscriber} instance. - * @param callback Pointer to the {@link Pasteboard_SubscribeCallback} instance to obtain. - * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. - * Returns {@link ERR_OK} if the operation is successful. - * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. - * @see OH_PasteboardSubscriber Pasteboard_SubscribeCallback PASTEBOARD_ErrCode. - * @since 12 - */ -int OH_PasteboardSubscriber_GetCallback(OH_PasteboardSubscriber* subscriber, Pasteboard_SubscribeCallback* callback); - -/** - * @brief Sets a context instance, which is the first parameter in Pasteboard_SubscribeCallback. - * - * @param subscriber Pointer to the {@link OH_PasteboardSubscriber} instance. - * @param context Pointer to the context set. - * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. - * Returns {@link ERR_OK} if the operation is successful. - * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. - * @see OH_PasteboardSubscriber PASTEBOARD_ErrCode. - * @since 12 - */ -int OH_PasteboardSubscriber_SetContext(OH_PasteboardSubscriber* subscriber, void* context); - -/** - * @brief Obtains the context, which is the first parameter in Pasteboard_SubscribeCallback. - * - * @param subscriber Pointer to the {@link OH_PasteboardSubscriber} instance. - * @param context Pointer to the context to obtain. - * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. - * Returns {@link ERR_OK} if the operation is successful. - * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. - * @see OH_PasteboardSubscriber PASTEBOARD_ErrCode. - * @since 12 - */ -int OH_PasteboardSubscriber_GetContext(OH_PasteboardSubscriber* subscriber, void** context); - -/** - * @brief Represents the Pasteboard information. - * - * @since 12 - */ -typedef struct OH_Pasteboard OH_Pasteboard; - -/** - * @brief Creates a {@link OH_Pasteboard} instance. - * - * @return Returns the pointer to the {@link OH_Pasteboard} instance created if the operation is successful. - * Returns nullptr if the operation is failed. - * @see OH_Pasteboard. - * @since 12 - */ -OH_Pasteboard* OH_Pasteboard_Create(); - -/** - * @brief Destroy a {@link OH_Pasteboard} instance. - * - * @param pasteboard Pointer to the {@link OH_Pasteboard} instance to destroy. - * @see OH_Pasteboard. - * @since 12 - */ -void OH_Pasteboard_Destroy(OH_Pasteboard* pasteboard); - -/** - * @brief Subscribes to the Pasteboard data change. - * - * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. - * @param type Event type to subscribe to. - * @param subscriber - Pointer to the subscriber information, which specifies the callback used to - * reporting the pasteboard data change. For details, see {@link OH_PasteboardSubscriber}. - * @return Returns the status code of the execution. For details, {@link PASTEBOARD_ErrCode}. - * Returns {@link ERR_OK} if the operation is successful. - * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. - * @see OH_Pasteboard OH_PasteboardSubscriber PASTEBOARD_ErrCode. - * @since 12 - */ -int OH_Pasteboard_Subscribe(OH_Pasteboard* pasteboard, int type, const OH_PasteboardSubscriber* subscriber); - -/** - * @brief Unsubscribes from the Pasteboard data change. - * - * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. - * @param type Event type to subscribe to. - * @param subscriber - Pointer to the subscriber information, which specifies the callback used to - * reporting the pasteboard data change. For details, see {@link OH_PasteboardSubscriber}. - * @return Returns the status code of the execution. For details, {@link PASTEBOARD_ErrCode}. - * Returns {@link ERR_OK} if the operation is successful. - * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. - * @see OH_Pasteboard OH_PasteboardSubscriber PASTEBOARD_ErrCode. - * @since 12 - */ -int OH_Pasteboard_Unsubscribe(OH_Pasteboard* pasteboard, int type, const OH_PasteboardSubscriber* subscriber); - -/** - * @brief Checks whether the Pasteboard data is from a remote device. - * - * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. - * @return Returns a boolean value, which indicates whether the the data is from a remote device. - * The value {@code false} means Pasteboard data is not from a remote device. - * The value {@code true} means the opposite. - * @see OH_Pasteboard. - * @since 12 - */ -bool OH_Pasteboard_IsRemoteData(OH_Pasteboard* pasteboard); - -/** - * @brief Obtains the source of Pasteboard data. - * - * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. - * @param source Pointer to the source data. - * @param len Length of the source data. - * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. - * Returns {@link ERR_OK} if the operation is successful. - * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. - * @see OH_Pasteboard PASTEBOARD_ErrCode. - * @since 12 - */ -int OH_Pasteboard_GetDataSource(OH_Pasteboard* pasteboard, char* source, unsigned int len); - -/** - * @brief Checks whether the Pasteboard has the specified type of data. - * - * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. - * @param type Poniter to the type of data to check. - * @return Returns a boolean value, which indicates whether the Pasteboard has the specified type of data. - * The value {@code true} means the Pasteboard has the specified type of data. - * The value {@code false} means the opposite. - * @see OH_Pasteboard. - * @since 12 - */ -bool OH_Pasteboard_HasType(OH_Pasteboard* pasteboard, const char* type); - -/** - * @brief Checks whether there is data in the Pasteboard. - * - * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. - * @return Returns a boolean value, which indicates whether there is data in the Pasteboard. - * The value {@code true} means there is data in Pasteboard. - * The value {@code false} means the opposite. - * @see OH_Pasteboard. - * @since 12 - */ -bool OH_Pasteboard_HasData(OH_Pasteboard* pasteboard); - -/** - * @brief Obtains data from the Pasteboard. - * - * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. - * @param data Pointer to the {@link OH_UdmfData} instance. - * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. - * Returns {@link ERR_OK} if the operation is successful. - * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. - * @see OH_Pasteboard OH_UdmfData PASTEBOARD_ErrCode. - * @since 12 - */ -int OH_Pasteboard_GetData(OH_Pasteboard* pasteboard, OH_UdmfData* data); - -/** - * @brief Writes data to the Pasteboard. - * - * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. - * @param data Pointer to the {@link OH_UdmfData} instance. - * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. - * Returns {@link ERR_OK} if the operation is successful. - * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. - * @see OH_Pasteboard OH_UdmfData PASTEBOARD_ErrCode. - * @since 12 - */ -int OH_Pasteboard_SetData(OH_Pasteboard* pasteboard, OH_UdmfData* data); - -/** - * @brief Clears the data in the Pastedboard. - * - * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. - * @return Returns the status code of the execution. For details, see {@link PASTEBOARD_ErrCode}. - * Returns {@link ERR_OK} if the operation is successful. - * Returns {@link ERR_INVALID_PARAMETER} if invalid args are detected. - * @see OH_Pasteboard PASTEBOARD_ErrCode. - * @since 12 - */ -int OH_Pasteboard_ClearData(OH_Pasteboard* pasteboard); -#ifdef __cplusplus -}; -#endif - -/** @} */ -#endif \ No newline at end of file diff --git a/distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h b/distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h deleted file mode 100644 index 0251eb05d..000000000 --- a/distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @addtogroup Pasteboard - * @{ - * - * @brief Provides the copy and paste support for the system Pasteboard. - * You can use the APIs of this module to operate the Pasteboard content of the plain text, HTML, - * URI, Want, pixel map, and other types. - * - * @since 12 - */ - -/** - * @file oh_pasteboard_err_code.h - * - * @brief Declaration error code information. - * - * @kit BasicServicesKit - * @library libpasteboard_ndk.so - * @syscap SystemCapability.MiscServices.Pasteboard - * - * @since 12 - */ - - -#ifndef OH_PASTEBOARD_ERR_CODE_H -#define OH_PASTEBOARD_ERR_CODE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Enumerates the error codes. - * - * @since 12 - */ -typedef enum PASTEBOARD_ErrCode { - /** - * The operation is successful. - */ - ERR_OK = 0, - /** - * Permission verification failed. - */ - ERR_PERMISSION_ERROR = 201, - /** - * Invalid parameter is detected. - */ - ERR_INVALID_PARAMETER = 401, - /** - * The capability is not supported. - */ - ERR_DEVICE_NOT_SUPPORTED = 801, - -} PASTEBOARD_ErrCode; - -#ifdef __cplusplus -}; -#endif - -/** @} */ -#endif diff --git a/distributeddatamgr/pasteboard/libpasteboard.ndk.json b/distributeddatamgr/pasteboard/libpasteboard.ndk.json deleted file mode 100644 index 60631cdb2..000000000 --- a/distributeddatamgr/pasteboard/libpasteboard.ndk.json +++ /dev/null @@ -1,62 +0,0 @@ -[ - { - "first_introduced": "12", - "name": "OH_PasteBoardSubcriber_Create" - }, - { - "first_introduced": "12", - "name": "OH_PasteBoardSubcriber_Destroy" - }, - { - "first_introduced": "12", - "name": "OH_PasteBoardSubcriber_SetCallback" - }, - { - "first_introduced": "12", - "name": "OH_PasteBoardSubcriber_GetCallback" - }, - { - "first_introduced": "12", - "name": "OH_PasteBoard_Create" - }, - { - "first_introduced": "12", - "name": "OH_PasteBoard_Destroy" - }, - { - "first_introduced": "12", - "name": "OH_PasteBoard_Subcribe" - }, - { - "first_introduced": "12", - "name": "OH_PasteBoard_Unsubcribe" - }, - { - "first_introduced": "12", - "name": "OH_PasteBoard_IsRemoteData" - }, - { - "first_introduced": "12", - "name": "OH_PasteBoard_GetDataSrouce" - }, - { - "first_introduced": "12", - "name": "OH_PasteBoard_HasType" - }, - { - "first_introduced": "12", - "name": "OH_PasteBoard_HasData" - }, - { - "first_introduced": "12", - "name": "OH_PasteBoard_GetData" - }, - { - "first_introduced": "12", - "name": "OH_PasteBoard_SetData" - }, - { - "first_introduced": "12", - "name": "OH_PasteBoard_ClearData" - } -] \ No newline at end of file diff --git a/distributeddatamgr/udmf/include/udmf.h b/distributeddatamgr/udmf/include/udmf.h index 6b06f5fb7..a4aa27ac6 100644 --- a/distributeddatamgr/udmf/include/udmf.h +++ b/distributeddatamgr/udmf/include/udmf.h @@ -104,6 +104,13 @@ typedef struct OH_UdmfData OH_UdmfData; */ typedef struct OH_UdmfRecord OH_UdmfRecord; +/** + * @brief Defines the data provider. + * + * @since 13 + */ +typedef struct OH_UdmfRecordProvider OH_UdmfRecordProvider; + /** * @brief Describes some property parameters of unified data. * @@ -179,6 +186,62 @@ char** OH_UdmfData_GetTypes(OH_UdmfData* pThis, unsigned int* count); */ OH_UdmfRecord** OH_UdmfData_GetRecords(OH_UdmfData* pThis, unsigned int* count); +/** + * @brief Defines the callback function used free the context. + * @param context Pointer to the context which is to be free. + * @since 13 + */ +typedef void (*UdmfData_Finalize)(void* context); + +/** + * @brief Creates an {@link OH_UdmfRecordProvider} instance. + * + * @return Returns the pointer to the {@link OH_UdmfRecordProvider} instance created if the operation is successful. + * Returns nullptr if the memory is not enough. + * @see OH_UdmfRecordProvider. + * @since 13 + */ +OH_UdmfRecordProvider* OH_UdmfRecordProvider_Create(); + +/** + * @brief Destroy an {@link OH_UdmfRecordProvider} instance. + * + * @param subscriber Pointer to the {@link OH_UdmfRecordProvider} instance to destroy. + * @return Returns the status code of the execution. For details, see {@link Udmf_ErrCode}. + * Returns {@link UDMF_E_OK} if the operation is successful. + * Returns {@link UDMF_E_INVALID_PARAM} if invalid args are detected. + * @see OH_UdmfRecordProvider Udmf_ErrCode. + * @since 13 + */ +int OH_UdmfRecordProvider_Destroy(OH_UdmfRecordProvider* provider); + +/** + * @brief Defines a callback function used to obtain data by type. + * + * @param context Pointer to the context set by {@link OH_UdmfRecordProvider_SetData}. + * @param type Pointer to the type of data to obtain. For details, see {@link udmf_meta.h}. + * @return Returns the data content. + * @since 13 + */ +typedef void* (*OH_UdmfRecordProvider_GetData)(void* context, const char* type); + +/** + * @brief Sets a callback function to obtain data. + * + * @param provider Pointer to the {@link OH_UdmfRecordProvider} instance. + * @param context Pointer to the context set, which is the first parameter in OH_UdmfRecordProvider_GetData. + * @param callback Callback to set. For details, see {@link OH_UdmfRecordProvider_GetData}. + * @param finalize Optional callback that can free context when destroy provider. + * For details, see {@link UdmfData_Finalize}. + * @return Returns the status code of the execution. For details, see {@link Udmf_ErrCode}. + * Returns {@link UDMF_E_OK} if the operation is successful. + * Returns {@link UDMF_E_INVALID_PARAM} if invalid args are detected. + * @see OH_UdmfRecordProvider OH_UdmfRecordProvider_GetData UdmfData_Finalize Udmf_ErrCode. + * @since 13 + */ +int OH_UdmfRecordProvider_SetData(OH_UdmfRecordProvider* provider, void* context, + const OH_UdmfRecordProvider_GetData callback, const UdmfData_Finalize finalize); + /** * @brief Creation a pointer to the instance of the {@link OH_UdmfRecord}, it's relate with UDS data. * @@ -345,6 +408,22 @@ int OH_UdmfRecord_GetHtml(OH_UdmfRecord* pThis, OH_UdsHtml* html); */ int OH_UdmfRecord_GetAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem); +/** + * @brief Set the data provider of the types. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @param types Represents a pointer to a group of data types; + * @param count Represents the number of data types; + * @param provider Represents a pointer an instance of {@link OH_UdmfRecordProvider}. + * @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_UdmfRecordProvider Udmf_ErrCode. + * @since 13 + */ +int OH_UdmfRecord_SetProvider(OH_UdmfRecord* pThis, const char* const* types, unsigned int count, + OH_UdmfRecordProvider* provider); + /** * @brief Creation a pointer to the instance of the {@link OH_UdmfProperty} * from a {@link OH_UdmfData} data. -- Gitee From 3c59a7e5352c3495381b0a0109a25af191d512ee Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Thu, 29 Aug 2024 10:19:55 +0000 Subject: [PATCH 191/620] 1 Signed-off-by: hellohyh001 --- multimodalinput/kits/c/input/oh_input_manager.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 98d9c5f6c..71b7fd585 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -229,7 +229,7 @@ typedef enum Input_Result { } Input_Result; /** 设备类型未知 */ -static const char* const Input_Device_Type_UNKNOWN = "ohos.input.device.unknown"; +static const char* const Input_Device_Type_KEYBOARD = "ohos.input.device.unkown"; /** 设备类型键盘 */ static const char* const Input_Device_Type_KEYBOARD = "ohos.input.device.keyboard"; @@ -283,15 +283,17 @@ typedef void (*Input_AxisEventCallback)(const Input_AxisEvent* axisEvent); /** * @brief 定义一个回调函数用于设备id和设备类型 + * 如果回调被触发,**deviceTypes**将被销毁。 * @since 13 */ -typedef void (*Input_DeviceAddedCallback)(int32_t deviceId, const char* deviceType); +typedef void (*Input_DeviceAddedCallback)(int32_t deviceId, const char** deviceTypes, int32_t count); /** * @brief 定义一个回调函数用于设备id和设备类型 + * 如果回调被触发,**deviceTypes**将被销毁。 * @since 13 */ -typedef void (*Input_DeviceRemovedCallback)(int32_t deviceId, const char* deviceType); +typedef void (*Input_DeviceRemovedCallback)(int32_t deviceId, const char** deviceTypes, int32_t count); /** * @brief Defines the structure for the interceptor of event callbacks, @@ -315,7 +317,7 @@ typedef struct Input_InterceptorEventCallback { typedef struct Input_DeviceListener { Input_DeviceAddedCallback OnDeviceAdded; Input_DeviceRemovedCallback OnDeviceRemoved; -}; +} Input_DeviceListener; /** * @brief Defines event interceptor options. -- Gitee From 08072f1a6e67c57f94e619cbb1223039b14e608c Mon Sep 17 00:00:00 2001 From: cuiruibin Date: Thu, 22 Aug 2024 16:34:23 +0800 Subject: [PATCH 192/620] =?UTF-8?q?=E6=96=B0=E5=A2=9ENDK=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0=20Signed?= =?UTF-8?q?-off-by:=20cuiruibin=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- filemanagement/file_uri/include/oh_file_uri.h | 20 +++++++++++++++++++ .../file_uri/liboh_file_uri.ndk.json | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/filemanagement/file_uri/include/oh_file_uri.h b/filemanagement/file_uri/include/oh_file_uri.h index e7805faf8..adf9f0fa3 100644 --- a/filemanagement/file_uri/include/oh_file_uri.h +++ b/filemanagement/file_uri/include/oh_file_uri.h @@ -21,6 +21,10 @@ * @kit CoreFileKit * * @brief uri verification and conversion + * This class is mainly for URI format verification and URI conversion processing; + * The conversion and operation of the media library type URI is not supported, + * and the class only converts according to the existing specifications, + * and there is no guarantee that the conversion result will actually exist. * @library libohfileuri.so * @syscap SystemCapability.FileManagement.AppFileService * @since 12 @@ -93,6 +97,22 @@ FileManagement_ErrCode OH_FileUri_GetFullDirectoryUri(const char *uri, unsigned * @since 12 */ bool OH_FileUri_IsValidUri(const char *uri, unsigned int length); + +/** +* @brief Gets the fileName From uri. +* This function obtains that the last segment of the URI string is the return value of the function, +* and the URI of the media type is not supported +* @param uri Input a pointer to the uri string. +* @param length The length of the input uri. +* @param result Output a pointer to a FileName string. Please use free() to clear the resource. +* @return Returns the status code of the execution. +* {@link ERR_PARAMS} 401 - Invalid input parameter. +* {@link ERR_ENOMEM} 13900011 - Failed to apply for memory or failed to copy memory. +* {@link ERR_OK} 0 - This operation was successfully executed. +* @syscap SystemCapability.FileManagement.AppFileService +* @since 13 + */ +FileManagement_ErrCode OH_FileUri_GetFileName(const char *uri, unsigned int length, char **result); #ifdef __cplusplus }; #endif diff --git a/filemanagement/file_uri/liboh_file_uri.ndk.json b/filemanagement/file_uri/liboh_file_uri.ndk.json index 776c160a8..d17efcd7a 100644 --- a/filemanagement/file_uri/liboh_file_uri.ndk.json +++ b/filemanagement/file_uri/liboh_file_uri.ndk.json @@ -13,5 +13,9 @@ { "first_introduced": "12", "name":"OH_FileUri_IsValidUri" + }, + { + "first_introduced": "13", + "name":"OH_FileUri_GetFileName" } ] \ No newline at end of file -- Gitee From c39bc96a5ae38cbd975118a244123285176d7a3c Mon Sep 17 00:00:00 2001 From: lizhuojun Date: Tue, 23 Jul 2024 21:57:29 +0800 Subject: [PATCH 193/620] add new define Signed-off-by: lizhuojun --- distributeddatamgr/udmf/include/udmf.h | 61 ++++++++-- .../udmf/include/udmf_err_code.h | 10 +- distributeddatamgr/udmf/include/udmf_meta.h | 7 ++ distributeddatamgr/udmf/include/uds.h | 108 ++++-------------- 4 files changed, 94 insertions(+), 92 deletions(-) diff --git a/distributeddatamgr/udmf/include/udmf.h b/distributeddatamgr/udmf/include/udmf.h index 13a59f825..c7b586bbc 100644 --- a/distributeddatamgr/udmf/include/udmf.h +++ b/distributeddatamgr/udmf/include/udmf.h @@ -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 */ diff --git a/distributeddatamgr/udmf/include/udmf_err_code.h b/distributeddatamgr/udmf/include/udmf_err_code.h index 105191c7c..4a479bdc6 100644 --- a/distributeddatamgr/udmf/include/udmf_err_code.h +++ b/distributeddatamgr/udmf/include/udmf_err_code.h @@ -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 diff --git a/distributeddatamgr/udmf/include/udmf_meta.h b/distributeddatamgr/udmf/include/udmf_meta.h index 17990eebc..25b31bf80 100644 --- a/distributeddatamgr/udmf/include/udmf_meta.h +++ b/distributeddatamgr/udmf/include/udmf_meta.h @@ -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 diff --git a/distributeddatamgr/udmf/include/uds.h b/distributeddatamgr/udmf/include/uds.h index 8ed0845d9..398602810 100644 --- a/distributeddatamgr/udmf/include/uds.h +++ b/distributeddatamgr/udmf/include/uds.h @@ -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 }; -- Gitee From d6fa9223746f3243786e1b042627cd2144ad148e Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Fri, 30 Aug 2024 02:08:58 +0000 Subject: [PATCH 194/620] 11 Signed-off-by: hellohyh001 --- multimodalinput/kits/c/input/oh_input_manager.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 71b7fd585..312db6f78 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -311,7 +311,6 @@ typedef struct Input_InterceptorEventCallback { /** * @brief 定义一个结构体用于监听设备设插拔 - * 包含了 addedCallback, removedCallback * @since 13 */ typedef struct Input_DeviceListener { @@ -1260,12 +1259,12 @@ const char* OH_Input_KeyCodeToString(int32_t keyCode); /** * @brief 注册设备热插拔的监听器 * - * @param listener 用于监听设备热插拔的监听器. + * @param listener 指向监听设备热插拔的监听器的指针. * - * @return OH_Input_RegisterDeviceListener status code, specifically, - * {@link INPUT_SUCCESS} if the operation is successful;\n + * @return OH_Input_RegisterDeviceListener 的返回值, 具体如下: + * {@link INPUT_SUCCESS} 调用成功;\n * {@link INPUT_PARAMETER_ERROR} listener 为NULL 或 listener 已被注册 - * {@link INPUT_SERVICE_EXCEPTION} 服务端连接异常 + * {@link INPUT_SERVICE_EXCEPTION} 由于服务异常调用失败 * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ @@ -1274,12 +1273,12 @@ Input_Result OH_Input_RegisterDeviceListener(Input_DeviceListener* listener); /** * @brief 取消注册设备热插拔的监听器 * - * @param listener 用于监听设备热插拔的监听器. + * @param listener 指向监听设备热插拔的监听器的指针. * - * @return OH_Input_UnregisterDeviceListener status code, specifically, - * {@link INPUT_SUCCESS} if the operation is successful;\n + * @return OH_Input_UnregisterDeviceListener 的返回值, 具体如下: + * {@link INPUT_SUCCESS} 调用成功;\n * {@link INPUT_PARAMETER_ERROR} listener 为 NULL, listener 未注册或已被取消注册 - * {@link INPUT_SERVICE_EXCEPTION} 服务端连接异常 + * {@link INPUT_SERVICE_EXCEPTION} 由于服务异常调用失败 * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ -- Gitee From e5692fcd0f607f92615076831458ece982d030db Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Fri, 30 Aug 2024 02:43:53 +0000 Subject: [PATCH 195/620] 11 Signed-off-by: hellohyh001 --- .../kits/c/input/oh_input_manager.h | 88 +++++++++++-------- 1 file changed, 53 insertions(+), 35 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 312db6f78..8027c6505 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -228,26 +228,27 @@ typedef enum Input_Result { INPUT_REPEAT_INTERCEPTOR = 4200001 } Input_Result; -/** 设备类型未知 */ -static const char* const Input_Device_Type_KEYBOARD = "ohos.input.device.unkown"; - -/** 设备类型键盘 */ -static const char* const Input_Device_Type_KEYBOARD = "ohos.input.device.keyboard"; - -/** 设备类型鼠标 */ -static const char* const Input_Device_Type_MOUSE = "ohos.input.device.mouse"; - -/** 设备类型触摸板 */ -static const char* const Input_Device_Type_TOUCHPAD = "ohos.input.device.touchpad"; - -/** 设备类型触屏 */ -static const char* const Input_Device_Type_TOUCHSCREEN = "ohos.input.device.touchscreen"; - -/** 设备类型遥感 */ -static const char* const Input_Device_Type_JOYSTICK = "ohos.input.device.joystick"; - -/** 设备类型轨迹球 */ -static const char* const Input_Device_Type_TRACKBALL = "ohos.input.device.trackball"; +/** + * @brief 设备类型的枚举 + * + * @since 13 + */ +typedef enum Input_DeviceType { + /** 设备类型未知 */ + INPUT_DEVICE_TYPE_UNKNOWN = 0, + /** 设备类型键盘 */ + INPUT_DEVICE_TYPE_KEYBOARD, + /** 设备类型鼠标 */ + INPUT_DEVICE_TYPE_MOUSE, + /** 设备类型触摸板 */ + INPUT_DEVICE_TYPE_TOUCHPAD, + /** 设备类型触屏 */ + INPUT_DEVICE_TYPE_TOUCHSCREEN, + /** 设备类型摇杆 */ + INPUT_DEVICE_TYPE_JOYSTICK, + /** 设备类型轨迹球 */ + INPUT_DEVICE_TYPE_TRACKBALL, +} Input_DeviceType; /** * @brief Defines a lifecycle callback for keyEvent. If the callback is triggered, keyEvent will be destroyed. @@ -282,18 +283,22 @@ typedef void (*Input_TouchEventCallback)(const Input_TouchEvent* touchEvent); typedef void (*Input_AxisEventCallback)(const Input_AxisEvent* axisEvent); /** - * @brief 定义一个回调函数用于设备id和设备类型 - * 如果回调被触发,**deviceTypes**将被销毁。 + * @brief 回调函数,用于回调输入设备的上线事件,deviceTypes生命周期为回调函数内,出了回调函数,deviceTypes的内存将会被释放。 + * @param deviceId 设备的id。 + * @param deviceTypes 设备类型的数组。 + * @param count 设备类型数组的大小。 * @since 13 */ -typedef void (*Input_DeviceAddedCallback)(int32_t deviceId, const char** deviceTypes, int32_t count); +typedef void (*Input_DeviceAddedCallback)(int32_t deviceId, int32_t* deviceTypes, int32_t count); /** - * @brief 定义一个回调函数用于设备id和设备类型 - * 如果回调被触发,**deviceTypes**将被销毁。 + * @brief 回调函数,用于回调输入设备的下线事件,deviceTypes生命周期为回调函数内,出了回调函数,deviceTypes的内存将会被释放。 + * @param deviceId 设备的id。 + * @param deviceTypes 设备类型的数组。 + * @param count 设备类型数组的大小。 * @since 13 */ -typedef void (*Input_DeviceRemovedCallback)(int32_t deviceId, const char** deviceTypes, int32_t count); +typedef void (*Input_DeviceRemovedCallback)(int32_t deviceId, int32_t* deviceTypes, int32_t count); /** * @brief Defines the structure for the interceptor of event callbacks, @@ -314,7 +319,9 @@ typedef struct Input_InterceptorEventCallback { * @since 13 */ typedef struct Input_DeviceListener { + /** 定义一个回调函数用于回调设备上线事件 */ Input_DeviceAddedCallback OnDeviceAdded; + /** 定义一个回调函数用于回调设备下线事件 */ Input_DeviceRemovedCallback OnDeviceRemoved; } Input_DeviceListener; @@ -1246,24 +1253,24 @@ Input_Result OH_Input_RemoveKeyEventInterceptor(void); Input_Result OH_Input_RemoveInputEventInterceptor(void); /** - * @brief 按键键值转换成字符串 + * @brief 将按键值{@Link Input_KeyCode}转换为字符串描述 * - * @param keyCode 要转成字符串的按键键值 + * @param keyCode 按键值{@Link Input_KeyCode} - * @return 如果返回一个字符串则表示成功,如果返回NULL则表示失败。 + * @return 成功时返回按键值的字符串描述,失败时返回NULL,可能的原因是传入非法的键值。 * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ -const char* OH_Input_KeyCodeToString(int32_t keyCode); +const char* OH_Input_KeyCodeToString(Input_KeyCode keyCode); /** * @brief 注册设备热插拔的监听器 * - * @param listener 指向监听设备热插拔的监听器的指针. + * @param listener 指向设备热插拔监听器{@Link Input_DeviceListener}的指针. * * @return OH_Input_RegisterDeviceListener 的返回值, 具体如下: * {@link INPUT_SUCCESS} 调用成功;\n - * {@link INPUT_PARAMETER_ERROR} listener 为NULL 或 listener 已被注册 + * {@link INPUT_PARAMETER_ERROR} listener 为NULL * {@link INPUT_SERVICE_EXCEPTION} 由于服务异常调用失败 * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 @@ -1271,18 +1278,29 @@ const char* OH_Input_KeyCodeToString(int32_t keyCode); Input_Result OH_Input_RegisterDeviceListener(Input_DeviceListener* listener); /** - * @brief 取消注册设备热插拔的监听器 + * @brief 取消注册设备热插拔的监听 * - * @param listener 指向监听设备热插拔的监听器的指针. + * @param listener 指向设备热插拔监听器{@Link Input_DeviceListener}的指针. * * @return OH_Input_UnregisterDeviceListener 的返回值, 具体如下: * {@link INPUT_SUCCESS} 调用成功;\n - * {@link INPUT_PARAMETER_ERROR} listener 为 NULL, listener 未注册或已被取消注册 + * {@link INPUT_PARAMETER_ERROR} listener 为 NULL 或者 listener 未被注册 * {@link INPUT_SERVICE_EXCEPTION} 由于服务异常调用失败 * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ Input_Result OH_Input_UnregisterDeviceListener(Input_DeviceListener* listener); + +/** + * @brief 取消注册所有的设备热插拔的监听 + * + * @return OH_Input_UnregisterDeviceListener 的返回值, 具体如下: + * {@link INPUT_SUCCESS} 调用成功;\n + * {@link INPUT_SERVICE_EXCEPTION} 由于服务异常调用失败 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_UnregisterDeviceListener(); #ifdef __cplusplus } #endif -- Gitee From 8e56643132028429b3098a60cc0805ae4024ee2e Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Fri, 30 Aug 2024 06:46:09 +0000 Subject: [PATCH 196/620] 11 Signed-off-by: hellohyh001 --- multimodalinput/kits/c/input/oh_input_manager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index dea52479f..f31311b65 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -327,9 +327,9 @@ typedef struct Input_InterceptorEventCallback { */ typedef struct Input_DeviceListener { /** 定义一个回调函数用于回调设备上线事件 */ - Input_DeviceAddedCallback OnDeviceAdded; + Input_DeviceAddedCallback deviceAddedCallback; /** 定义一个回调函数用于回调设备下线事件 */ - Input_DeviceRemovedCallback OnDeviceRemoved; + Input_DeviceRemovedCallback deviceRemovedCallback; } Input_DeviceListener; /** -- Gitee From e5b613d9ce6f9686005eb718defc95e13fb3e1ff Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Fri, 30 Aug 2024 07:12:34 +0000 Subject: [PATCH 197/620] 111 Signed-off-by: hellohyh001 --- multimodalinput/kits/c/input/oh_input_manager.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index f31311b65..d3dcc9e8c 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -293,19 +293,19 @@ typedef void (*Input_AxisEventCallback)(const Input_AxisEvent* axisEvent); * @brief 回调函数,用于回调输入设备的上线事件,deviceTypes生命周期为回调函数内,出了回调函数,deviceTypes的内存将会被释放。 * @param deviceId 设备的id。 * @param deviceTypes 设备类型的数组。 - * @param count 设备类型数组的大小。 + * @param count 设备类型数组的长度。 * @since 13 */ -typedef void (*Input_DeviceAddedCallback)(int32_t deviceId, int32_t* deviceTypes, int32_t count); +typedef void (*Input_DeviceAddedCallback)(int32_t deviceId, int32_t* deviceTypes, int32_t length); /** * @brief 回调函数,用于回调输入设备的下线事件,deviceTypes生命周期为回调函数内,出了回调函数,deviceTypes的内存将会被释放。 * @param deviceId 设备的id。 * @param deviceTypes 设备类型的数组。 - * @param count 设备类型数组的大小。 + * @param count 设备类型数组的长度。 * @since 13 */ -typedef void (*Input_DeviceRemovedCallback)(int32_t deviceId, int32_t* deviceTypes, int32_t count); +typedef void (*Input_DeviceRemovedCallback)(int32_t deviceId, int32_t* deviceTypes, int32_t length); /** * @brief Defines the structure for the interceptor of event callbacks, -- Gitee From 530d94cefaf9c42ffe3357e794d60b7e27b0ae5f Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Fri, 30 Aug 2024 07:39:08 +0000 Subject: [PATCH 198/620] 111 Signed-off-by: hellohyh001 --- multimodalinput/kits/c/input/oh_input_manager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index d3dcc9e8c..93d2269f9 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -293,7 +293,7 @@ typedef void (*Input_AxisEventCallback)(const Input_AxisEvent* axisEvent); * @brief 回调函数,用于回调输入设备的上线事件,deviceTypes生命周期为回调函数内,出了回调函数,deviceTypes的内存将会被释放。 * @param deviceId 设备的id。 * @param deviceTypes 设备类型的数组。 - * @param count 设备类型数组的长度。 + * @param length 设备类型数组的长度。 * @since 13 */ typedef void (*Input_DeviceAddedCallback)(int32_t deviceId, int32_t* deviceTypes, int32_t length); @@ -302,7 +302,7 @@ typedef void (*Input_DeviceAddedCallback)(int32_t deviceId, int32_t* deviceTypes * @brief 回调函数,用于回调输入设备的下线事件,deviceTypes生命周期为回调函数内,出了回调函数,deviceTypes的内存将会被释放。 * @param deviceId 设备的id。 * @param deviceTypes 设备类型的数组。 - * @param count 设备类型数组的长度。 + * @param length 设备类型数组的长度。 * @since 13 */ typedef void (*Input_DeviceRemovedCallback)(int32_t deviceId, int32_t* deviceTypes, int32_t length); -- Gitee From 964ce5b89ea28b62c10ff6b04811766ea962e9d3 Mon Sep 17 00:00:00 2001 From: lixiangpeng5 Date: Fri, 30 Aug 2024 07:35:44 +0000 Subject: [PATCH 199/620] fix by see Signed-off-by: lixiangpeng5 Change-Id: I18664a4a34ce02d286365943ef424b00685471b7 --- sensors/sensor/oh_sensor_type.h | 46 +++++---------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/sensors/sensor/oh_sensor_type.h b/sensors/sensor/oh_sensor_type.h index 382fb377b..0641a9c0c 100644 --- a/sensors/sensor/oh_sensor_type.h +++ b/sensors/sensor/oh_sensor_type.h @@ -105,7 +105,7 @@ typedef enum Sensor_Type { * Game rotation vector sensor. * @since 13 */ - SENSOR_TYPE_ID_GAME_ROTATION_VECTOR = 262, + SENSOR_TYPE_GAME_ROTATION_VECTOR = 262, /** * Pedometer detection sensor. * @since 11 @@ -344,6 +344,11 @@ int32_t OH_SensorEvent_GetAccuracy(Sensor_Event* sensorEvent, Sensor_Accuracy *a * The value 1 means that the number of detected steps changes. * SENSOR_TYPE_PEDOMETER: data[0], indicating the number of steps a user has walked. * SENSOR_TYPE_HEART_RATE: data[0], indicating the heart rate value. + * SENSOR_TYPE_LINEAR_ACCELERATION: Supported from api version 13. data[0], data[1], and data[2], indicating the + * linear acceleration around the x, y, and z axes of the device, respectively, in m/s2. + * SENSOR_TYPE_GAME_ROTATION_VECTOR: Supported from api version 13. data[0], data[1] and data[2], indicating the + * rotation angles of a device around the x, y, and z axes, respectively, in degree. data[3] indicates the rotation + * vector. * * @param sensorEvent - Pointer to the sensor data information. * @param data - Double pointer to the sensor data. @@ -352,45 +357,6 @@ int32_t OH_SensorEvent_GetAccuracy(Sensor_Event* sensorEvent, Sensor_Accuracy *a * returns an error code defined in {@link Sensor_Result} otherwise. * @since 11 */ -/** - * @brief Obtains sensor data. The data length and content depend on the sensor type. - * The format of the sensor data reported is as follows: - * SENSOR_TYPE_ACCELEROMETER: data[0], data[1], and data[2], indicating the acceleration around - * the x, y, and z axes of the device, respectively, in m/s2. - * SENSOR_TYPE_GYROSCOPE: data[0], data[1], and data[2], indicating the angular velocity of rotation around - * the x, y, and z axes of the device, respectively, in rad/s. - * SENSOR_TYPE_AMBIENT_LIGHT: data[0], indicating the ambient light intensity, in lux. Since api version 12, - * two additional data will be returned, where data[1] indicating the color temperature, in kelvin; data[2] - * indicating the infrared luminance, in cd/m2. - * SENSOR_TYPE_MAGNETIC_FIELD: data[0], data[1], and data[2], indicating the magnetic field strength around - * the x, y, and z axes of the device, respectively, in μT. - * SENSOR_TYPE_BAROMETER: data[0], indicating the atmospheric pressure, in hPa. - * SENSOR_TYPE_HALL: data[0], indicating the opening/closing state of the flip cover. The value 0 means that - * the flip cover is opened, and a value greater than 0 means that the flip cover is closed. - * SENSOR_TYPE_PROXIMITY: data[0], indicates the approaching state. The value 0 means the two objects are close - * to each other, and a value greater than 0 means that they are far away from each other. - * SENSOR_TYPE_ORIENTATION: data[0], data[1], and data[2], indicating the rotation angles of a device around - * the z, x, and y axes, respectively, in degree. - * SENSOR_TYPE_GRAVITY: data[0], data[1], and data[2], indicating the gravitational acceleration around - * the x, y, and z axes of a device, respectively, in m/s2. - * SENSOR_TYPE_ROTATION_VECTOR: data[0], data[1] and data[2], indicating the rotation angles of a device around - * the x, y, and z axes, respectively, in degree. data[3] indicates the rotation vector. - * SENSOR_TYPE_PEDOMETER_DETECTION: data[0], indicating the pedometer detection status. - * The value 1 means that the number of detected steps changes. - * SENSOR_TYPE_PEDOMETER: data[0], indicating the number of steps a user has walked. - * SENSOR_TYPE_HEART_RATE: data[0], indicating the heart rate value. - * SENSOR_TYPE_LINEAR_ACCELERATION: data[0], data[1], and data[2], indicating the acceleration around - * the x, y, and z axes of the device, respectively, in m/s2. - * SENSOR_TYPE_ID_GAME_ROTATION_VECTOR: data[0], data[1] and data[2], indicating the rotation angles of a device around - * the x, y, and z axes, respectively, in degree. data[3] indicates the rotation vector. - * - * @param sensorEvent - Pointer to the sensor data information. - * @param data - Double pointer to the sensor data. - * @param length - Pointer to the array length. - * @return Returns SENSOR_SUCCESS if the operation is successful; - * returns an error code defined in {@link Sensor_Result} otherwise. - * @since 13 - */ int32_t OH_SensorEvent_GetData(Sensor_Event* sensorEvent, float **data, uint32_t *length); /** -- Gitee From 4ce2580da6aa896c6c97e5533b6ecd15ad58422b Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Fri, 30 Aug 2024 16:00:14 +0800 Subject: [PATCH 200/620] add a missing line of comments Signed-off-by: kerongfeng --- multimedia/camera_framework/camera.h | 1 + multimedia/camera_framework/photo_native.h | 1 + multimedia/media_library/media_asset_manager_capi.h | 2 ++ 3 files changed, 4 insertions(+) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 4d519c723..50e6f143b 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -42,6 +42,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/multimedia/camera_framework/photo_native.h b/multimedia/camera_framework/photo_native.h index bb42601a3..f12a68498 100644 --- a/multimedia/camera_framework/photo_native.h +++ b/multimedia/camera_framework/photo_native.h @@ -31,6 +31,7 @@ * @brief Declare the camera photo concepts. * * @library libohcamera.so + * @kit CameraKit * @syscap SystemCapability.Multimedia.Camera.Core * @since 12 * @version 1.0 diff --git a/multimedia/media_library/media_asset_manager_capi.h b/multimedia/media_library/media_asset_manager_capi.h index 73612f5c8..6be1ab5e4 100644 --- a/multimedia/media_library/media_asset_manager_capi.h +++ b/multimedia/media_library/media_asset_manager_capi.h @@ -39,6 +39,8 @@ #ifndef MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ASSET_MANAGER_H #define MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ASSET_MANAGER_H +#include + #include "media_asset_base_capi.h" #ifdef __cplusplus -- Gitee From 0a148b1c23159f0f45f29423de5b0d102ca09e5b Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Fri, 30 Aug 2024 08:10:29 +0000 Subject: [PATCH 201/620] 111 Signed-off-by: hellohyh001 --- multimodalinput/kits/c/input/oh_input_manager.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 93d2269f9..512d8efa9 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -1379,17 +1379,6 @@ void OH_Input_DestroyAllSystemHotkeys(Input_Hotkey **hotkeys, int32_t count); */ Input_Result OH_Input_GetAllSystemHotkeys(Input_Hotkey **hotkey, int32_t *count); -/** - * @brief 将按键值{@Link Input_KeyCode}转换为字符串描述 - * - * @param keyCode 按键值{@Link Input_KeyCode} - - * @return 成功时返回按键值的字符串描述,失败时返回NULL,可能的原因是传入非法的键值。 - * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 - */ -const char* OH_Input_KeyCodeToString(Input_KeyCode keyCode); - /** * @brief 注册设备热插拔的监听器 * -- Gitee From b8fb344349cc8b48a4f49eab89a85b7c29d9e5fe Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Fri, 30 Aug 2024 09:56:02 +0000 Subject: [PATCH 202/620] 111 Signed-off-by: hellohyh001 --- .../kits/c/input/oh_input_manager.h | 38 ++++--------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 512d8efa9..7a606765d 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -235,28 +235,6 @@ typedef enum Input_Result { INPUT_REPEAT_INTERCEPTOR = 4200001 } Input_Result; -/** - * @brief 设备类型的枚举 - * - * @since 13 - */ -typedef enum Input_DeviceType { - /** 设备类型未知 */ - INPUT_DEVICE_TYPE_UNKNOWN = 0, - /** 设备类型键盘 */ - INPUT_DEVICE_TYPE_KEYBOARD, - /** 设备类型鼠标 */ - INPUT_DEVICE_TYPE_MOUSE, - /** 设备类型触摸板 */ - INPUT_DEVICE_TYPE_TOUCHPAD, - /** 设备类型触屏 */ - INPUT_DEVICE_TYPE_TOUCHSCREEN, - /** 设备类型摇杆 */ - INPUT_DEVICE_TYPE_JOYSTICK, - /** 设备类型轨迹球 */ - INPUT_DEVICE_TYPE_TRACKBALL, -} Input_DeviceType; - /** * @brief Defines a lifecycle callback for keyEvent. If the callback is triggered, keyEvent will be destroyed. * @@ -290,22 +268,20 @@ typedef void (*Input_TouchEventCallback)(const Input_TouchEvent* touchEvent); typedef void (*Input_AxisEventCallback)(const Input_AxisEvent* axisEvent); /** - * @brief 回调函数,用于回调输入设备的上线事件,deviceTypes生命周期为回调函数内,出了回调函数,deviceTypes的内存将会被释放。 + * @brief 回调函数,用于回调输入设备的上线事件。 * @param deviceId 设备的id。 - * @param deviceTypes 设备类型的数组。 - * @param length 设备类型数组的长度。 + * @param type 有关输入设备的能力信息,比如设备是触摸屏、触控板、键盘等; * @since 13 */ -typedef void (*Input_DeviceAddedCallback)(int32_t deviceId, int32_t* deviceTypes, int32_t length); +typedef void (*Input_DeviceAddedCallback)(int32_t deviceId, int32_t type); /** - * @brief 回调函数,用于回调输入设备的下线事件,deviceTypes生命周期为回调函数内,出了回调函数,deviceTypes的内存将会被释放。 + * @brief 回调函数,用于回调输入设备的下线事件。 * @param deviceId 设备的id。 - * @param deviceTypes 设备类型的数组。 - * @param length 设备类型数组的长度。 + * @param type 有关输入设备的能力信息,比如设备是触摸屏、触控板、键盘等; * @since 13 */ -typedef void (*Input_DeviceRemovedCallback)(int32_t deviceId, int32_t* deviceTypes, int32_t length); +typedef void (*Input_DeviceRemovedCallback)(int32_t deviceId, int32_t type); /** * @brief Defines the structure for the interceptor of event callbacks, @@ -1416,7 +1392,7 @@ Input_Result OH_Input_UnregisterDeviceListener(Input_DeviceListener* listener); * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ -Input_Result OH_Input_UnregisterDeviceListener(); +Input_Result OH_Input_UnregisterDeviceListeners(); #ifdef __cplusplus } #endif -- Gitee From e7e741789e423a145bda7dc57a9c6f57a66be311 Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Fri, 30 Aug 2024 12:48:41 +0000 Subject: [PATCH 203/620] 111 Signed-off-by: hellohyh001 --- multimodalinput/kits/c/input/oh_input_manager.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 7a606765d..c697bc1aa 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -278,10 +278,9 @@ typedef void (*Input_DeviceAddedCallback)(int32_t deviceId, int32_t type); /** * @brief 回调函数,用于回调输入设备的下线事件。 * @param deviceId 设备的id。 - * @param type 有关输入设备的能力信息,比如设备是触摸屏、触控板、键盘等; * @since 13 */ -typedef void (*Input_DeviceRemovedCallback)(int32_t deviceId, int32_t type); +typedef void (*Input_DeviceRemovedCallback)(int32_t deviceId); /** * @brief Defines the structure for the interceptor of event callbacks, -- Gitee From 3d0795e2b828676109549f270a182466d3ac6a09 Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Fri, 30 Aug 2024 12:54:34 +0000 Subject: [PATCH 204/620] 111 Signed-off-by: hellohyh001 --- multimodalinput/kits/c/input/oh_input_manager.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index c697bc1aa..420b65c3d 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -270,10 +270,9 @@ typedef void (*Input_AxisEventCallback)(const Input_AxisEvent* axisEvent); /** * @brief 回调函数,用于回调输入设备的上线事件。 * @param deviceId 设备的id。 - * @param type 有关输入设备的能力信息,比如设备是触摸屏、触控板、键盘等; * @since 13 */ -typedef void (*Input_DeviceAddedCallback)(int32_t deviceId, int32_t type); +typedef void (*Input_DeviceAddedCallback)(int32_t deviceId); /** * @brief 回调函数,用于回调输入设备的下线事件。 -- Gitee From f03d8ae68e2bbe7dd44bfd4f8e8b8793adb8e2bb Mon Sep 17 00:00:00 2001 From: cuile4 Date: Thu, 29 Aug 2024 11:36:16 +0800 Subject: [PATCH 205/620] Add ndk interface of udmf. Signed-off-by: huangxiyong Signed-off-by: cuile4 --- distributeddatamgr/udmf/include/udmf.h | 87 ++++++++++++++++++++++++++ distributeddatamgr/udmf/include/uds.h | 57 +++++++++++++++++ 2 files changed, 144 insertions(+) diff --git a/distributeddatamgr/udmf/include/udmf.h b/distributeddatamgr/udmf/include/udmf.h index 6304de3e7..4f66e884f 100644 --- a/distributeddatamgr/udmf/include/udmf.h +++ b/distributeddatamgr/udmf/include/udmf.h @@ -265,6 +265,20 @@ int OH_UdmfRecord_AddHtml(OH_UdmfRecord* pThis, OH_UdsHtml* html); */ int OH_UdmfRecord_AddAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem); +/** + * @brief Add one {@link OH_UdsArrayBuffer} data to the {@link OH_UdmfRecord} record. + * + * @param record Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @param type Represents record type, reference udmf_meta.h. + * @param buffer Represents a pointer to an instance of {@link OH_UdsArrayBuffer}. + * @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_UdsArrayBuffer Udmf_ErrCode. + * @since 13 + */ +int OH_UdmfRecord_AddArrayBuffer(OH_UdmfRecord* record, const char* type, OH_UdsArrayBuffer* buffer); + /** * @brief Get all types in the {@link OH_UdmfRecord} record. * @@ -350,6 +364,79 @@ int OH_UdmfRecord_GetHtml(OH_UdmfRecord* pThis, OH_UdsHtml* html); */ int OH_UdmfRecord_GetAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem); +/** + * @brief Get one {@link OH_UdsArrayBuffer} data from the {@link OH_UdmfRecord} record. + * + * @param record Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @param type Represents record type, reference udmf_meta.h. + * @param buffer Represents a pointer to an instance of {@link OH_UdsArrayBuffer}. + * @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_UdsArrayBuffer Udmf_ErrCode. + * @since 13 + */ +int OH_UdmfRecord_GetArrayBuffer(OH_UdmfRecord* record, const char* type, OH_UdsArrayBuffer* buffer); + +/** + * @brief Get primary {@link OH_UdsPlainText} data from the {@link OH_UdmfData}. + * + * @param data Represents a pointer to an instance of {@link OH_UdmfData}. + * @param plainText Represents a pointer to an instance of {@link OH_UdsPlainText}. + * @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_UdmfData OH_UdsPlainText Udmf_ErrCode. + * @since 13 + */ +int OH_UdmfData_GetPrimaryPlainText(OH_UdmfData* data, OH_UdsPlainText* plainText); + +/** + * @brief Get one {@link OH_UdsHtml} data from the {@link OH_UdmfData}. + * + * @param data Represents a pointer to an instance of {@link OH_UdmfData}. + * @param html Represents a pointer to an instance of {@link OH_UdsHtml}. + * @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_UdmfData OH_UdsHtml Udmf_ErrCode. + * @since 13 + */ +int OH_UdmfData_GetPrimaryHtml(OH_UdmfData* data, OH_UdsHtml* html); + +/** + * @brief Get the count of {@link OH_UdmfRecord} in the {@link OH_UdmfData}. + * + * @param data Represents a pointer to an instance of {@link OH_UdmfData}. + * @return Returns the count of {@link OH_UdmfRecord} + * @see OH_UdmfData. + * @since 13 + */ +int OH_UdmfData_GetRecordCount(OH_UdmfData* data); + +/** + * @brief Get the record of the specified index from the {@link OH_UdmfData}. + * + * @param data Represents a pointer to an instance of {@link OH_UdmfData}. + * @param index Represents the index of {@link OH_UdmfRecord} in the {@link OH_UdmfData}. + * @return Returns {@link OH_UdmfRecord} pointer when input parameters valid, otherwise return nullptr. + * @see OH_UdmfData. + * @since 13 + */ +OH_UdmfRecord* OH_UdmfData_GetRecord(OH_UdmfData* data, unsigned int index); + +/** + * @brief Checks whether the UDMF data is from a local device. + * + * @param data Represents a pointer to an instance of {@link OH_UdmfData}. + * @return Returns a boolean value, which indicates whether the UDMF data is from a local device. + * The value {@code true} means the data is from a local device. + * The value {@code false} means the opposite. + * @see OH_UdmfData. + * @since 13 + */ +bool OH_UdmfData_IsLocal(OH_UdmfData* data); + /** * @brief Creation a pointer to the instance of the {@link OH_UdmfProperty} * from a {@link OH_UdmfData} data. diff --git a/distributeddatamgr/udmf/include/uds.h b/distributeddatamgr/udmf/include/uds.h index 54c122b22..2443c394e 100644 --- a/distributeddatamgr/udmf/include/uds.h +++ b/distributeddatamgr/udmf/include/uds.h @@ -72,6 +72,13 @@ typedef struct OH_UdsHtml OH_UdsHtml; */ typedef struct OH_UdsAppItem OH_UdsAppItem; +/** + * @brief Describes the unified data struct of array buffer. + * + * @since 13 + */ +typedef struct OH_UdsArrayBuffer OH_UdsArrayBuffer; + /** * @brief Creation a pointer to the instance of the {@link OH_UdsPlainText}. * @@ -464,6 +471,56 @@ 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_UdsArrayBuffer}. + * + * @return If the operation is successful, a pointer to the instance of the {@link OH_UdsArrayBuffer} + * structure is returned. If the memory is not enough, nullptr is returned. + * @see OH_UdsArrayBuffer + * @since 13 + */ +OH_UdsArrayBuffer* OH_UdsArrayBuffer_Create(); + +/** + * @brief Destroy a pointer that points to the {@link OH_UdsArrayBuffer} instance. + * + * @param buffer Represents a pointer to an instance of {@link OH_UdsArrayBuffer}. + * @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_UdsArrayBuffer Udmf_ErrCode + * @since 13 + */ +int OH_UdsArrayBuffer_Destroy(OH_UdsArrayBuffer* buffer); + +/** + * @brief Set array buffer data to the {@link OH_UdsArrayBuffer}. + * + * @param buffer Represents a pointer to an instance of {@link OH_UdsArrayBuffer}. + * @param data Represents the array buffer data. + * @param len Represents the length of data param. + * @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_UdsArrayBuffer Udmf_ErrCode + * @since 13 + */ +int OH_UdsArrayBuffer_SetData(OH_UdsArrayBuffer* buffer, unsigned char* data, unsigned int len); + +/** + * @brief Get array buffer data from the {@link OH_UdsArrayBuffer}. + * + * @param buffer Represents a pointer to an instance of {@link OH_UdsArrayBuffer}. + * @param data Represents a pointer to array buffer data that is a output param. + * @param len Represents the array buffer data length that is a output param. + * @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_UdsArrayBuffer Udmf_ErrCode + * @since 13 + */ +int OH_UdsArrayBuffer_GetData(OH_UdsArrayBuffer* buffer, unsigned char** data, unsigned int* len); + #ifdef __cplusplus }; #endif -- Gitee From 89396d6e212e872523fd14766b0e00c6625319eb Mon Sep 17 00:00:00 2001 From: tantingting Date: Wed, 28 Aug 2024 17:50:02 +0800 Subject: [PATCH 206/620] add GetMainElementName interface Signed-off-by: tantingting --- .../bundle/include/native_interface_bundle.h | 35 +++++++++++++++++++ .../bundle/libbundle.ndk.json | 4 +++ 2 files changed, 39 insertions(+) diff --git a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h index 67fcee95a..2cc076408 100644 --- a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h +++ b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h @@ -62,6 +62,20 @@ struct OH_NativeBundle_ApplicationInfo { char* fingerprint; }; +/** + * @brief Indicates information of elementName. + * + * @since 13 + */ +struct OH_NativeBundle_ElementName { + /** Indicates the name of application. */ + char* bundleName; + /** Indicates the name of module. */ + char* moduleName; + /** Indicates the name of ability. */ + char* abilityName; +}; + /** * @brief Indicates information of application * @@ -70,6 +84,14 @@ struct OH_NativeBundle_ApplicationInfo { */ typedef struct OH_NativeBundle_ApplicationInfo OH_NativeBundle_ApplicationInfo; +/** + * @brief Indicates information of elementName + * + * @since 13 + * @version 1.0 + */ +typedef struct OH_NativeBundle_ElementName OH_NativeBundle_ElementName; + /** * @brief Obtains the application info based on the The current bundle. * @@ -110,6 +132,19 @@ char* OH_NativeBundle_GetAppId(); * @version 1.0 */ char* OH_NativeBundle_GetAppIdentifier(); + +/** +* @brief Obtains information of the entry mainElement based on the current application, including bundle name, + * module name, and ability name. + * After utilizing this interface, to prevent memory leaks, + * it is necessary to manually release the pointer returned by the interface. + * + * @return Returns the newly created OH_NativeBundle_ElementName object, if the returned object is NULL, + * it indicates creation failure. The possible cause of failure could be that the application address space is full, + * leading to space allocation failure. + * @since 13 + */ +OH_NativeBundle_ElementName OH_NativeBundle_GetMainElementName(); #ifdef __cplusplus }; #endif diff --git a/bundlemanager/bundle_framework/bundle/libbundle.ndk.json b/bundlemanager/bundle_framework/bundle/libbundle.ndk.json index f27f55688..a9db17ede 100644 --- a/bundlemanager/bundle_framework/bundle/libbundle.ndk.json +++ b/bundlemanager/bundle_framework/bundle/libbundle.ndk.json @@ -10,5 +10,9 @@ { "first_introduced": "11", "name": "OH_NativeBundle_GetAppIdentifier" + }, + { + "first_introduced": "13", + "name": "OH_NativeBundle_GetMainElementName" } ] -- Gitee From 630acaae2741b9006e14ee08095863d8b95e6370 Mon Sep 17 00:00:00 2001 From: Cai Xincheng Date: Mon, 19 Aug 2024 19:26:22 +0800 Subject: [PATCH 207/620] add asset account enc tag Signed-off-by: Cai Xincheng --- security/asset/inc/asset_type.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/security/asset/inc/asset_type.h b/security/asset/inc/asset_type.h index b977afbef..8d64e56d5 100755 --- a/security/asset/inc/asset_type.h +++ b/security/asset/inc/asset_type.h @@ -205,6 +205,12 @@ typedef enum { * @since 12 */ ASSET_TAG_OPERATION_TYPE = ASSET_TYPE_NUMBER | 0x46, + /** + * A tag whose value is a bool indicating whether the attributes of an asset are required to be encrypted. + * + * @since 13 + */ + ASSET_TAG_REQUIRE_ATTR_ENCRYPTED = ASSET_TYPE_BOOL | 0x47, } Asset_Tag; /** -- Gitee From d015c928d15ef7d8226c03719a6fb7ed4fd491ed Mon Sep 17 00:00:00 2001 From: zhangyuhang72 Date: Sat, 31 Aug 2024 11:37:50 +0800 Subject: [PATCH 208/620] =?UTF-8?q?StartNativeChildProcess=20API=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangyuhang72 Change-Id: Ib475cf5dd09174743b7d0c95c33ecf0218c88ded --- .../child_process/native_child_process.h | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/ability/ability_runtime/child_process/native_child_process.h b/ability/ability_runtime/child_process/native_child_process.h index 84c0ddf7b..af736450b 100644 --- a/ability/ability_runtime/child_process/native_child_process.h +++ b/ability/ability_runtime/child_process/native_child_process.h @@ -54,12 +54,6 @@ typedef enum Ability_NativeChildProcess_ErrCode { */ NCP_NO_ERROR = 0, - /** - * @error Operation not permitted. - * @since 13 - */ - NCP_ERR_NO_PERMISSION = 201, - /** * @error Invalid parameter. */ @@ -252,16 +246,27 @@ typedef struct NativeChildProcess_Args { /** * @brief Starts a child process, loads the specified dynamic library file. * - * @permission {@code ohos.permission.START_NATIVE_CHILD_PROCESS} - * @param entry Name of the entry of the dynamic library file loaded in the child process. The value cannot be nullptr. + * The dynamic library specified must implement a function with NativeChildProcess_Args as a + * pamameter(function name can be customized), and export the function, such as:\n + * 1. void Main(NativeChildProcess_Args args); + * + * The processing logic sequence is shown in the following pseudocode: \n + * Main process: \n + * 1. OH_Ability_StartNativeChildProcess(entryPoint, args, options)\n + * Child process: \n + * 2. dlopen(libName)\n + * 3. dlsym("Main")\n + * 4. Main(args)\n + * 5. The child process exits after the Main(args) function is returned \n + * + * @param entry Dynamic library and entry function loaded in child process, such as "libEntry.so:Main". + * The value cannot be nullptr. * @param args The arguments passed to the child process. * For details, see {@link NativeChildProcess_Args}. * @param options The child process options. * For details, see {@link NativeChildProcess_Options}. * @param pid The started child process id. * @return Returns {@link NCP_NO_ERROR} if the call is successful.\n - * Returns {@link NCP_ERR_NO_PERMISSION} if the operation is not permitted. - * The permission {@code ohos.permission.START_NATIVE_CHILD_PROCESS} is needed.\n * Returns {@link NCP_ERR_INVALID_PARAM} if the dynamic library name or callback function pointer is invalid.\n * Returns {@link NCP_ERR_NOT_SUPPORTED} if the device does not support the creation of native child processes.\n * Returns {@link NCP_ERR_ALREADY_IN_CHILD} if it is not allowed to create another child process in the child process.\n -- Gitee From 1bc62051ad51605826175a1e85060614aff16490 Mon Sep 17 00:00:00 2001 From: lihui Date: Sat, 31 Aug 2024 13:23:22 +0800 Subject: [PATCH 209/620] =?UTF-8?q?native=20image=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lihui --- graphic/graphic_2d/native_image/libnative_image.ndk.json | 4 ++-- graphic/graphic_2d/native_image/native_image.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/graphic/graphic_2d/native_image/libnative_image.ndk.json b/graphic/graphic_2d/native_image/libnative_image.ndk.json index cc12b88ad..1a8c6688d 100644 --- a/graphic/graphic_2d/native_image/libnative_image.ndk.json +++ b/graphic/graphic_2d/native_image/libnative_image.ndk.json @@ -25,10 +25,10 @@ }, { "first_introduced": "13", - "name": "OH_ConsumerSuface_SetDefaultUsage" + "name": "OH_ConsumerSurface_SetDefaultUsage" }, { "first_introduced": "13", - "name": "OH_ConsumerSuface_SetDefaultSize" + "name": "OH_ConsumerSurface_SetDefaultSize" } ] \ No newline at end of file diff --git a/graphic/graphic_2d/native_image/native_image.h b/graphic/graphic_2d/native_image/native_image.h index acac1ca3a..eca8af106 100644 --- a/graphic/graphic_2d/native_image/native_image.h +++ b/graphic/graphic_2d/native_image/native_image.h @@ -312,7 +312,7 @@ OH_NativeImage* OH_ConsumerSurface_Create(); * @since 13 * @version 1.0 */ -int32_t OH_ConsumerSuface_SetDefaultUsage(OH_NativeImage* image, uint64_t usage); +int32_t OH_ConsumerSurface_SetDefaultUsage(OH_NativeImage* image, uint64_t usage); /** * @brief Set the default size of the OH_NativeImage.\n @@ -327,7 +327,7 @@ int32_t OH_ConsumerSuface_SetDefaultUsage(OH_NativeImage* image, uint64_t usage) * @since 13 * @version 1.0 */ -int32_t OH_ConsumerSuface_SetDefaultSize(OH_NativeImage* image, int32_t width, int32_t height); +int32_t OH_ConsumerSurface_SetDefaultSize(OH_NativeImage* image, int32_t width, int32_t height); #ifdef __cplusplus } #endif -- Gitee From 63733372670cf80e5b55b8c39968978bd3be11ee Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Wed, 28 Aug 2024 09:51:36 +0000 Subject: [PATCH 210/620] add mul NDK Signed-off-by: hellohyh001 --- .../kits/c/input/oh_input_manager.h | 179 ++++++++++++++++++ 1 file changed, 179 insertions(+) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 4c3a94b31..cfa551ad6 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -146,6 +146,26 @@ typedef enum Input_TouchEventAction { TOUCH_ACTION_UP = 3, } Input_TouchEventAction; +/** + * @brief 键盘输入设备的类型。 + * + * @since 13 + */ +typedef enum Input_KeyboardType { + /** 表示无按键设备。 */ + KEYBOARD_TYPE_NONE = 0, + /** 表示未知按键设备。 */ + KEYBOARD_TYPE_UNKNOWN = 1, + /** 表示全键盘设备。 */ + KEYBOARD_TYPE_ALPHABETIC = 2, + /** 表示小键盘设备。 */ + KEYBOARD_TYPE_DIGITAL = 3, + /** 表示手写笔设备。 */ + KEYBOARD_TYPE_HANDWRITING_PEN = 4, + /** 表示遥控器设备。 */ + KEYBOARD_TYPE_REMOTE_CONTROL = 5, +} Input_KeyboardType; + /** * @brief Enumerates event source types. * @@ -228,6 +248,13 @@ typedef enum Input_Result { INPUT_REPEAT_INTERCEPTOR = 4200001 } Input_Result; +/** + * @brief 输入设备信息。 + * + * @since 13 + */ +typedef struct Input_DeviceInfo Input_DeviceInfo; + /** * @brief Defines a lifecycle callback for keyEvent. If the callback is triggered, keyEvent will be destroyed. * @@ -1200,6 +1227,158 @@ Input_Result OH_Input_RemoveKeyEventInterceptor(void); * @since 12 */ Input_Result OH_Input_RemoveInputEventInterceptor(void); + +/** + * @brief 获取所有输入设备的id列表。 + * + * @param deviceIds 用于保存输入设备id的数组。 + * @param inSize 用于保存输入设备id数组的大小。 + * @param outSize 出参,输出输入设备id列表的长度,该值不会大于inSize。 + * @return OH_Input_GetDeviceIds 的返回值如下, + * {@link INPUT_SUCCESS} 操作成功。 + * {@INPUT_SERVICE_EXCEPTION} 由于服务异常,获取设备id列表失败。 + * {@link INPUT_PARAMETER_ERROR} deviceIds或outSize为空指针。 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetDeviceIds(int32_t *deviceIds, int32_t inSize, int32_t *outSize); + +/** + * @brief 获取输入设备信息。 + * + * @param deviceId 设备id。 + * @param deviceInfo 出参,指向输入设备信息{@Link Input_DeviceInfo}的指针。 + * @return OH_Input_GetDevice 的返回值如下, + * {@link INPUT_SUCCESS} 操作成功。 + * {@INPUT_SERVICE_EXCEPTION} 由于服务异常,获取输入设备信息失败。 + * {@link INPUT_PARAMETER_ERROR} 设备id为无效值或者deviceInfo是空指针。 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetDevice(int32_t deviceId, Input_DeviceInfo **deviceInfo); + +/** + * @brief 创建输入设备信息的对象。 + * + * @return 如果操作成功,返回设备信息{@Link Input_DeviceInfo}实例的指针。否则返回空指针,可能的原因是分配内存失败。 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_DeviceInfo* OH_Input_CreateDeviceInfo(void); + +/** + * @brief 销毁输入设备信息的对象。 + * + * @param deviceInfo 设备信息的对象。 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +void OH_Input_DestroyDeviceInfo(Input_DeviceInfo **deviceInfo); + +/** + * @brief 获取输入设备的键盘类型。 + * + * @param deviceId 设备id。 + * @param KeyboardType 出参,指向键盘输入设备类型的指针。 + * @return OH_Input_GetKeyboardType 的返回值如下, + * {@link INPUT_SUCCESS} 操作成功。 + * {@INPUT_SERVICE_EXCEPTION} 由于服务异常,获取输入设备的键盘类型失败。 + * {@link INPUT_PARAMETER_ERROR} 设备id为无效值或者KeyboardType是空指针。 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetKeyboardType(int32_t deviceId, int32_t *KeyboardType); + +/** + * @brief 获取输入设备的id。 + * + * @param deviceInfo 输入设备信息{@Link Input_DeviceInfo}。 + * @param id 出参,指向输入设备id的指针。 + * @return OH_Input_GetDeviceId 的返回值如下, + * {@link INPUT_SUCCESS} 操作成功。 + * {@link INPUT_PARAMETER_ERROR} deviceInfo或者id是空指针。 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetDeviceId(Input_DeviceInfo *deviceInfo, int32_t *id); + +/** + * @brief 获取输入设备的名称。 + * + * @param deviceInfo 输入设备信息{@Link Input_DeviceInfo}。 + * @param name 出参,指向输入设备名称的指针。 + * @return OH_Input_GetDeviceName 的返回值如下, + * {@link INPUT_SUCCESS} 操作成功。 + * {@link INPUT_PARAMETER_ERROR} deviceInfo或者name是空指针。 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetDeviceName(Input_DeviceInfo *deviceInfo, char **name); + +/** + * @brief 获取有关输入设备能力信息,比如设备是触摸屏、触控板、键盘等,详情请参考示例代码。 + * + * @param deviceInfo 输入设备信息{@Link Input_DeviceInfo}。 + * @param capabilities 出参,指向输入设备能力信息的指针。 + * @return OH_Input_GetCapabilities 的返回值如下, + * {@link INPUT_SUCCESS} 操作成功。 + * {@link INPUT_PARAMETER_ERROR} deviceInfo或者capabilities是空指针。 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetCapabilities(Input_DeviceInfo *deviceInfo, int32_t *capabilities); + +/** + * @brief 获取输入设备的版本信息。 + * + * @param deviceInfo 输入设备信息{@Link Input_DeviceInfo}。 + * @param version 出参,指向输入设备版本信息的指针。 + * @return OH_Input_GetDeviceVersion 的返回值如下, + * {@link INPUT_SUCCESS} 操作成功。 + * {@link INPUT_PARAMETER_ERROR} deviceInfo或者version是空指针。 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetDeviceVersion(Input_DeviceInfo *deviceInfo, int32_t *version); + +/** + * @brief 获取输入设备的产品信息。 + * + * @param deviceInfo 输入设备信息{@Link Input_DeviceInfo}。 + * @param product 出参,指向输入设备产品信息的指针。 + * @return OH_Input_GetDeviceProduct 的返回值如下, + * {@link INPUT_SUCCESS} 操作成功。 + * {@link INPUT_PARAMETER_ERROR} deviceInfo或者product是空指针。 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetDeviceProduct(Input_DeviceInfo *deviceInfo, int32_t *product); + +/** + * @brief 获取输入设备的厂商信息。 + * + * @param deviceInfo 输入设备信息{@Link Input_DeviceInfo}。 + * @param vendor 出参,指向输入设备厂商信息的指针。 + * @return OH_Input_GetDeviceVendor 的返回值如下, + * {@link INPUT_SUCCESS} 操作成功。 + * {@link INPUT_PARAMETER_ERROR} deviceInfo或者vendor是空指针。 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetDeviceVendor(Input_DeviceInfo *deviceInfo, int32_t *vendor); + +/** + * @brief 获取输入设备的物理地址。 + * + * @param deviceInfo 输入设备信息{@Link Input_DeviceInfo}。 + * @param phys 出参,指向输入设备物理地址的指针。 + * @return OH_Input_GetDevicePhys 的返回值如下, + * {@link INPUT_SUCCESS} 操作成功。 + * {@link INPUT_PARAMETER_ERROR} deviceInfo或者phys是空指针。 + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetDevicePhys(Input_DeviceInfo *deviceInfo, char **phys); #ifdef __cplusplus } #endif -- Gitee From c9f42aabf4edeee0b4c7e6876e36fde8852b1a22 Mon Sep 17 00:00:00 2001 From: gaochao Date: Sat, 31 Aug 2024 14:55:15 +0800 Subject: [PATCH 211/620] =?UTF-8?q?=E8=B0=83=E6=95=B4ndk=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gaochao --- .../libnative_resmgr.ndk.json | 88 +++++++++++++++++++ .../resource_management/librawfile.ndk.json | 88 ------------------- 2 files changed, 88 insertions(+), 88 deletions(-) diff --git a/global/resource_management/libnative_resmgr.ndk.json b/global/resource_management/libnative_resmgr.ndk.json index 039fbcaa7..dcb320f42 100644 --- a/global/resource_management/libnative_resmgr.ndk.json +++ b/global/resource_management/libnative_resmgr.ndk.json @@ -50,5 +50,93 @@ { "first_introduced": "12", "name": "OH_ResourceManager_GetLocalesData" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetSymbol" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetSymbolByName" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetLocales" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetConfiguration" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_ReleaseConfiguration" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetString" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetStringByName" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetStringArray" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetStringArrayByName" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_ReleaseStringArray" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetPluralString" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetPluralStringByName" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetColor" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetColorByName" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetInt" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetIntByName" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetFloat" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetFloatByName" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetBool" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_GetBoolByName" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_AddResource" + }, + { + "first_introduced": "12", + "name": "OH_ResourceManager_RemoveResource" } ] \ No newline at end of file diff --git a/global/resource_management/librawfile.ndk.json b/global/resource_management/librawfile.ndk.json index 31739dc49..d81c3da5c 100644 --- a/global/resource_management/librawfile.ndk.json +++ b/global/resource_management/librawfile.ndk.json @@ -75,94 +75,6 @@ "first_introduced": "12", "name": "OH_ResourceManager_IsRawDir" }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetSymbol" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetSymbolByName" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetLocales" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetConfiguration" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_ReleaseConfiguration" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetString" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetStringByName" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetStringArray" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetStringArrayByName" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_ReleaseStringArray" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetPluralString" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetPluralStringByName" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetColor" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetColorByName" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetInt" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetIntByName" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetFloat" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetFloatByName" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetBool" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_GetBoolByName" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_AddResource" - }, - { - "first_introduced": "12", - "name": "OH_ResourceManager_RemoveResource" - }, { "first_introduced": "12", "name": "OH_ResourceManager_GetRawFileDescriptorData" -- Gitee From c7aeff7f69a6262fc4877c318a41c73e4b6cc1e7 Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Sat, 31 Aug 2024 07:33:25 +0000 Subject: [PATCH 212/620] 11 Signed-off-by: hellohyh001 --- .../kits/c/input/oh_input_manager.h | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 420b65c3d..e66f2781e 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -268,15 +268,15 @@ typedef void (*Input_TouchEventCallback)(const Input_TouchEvent* touchEvent); typedef void (*Input_AxisEventCallback)(const Input_AxisEvent* axisEvent); /** - * @brief 回调函数,用于回调输入设备的上线事件。 - * @param deviceId 设备的id。 + * @brief Defines the callback for device addition events. + * @param deviceId Device ID. * @since 13 */ typedef void (*Input_DeviceAddedCallback)(int32_t deviceId); /** - * @brief 回调函数,用于回调输入设备的下线事件。 - * @param deviceId 设备的id。 + * @brief Defines the callback for device removal events. + * @param deviceId Device ID. * @since 13 */ typedef void (*Input_DeviceRemovedCallback)(int32_t deviceId); @@ -296,13 +296,13 @@ typedef struct Input_InterceptorEventCallback { } Input_InterceptorEventCallback; /** - * @brief 定义一个结构体用于监听设备设插拔 + * @brief Defines a listener for device insertion and removal events. * @since 13 */ typedef struct Input_DeviceListener { - /** 定义一个回调函数用于回调设备上线事件 */ + /** Callback for device addition events */ Input_DeviceAddedCallback deviceAddedCallback; - /** 定义一个回调函数用于回调设备下线事件 */ + /** Callback for device removal events */ Input_DeviceRemovedCallback deviceRemovedCallback; } Input_DeviceListener; @@ -1354,39 +1354,39 @@ void OH_Input_DestroyAllSystemHotkeys(Input_Hotkey **hotkeys, int32_t count); Input_Result OH_Input_GetAllSystemHotkeys(Input_Hotkey **hotkey, int32_t *count); /** - * @brief 注册设备热插拔的监听器 + * @brief Registers a listener for device hot swap events. * - * @param listener 指向设备热插拔监听器{@Link Input_DeviceListener}的指针. + * @param listener Pointer to an {@Link Input_DeviceListener} object. * - * @return OH_Input_RegisterDeviceListener 的返回值, 具体如下: - * {@link INPUT_SUCCESS} 调用成功;\n - * {@link INPUT_PARAMETER_ERROR} listener 为NULL - * {@link INPUT_SERVICE_EXCEPTION} 由于服务异常调用失败 + * @return OH_Input_RegisterDeviceListener status code, specifically, + * {@link INPUT_SUCCESS} if the operation is successful;\n + * {@link INPUT_PARAMETER_ERROR} if listener is NULL; + * {@link INPUT_SERVICE_EXCEPTION} if the service is abnormal. * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ Input_Result OH_Input_RegisterDeviceListener(Input_DeviceListener* listener); /** - * @brief 取消注册设备热插拔的监听 + * @brief Unregisters the listener for device hot swap events. * - * @param listener 指向设备热插拔监听器{@Link Input_DeviceListener}的指针. + * @param listener Pointer to the listener for device hot swap events. For details, see {@Link Input_DeviceListener}. * - * @return OH_Input_UnregisterDeviceListener 的返回值, 具体如下: - * {@link INPUT_SUCCESS} 调用成功;\n - * {@link INPUT_PARAMETER_ERROR} listener 为 NULL 或者 listener 未被注册 - * {@link INPUT_SERVICE_EXCEPTION} 由于服务异常调用失败 + * @return OH_Input_UnregisterDeviceListener status code, specifically, + * {@link INPUT_SUCCESS} if the operation is successful;\n + * {@link INPUT_PARAMETER_ERROR} if listener is NULL or no listener is registered; + * {@link INPUT_SERVICE_EXCEPTION} if the service is abnormal. * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ Input_Result OH_Input_UnregisterDeviceListener(Input_DeviceListener* listener); /** - * @brief 取消注册所有的设备热插拔的监听 + * @brief Unregisters the listener for all device hot swap events. * - * @return OH_Input_UnregisterDeviceListener 的返回值, 具体如下: - * {@link INPUT_SUCCESS} 调用成功;\n - * {@link INPUT_SERVICE_EXCEPTION} 由于服务异常调用失败 + * @return OH_Input_UnregisterDeviceListener status code, specifically, + * {@link INPUT_SUCCESS} if the operation is successful;\n + * {@link INPUT_SERVICE_EXCEPTION} if the service is abnormal. * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ -- Gitee From 242cb3933381bf2e1adb3dd3ee0dc73fcca2c286 Mon Sep 17 00:00:00 2001 From: z30053694 Date: Sat, 31 Aug 2024 16:01:03 +0800 Subject: [PATCH 213/620] feat: add c-api of battery info module Signed-off-by: z30053694 Change-Id: Id7af7ce9818f3bd7f831e10a7f600448b2987f2d --- BasicServicesKit/BUILD.gn | 14 +++ BasicServicesKit/ohbattery_info.h | 111 +++++++++++++++++++++++ BasicServicesKit/ohbattery_info.ndk.json | 8 ++ 3 files changed, 133 insertions(+) create mode 100644 BasicServicesKit/ohbattery_info.h create mode 100644 BasicServicesKit/ohbattery_info.ndk.json diff --git a/BasicServicesKit/BUILD.gn b/BasicServicesKit/BUILD.gn index ea12f5495..2c6fa0d7e 100644 --- a/BasicServicesKit/BUILD.gn +++ b/BasicServicesKit/BUILD.gn @@ -91,3 +91,17 @@ ohos_ndk_library("libcommonevent_ndk") { "BasicServicesKit/commonevent/oh_commonevent_support.h", ] } + +ohos_ndk_headers("ohbattery_info_header") { + dest_dir = "$ndk_headers_out_dir/BasicServicesKit/" + sources = [ "./ohbattery_info.h" ] +} + +ohos_ndk_library("libohbattery_info_ndk") { + output_name = "ohbattery_info" + output_extension = "so" + ndk_description_file = "./ohbattery_info.ndk.json" + min_compact_version = "12" + system_capability = "SystemCapability.PowerManager.BatteryManager.Core" + system_capability_headers = [ "BasicServicesKit/ohbattery_info.h" ] +} diff --git a/BasicServicesKit/ohbattery_info.h b/BasicServicesKit/ohbattery_info.h new file mode 100644 index 000000000..0083373a7 --- /dev/null +++ b/BasicServicesKit/ohbattery_info.h @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup OH_BatteryInfo + * @{ + * + * @brief Provides the definition of the C interface for the BatteryInfo module. + * + * @syscap SystemCapability.PowerManager.BatteryManager.Core + * @since 12 + * @version 1.0 + */ +/** + * @file ohbattery_info.h + * + * @brief Declares the APIs to discover and connect printers, print files from a printer, + * query the list of the added printers and the printer information within it, and so on. + * + * @library libohbattery_info.so + * @kit BasicServicesKit + * @syscap SystemCapability.PowerManager.BatteryManager.Core + * @since 12 + * @version 1.0 + */ +#ifndef OHBATTERY_INFO_HEADER +#define OHBATTERY_INFO_HEADER + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +static const char* COMMON_EVENT_KEY_CAPACITY = "soc"; +static const char* COMMON_EVENT_KEY_CHARGE_STATE = "chargeState"; +static const char* COMMON_EVENT_KEY_PLUGGED_TYPE = "pluggedType"; + +/** + * @brief Defines plugged types. + * + * @since 12 + * @version 1.0 + */ + +typedef enum { + /** + * Power source is unplugged. + */ + PLUGGED_TYPE_NONE, + + /** + * Power source is an AC charger. + */ + PLUGGED_TYPE_AC, + + /** + * Power source is a USB DC charger. + */ + PLUGGED_TYPE_USB, + + /** + * Power source is wireless charger. + */ + PLUGGED_TYPE_WIRELESS, + + /** + * The bottom of the enum. + */ + PLUGGED_TYPE_BUTT +} BatteryInfo_BatteryPluggedType; + +/** + * @brief This API returns the current battery capacity. + * + * @return Returns number betweem 0 and 100. + * @syscap ystemCapability.PowerManager.BatteryManager.Core + * @since 12 + */ +int32_t OH_BatteryInfo_GetCapacity(); + +/** + * @brief This API returns the current plugged type. + * + * @Return {@link BatteryInfo_BatteryPluggedType#PLUGGED_TYPE_NONE} if the power source is unplugged. + * {@link PLUGGED_TYPE_AC} if the power source is an AC charger. + * {@link PLUGGED_TYPE_USB} if the power source is an USB DC charger. + * {@link PLUGGED_TYPE_WIRELESS} if the power source is wireless charger. + * {@link PLUGGED_TYPE_BUTT} if the type is unknown. + * @syscap ystemCapability.PowerManager.BatteryManager.Core + * @since 12 + */ +BatteryInfo_BatteryPluggedType OH_BatteryInfo_GetPluggedType(); + +#ifdef __cplusplus +} +/** @} */ +#endif /* __cplusplus */ +#endif /* OHBATTERY_INFO_HEADER */ \ No newline at end of file diff --git a/BasicServicesKit/ohbattery_info.ndk.json b/BasicServicesKit/ohbattery_info.ndk.json new file mode 100644 index 000000000..947048fdb --- /dev/null +++ b/BasicServicesKit/ohbattery_info.ndk.json @@ -0,0 +1,8 @@ +[ + { "first_introduced": "12", + "name":"OH_BatteryInfo_GetCapacity" + }, + { "first_introduced": "12", + "name":"OH_BatteryInfo_GetPluggedType" + } +] \ No newline at end of file -- Gitee From 7038e5950665e6b99c4de49b653aeffde7aee24b Mon Sep 17 00:00:00 2001 From: wuchengwen Date: Sat, 31 Aug 2024 16:56:28 +0800 Subject: [PATCH 214/620] fix function no parameter use void Signed-off-by: wuchengwen --- inputmethod/include/inputmethod_text_config_capi.h | 2 +- inputmethod/include/inputmethod_text_editor_proxy_capi.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index 1a625eb08..ad639af2d 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -59,7 +59,7 @@ typedef struct InputMethod_TextConfig InputMethod_TextConfig; * instance is returned. If the creation fails, NULL is returned, possible cause is insufficient memory. * @since 12 */ -InputMethod_TextConfig *OH_TextConfig_Create(); +InputMethod_TextConfig *OH_TextConfig_Create(void); /** * @brief Destroy a {@link InputMethod_TextConfig} instance. * diff --git a/inputmethod/include/inputmethod_text_editor_proxy_capi.h b/inputmethod/include/inputmethod_text_editor_proxy_capi.h index 05d56b643..2a6b9f08a 100644 --- a/inputmethod/include/inputmethod_text_editor_proxy_capi.h +++ b/inputmethod/include/inputmethod_text_editor_proxy_capi.h @@ -265,7 +265,7 @@ typedef void (*OH_TextEditorProxy_FinishTextPreviewFunc)(InputMethod_TextEditorP * instance is returned. If the creation fails, NULL is returned, possible cause is insufficient memory. * @since 12 */ -InputMethod_TextEditorProxy *OH_TextEditorProxy_Create(); +InputMethod_TextEditorProxy *OH_TextEditorProxy_Create(void); /** * @brief Destroy a {@link InputMethod_TextEditorProxy} instance. * -- Gitee From 30e8efc4c08b907b91d7e3baf2d4d5d52fcceb11 Mon Sep 17 00:00:00 2001 From: yangzk Date: Fri, 30 Aug 2024 18:10:36 +0800 Subject: [PATCH 215/620] Description: add application context ndk IssueNo: Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: If4888aba7774112d431924dfbf55dc77ee594beb --- AbilityKit/ability_runtime/BUILD.gn | 36 +++++++ .../ability_runtime/ability_runtime_common.h | 61 ++++++++++++ .../ability_runtime/application_context.h | 97 +++++++++++++++++++ AbilityKit/ability_runtime/context_constant.h | 82 ++++++++++++++++ .../libability_runtime.ndk.json | 14 +++ 5 files changed, 290 insertions(+) create mode 100644 AbilityKit/ability_runtime/BUILD.gn create mode 100644 AbilityKit/ability_runtime/ability_runtime_common.h create mode 100644 AbilityKit/ability_runtime/application_context.h create mode 100644 AbilityKit/ability_runtime/context_constant.h create mode 100644 AbilityKit/ability_runtime/libability_runtime.ndk.json diff --git a/AbilityKit/ability_runtime/BUILD.gn b/AbilityKit/ability_runtime/BUILD.gn new file mode 100644 index 000000000..e96e8afc2 --- /dev/null +++ b/AbilityKit/ability_runtime/BUILD.gn @@ -0,0 +1,36 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") +ohos_ndk_headers("ability_runtime_ndk_header") { + dest_dir = "$ndk_headers_out_dir/AbilityKit/ability_runtime" + sources = [ + "./ability_runtime_common.h", + "./application_context.h", + "./context_constant.h", + ] +} + +ohos_ndk_library("libability_runtime") { + output_name = "ability_runtime" + output_extension = "so" + system_capability = "SystemCapability.Ability.AbilityRuntime.Core" + ndk_description_file = "./libability_runtime.ndk.json" + min_compact_version = "13" + system_capability_headers = [ + "AbilityKit/ability_runtime/ability_runtime_common.h", + "AbilityKit/ability_runtime/application_context.h", + "AbilityKit/ability_runtime/context_constant.h", + ] +} diff --git a/AbilityKit/ability_runtime/ability_runtime_common.h b/AbilityKit/ability_runtime/ability_runtime_common.h new file mode 100644 index 000000000..d6220b080 --- /dev/null +++ b/AbilityKit/ability_runtime/ability_runtime_common.h @@ -0,0 +1,61 @@ +/* +* Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup AbilityRuntime + * @{ + * + * @brief Provide the definition of the C interface for the native AbilityRuntime + * + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 13 + */ + +/** + * @file ability_runtime_common.h + * + * @brief Declare the common types for the native AbilityRuntime. + * + * @library libability_runtime.so + * @kit AbilityKit + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 13 + */ + +#ifndef ABILITY_RUNTIME_COMMON_H +#define ABILITY_RUNTIME_COMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the error codes. + * + * @since 13 + */ +typedef enum { + /** @error No error. */ + ABILITY_RUNTIME_ERROR_CODE_NO_ERROR = 0, + /** @error Invalid parameters. */ + ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID = 401, +} AbilityRuntime_ErrorCode; + +#ifdef __cplusplus +} +#endif + +/** @} */ +#endif //ABILITY_RUNTIME_COMMON_H diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h new file mode 100644 index 000000000..374a99bd8 --- /dev/null +++ b/AbilityKit/ability_runtime/application_context.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup AbilityRuntime + * @{ + * + * @brief Describe the functions provided by the application context. + * + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 13 + */ + +/** + * @file application_context.h + * + * @brief Defines the application context APIs. + * + * @library libability_runtime.so + * @kit AbilityKit + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 13 + */ + +#ifndef ABILITY_RUNTIME_APPLICATION_CONTEXT_H +#define ABILITY_RUNTIME_APPLICATION_CONTEXT_H + +#include +#include +#include "ability_runtime_common.h" +#include "context_constant.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Obtain the cache directory of the application. + * + * @param buffer A pointer to a buffer that receives the cache directory of the application. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * @since 13 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetCacheDir( + char* buffer, int32_t bufferSize, int32_t* writeLength); + +/** + * @brief Obtain the area mode of the application. + * + * @param areaMode A pointer to the area mode. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the areaMode is null. + * @since 13 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetAreaMode(AbilityRuntime_AreaMode* areaMode); + +/** + * @brief Obtain the bundle name. + * + * @param buffer A pointer to a buffer that receives the bundle name. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * @since 13 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetBundleName( + char* buffer, int32_t bufferSize, int32_t* writeLength); + +#ifdef __cplusplus +} // extern "C" +#endif + +/** @} */ +#endif // ABILITY_RUNTIME_APPLICATION_CONTEXT_H diff --git a/AbilityKit/ability_runtime/context_constant.h b/AbilityKit/ability_runtime/context_constant.h new file mode 100644 index 000000000..921f407c1 --- /dev/null +++ b/AbilityKit/ability_runtime/context_constant.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup AbilityRuntime + * @{ + * + * @brief Describe the constant of context. + * + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 13 + */ + +/** + * @file context_constant.h + * + * @brief Defines the constant of context. + * + * @library libability_runtime.so + * @kit AbilityKit + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 13 + */ + +#ifndef ABILITY_RUNTIME_CONTEXT_CONSTANT_H +#define ABILITY_RUNTIME_CONTEXT_CONSTANT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief File area mode. + * + * @since 13 + */ +typedef enum { + /** + * System level device encryption area. + */ + ABILITY_RUNTIME_AREA_MODE_EL1 = 0, + /** + * User credential encryption area. + */ + ABILITY_RUNTIME_AREA_MODE_EL2 = 1, + /** + * User credential encryption area. + * when screen locked, can read/write, and create file. + */ + ABILITY_RUNTIME_AREA_MODE_EL3 = 2, + /** + * User credential encryption area. + * when screen locked, FEB2.0 can read/write, FEB3.0 can't + * read/write, and all can't create file. + */ + ABILITY_RUNTIME_AREA_MODE_EL4 = 3, + /** + * User privacy-sensitive encryption area. + * when the screen locked, a closed file cannot be opened, read, or written, + * a file can be created and then opened, read, or written. + */ + ABILITY_RUNTIME_AREA_MODE_EL5 = 4, +} AbilityRuntime_AreaMode; + +#ifdef __cplusplus +} // extern "C" +#endif + +/** @} */ +#endif // ABILITY_RUNTIME_CONTEXT_CONSTANT_H diff --git a/AbilityKit/ability_runtime/libability_runtime.ndk.json b/AbilityKit/ability_runtime/libability_runtime.ndk.json new file mode 100644 index 000000000..239f84f61 --- /dev/null +++ b/AbilityKit/ability_runtime/libability_runtime.ndk.json @@ -0,0 +1,14 @@ +[ + { + "first_introduced": "13", + "name": "OH_AbilityRuntime_ApplicationContextGetCacheDir" + }, + { + "first_introduced": "13", + "name": "OH_AbilityRuntime_ApplicationContextGetAreaMode" + }, + { + "first_introduced": "13", + "name": "OH_AbilityRuntime_ApplicationContextGetBundleName" + } +] \ No newline at end of file -- Gitee From 2a5f2a681d7cc42d49ddd5042b5bef86496390b6 Mon Sep 17 00:00:00 2001 From: shenshiyi2 Date: Sat, 31 Aug 2024 17:40:25 +0800 Subject: [PATCH 216/620] =?UTF-8?q?Image=20Kit=20=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81=E6=8F=8F=E8=BF=B0=E4=BF=AE=E6=94=B9=20-=20501=20Resou?= =?UTF-8?q?rce=20unavailable.=20-=2062980097=20IPC=20error.=20-=2062980246?= =?UTF-8?q?=20Failed=20to=20read=20the=20pixel=20map.=20-=2062980247=20Fai?= =?UTF-8?q?led=20to=20write=20the=20pixel=20map.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenshiyi2 --- multimedia/image_framework/include/image_mdk_common.h | 6 +++--- multimedia/image_framework/include/image_pixel_map_mdk.h | 4 ++-- multimedia/image_framework/include/image_source_mdk.h | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/multimedia/image_framework/include/image_mdk_common.h b/multimedia/image_framework/include/image_mdk_common.h index 2ed208982..5b89d31d3 100644 --- a/multimedia/image_framework/include/image_mdk_common.h +++ b/multimedia/image_framework/include/image_mdk_common.h @@ -52,7 +52,7 @@ typedef enum { IMAGE_RESULT_SUCCESS = 0, // Operation success IMAGE_RESULT_BAD_PARAMETER = -1, // Invalid parameter IMAGE_RESULT_IMAGE_RESULT_BASE = IMAGE_RESULT_BASE, // Operation failed - IMAGE_RESULT_ERR_IPC = IMAGE_RESULT_BASE + 1, // ipc error + IMAGE_RESULT_ERR_IPC = IMAGE_RESULT_BASE + 1, // IPC error. IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST = IMAGE_RESULT_BASE + 2, // sharememory error IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL = IMAGE_RESULT_BASE + 3, // sharememory data abnormal IMAGE_RESULT_DECODE_ABNORMAL = IMAGE_RESULT_BASE + 4, // image decode error @@ -129,8 +129,8 @@ typedef enum { IMAGE_RESULT_MEDIA_DENCODE_ICC_FAILED = IMAGE_RESULT_BASE + 75, // image dencode ICC fail IMAGE_RESULT_MEDIA_ENCODE_ICC_FAILED = IMAGE_RESULT_BASE + 76, // image encode ICC fail - IMAGE_RESULT_MEDIA_READ_PIXELMAP_FAILED = IMAGE_RESULT_BASE + 150, // read pixelmap failed - IMAGE_RESULT_MEDIA_WRITE_PIXELMAP_FAILED = IMAGE_RESULT_BASE + 151, // write pixelmap failed + IMAGE_RESULT_MEDIA_READ_PIXELMAP_FAILED = IMAGE_RESULT_BASE + 150, // Failed to read the pixel map. + IMAGE_RESULT_MEDIA_WRITE_PIXELMAP_FAILED = IMAGE_RESULT_BASE + 151, // Failed to write the pixel map. IMAGE_RESULT_MEDIA_PIXELMAP_NOT_ALLOW_MODIFY = IMAGE_RESULT_BASE + 152, // pixelmap not allow modify IMAGE_RESULT_MEDIA_CONFIG_FAILED = IMAGE_RESULT_BASE + 153, // config error IMAGE_RESULT_JNI_ENV_ABNORMAL = IMAGE_RESULT_BASE + 154, // Abnormal JNI environment diff --git a/multimedia/image_framework/include/image_pixel_map_mdk.h b/multimedia/image_framework/include/image_pixel_map_mdk.h index b05dc9ca7..53105e9f4 100644 --- a/multimedia/image_framework/include/image_pixel_map_mdk.h +++ b/multimedia/image_framework/include/image_pixel_map_mdk.h @@ -197,7 +197,7 @@ struct OhosPixelMapCreateOps { * returns {@link IRNdkErrCode} IMAGE_RESULT_ENCODE_FAILED - if image add pixel map fail. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_UNSUPPORT - if image hardware decode unsupported. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_FAILED - if hard decode failed. - * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if ipc error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if IPC error. * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. @@ -264,7 +264,7 @@ int32_t OH_PixelMap_CreatePixelMapWithStride(napi_env env, OhosPixelMapCreateOps * returns {@link IRNdkErrCode} IMAGE_RESULT_ENCODE_FAILED - if image add pixel map fail. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_UNSUPPORT - if image hardware decode unsupported. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_FAILED - if hard decode failed. - * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if ipc error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if IPC error. * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. diff --git a/multimedia/image_framework/include/image_source_mdk.h b/multimedia/image_framework/include/image_source_mdk.h index ae7cadf4d..f51f27dd8 100644 --- a/multimedia/image_framework/include/image_source_mdk.h +++ b/multimedia/image_framework/include/image_source_mdk.h @@ -668,7 +668,7 @@ ImageSourceNative* OH_ImageSource_InitNative(napi_env env, napi_value source); * returns {@link IRNdkErrCode} IMAGE_RESULT_ENCODE_FAILED - if image add pixel map fail. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_UNSUPPORT - if image hardware decode unsupported. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_FAILED - if hard decode failed. - * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if ipc error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if IPC error. * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. @@ -714,7 +714,7 @@ int32_t OH_ImageSource_CreatePixelMap(const ImageSourceNative* native, * returns {@link IRNdkErrCode} IMAGE_RESULT_ENCODE_FAILED - if image add pixel map fail. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_UNSUPPORT - if image hardware decode unsupported. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_FAILED - if hard decode failed. - * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if ipc error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if IPC error. * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. @@ -928,7 +928,7 @@ int32_t OH_ImageSource_ModifyImageProperty(const ImageSourceNative* native, * returns {@link IRNdkErrCode} IMAGE_RESULT_ENCODE_FAILED - image add pixel map fail. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_UNSUPPORT - if image hardware decode unsupported. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_FAILED - if hard decode failed. - * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if ipc error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if IPC error. * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. -- Gitee From d55f257aeeaba42aaaebc74e43e5fa98e84baa36 Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Sat, 31 Aug 2024 11:21:54 +0000 Subject: [PATCH 217/620] 11 Signed-off-by: hellohyh001 --- multimodalinput/kits/c/input/oh_input_manager.h | 1 - 1 file changed, 1 deletion(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index e66f2781e..5cedcc887 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -1361,7 +1361,6 @@ Input_Result OH_Input_GetAllSystemHotkeys(Input_Hotkey **hotkey, int32_t *count) * @return OH_Input_RegisterDeviceListener status code, specifically, * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} if listener is NULL; - * {@link INPUT_SERVICE_EXCEPTION} if the service is abnormal. * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ -- Gitee From 11baff980eef26581277ae9c8ae98dad6ce91917 Mon Sep 17 00:00:00 2001 From: z30053694 Date: Sun, 1 Sep 2024 12:16:21 +0800 Subject: [PATCH 218/620] fix: formatted Signed-off-by: z30053694 Change-Id: Ifcb1d125ed455ed9a81a4a107c0d9d60ce676731 --- BasicServicesKit/ohbattery_info.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/BasicServicesKit/ohbattery_info.h b/BasicServicesKit/ohbattery_info.h index 0083373a7..bb6e2a5d1 100644 --- a/BasicServicesKit/ohbattery_info.h +++ b/BasicServicesKit/ohbattery_info.h @@ -44,8 +44,23 @@ extern "C" { #endif /* __cplusplus */ +/** + * @brief a string that identifies the commen event sent after battery capacity changes + * @since 12 + * @version 1.0 + */ static const char* COMMON_EVENT_KEY_CAPACITY = "soc"; +/** + * @brief a string that identifies the commen event sent after charge state changes + * @since 12 + * @version 1.0 + */ static const char* COMMON_EVENT_KEY_CHARGE_STATE = "chargeState"; +/** + * @brief a string that identifies the commen event sent after plugged type changes + * @since 12 + * @version 1.0 + */ static const char* COMMON_EVENT_KEY_PLUGGED_TYPE = "pluggedType"; /** @@ -54,7 +69,6 @@ static const char* COMMON_EVENT_KEY_PLUGGED_TYPE = "pluggedType"; * @since 12 * @version 1.0 */ - typedef enum { /** * Power source is unplugged. @@ -94,7 +108,7 @@ int32_t OH_BatteryInfo_GetCapacity(); /** * @brief This API returns the current plugged type. * - * @Return {@link BatteryInfo_BatteryPluggedType#PLUGGED_TYPE_NONE} if the power source is unplugged. + * @return {@link BatteryInfo_BatteryPluggedType#PLUGGED_TYPE_NONE} if the power source is unplugged. * {@link PLUGGED_TYPE_AC} if the power source is an AC charger. * {@link PLUGGED_TYPE_USB} if the power source is an USB DC charger. * {@link PLUGGED_TYPE_WIRELESS} if the power source is wireless charger. @@ -103,9 +117,8 @@ int32_t OH_BatteryInfo_GetCapacity(); * @since 12 */ BatteryInfo_BatteryPluggedType OH_BatteryInfo_GetPluggedType(); - #ifdef __cplusplus } -/** @} */ #endif /* __cplusplus */ -#endif /* OHBATTERY_INFO_HEADER */ \ No newline at end of file +#endif /* OHBATTERY_INFO_HEADER */ +/** @} */ \ No newline at end of file -- Gitee From f17772d27725919dbae550eb23ba0284139bf983 Mon Sep 17 00:00:00 2001 From: shanhaiyang Date: Sat, 31 Aug 2024 21:19:40 +0800 Subject: [PATCH 219/620] =?UTF-8?q?=E5=A2=9E=E5=BE=AE=E4=BF=A1=E6=89=93?= =?UTF-8?q?=E5=8D=B0ndk=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shanhaiyang --- BasicServicesKit/ohprint.h | 129 +++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) diff --git a/BasicServicesKit/ohprint.h b/BasicServicesKit/ohprint.h index 9bb887d6b..32fa197f1 100644 --- a/BasicServicesKit/ohprint.h +++ b/BasicServicesKit/ohprint.h @@ -280,6 +280,28 @@ typedef enum { DOCUMENT_FORMAT_TEXT, } Print_DocumentFormat; +/** + * @brief Indicates the print job doc adapter state. + * + * @since 13 + */ +typedef enum { + /** Print job preview ability destroy. */ + PRINT_DOC_ADAPTER_PREVIEW_ABILITY_DESTROY = 0, + /** Print job task succeed. */ + PRINT_DOC_ADAPTER_PRINT_TASK_SUCCEED = 1, + /** Print job task failed. */ + PRINT_DOC_ADAPTER_PRINT_TASK_FAIL = 2, + /** Print job task cancel. */ + PRINT_DOC_ADAPTER_PRINT_TASK_CANCEL = 3, + /** Print job task block. */ + PRINT_DOC_ADAPTER_PRINT_TASK_BLOCK = 4, + /** Print job task preview ability destroy for cancel. */ + PRINT_DOC_ADAPTER_PREVIEW_ABILITY_DESTROY_FOR_CANCELED = 5, + /** Print job task preview ability destroy for started. */ + PRINT_DOC_ADAPTER_PREVIEW_ABILITY_DESTROY_FOR_STARTED = 6, +} Print_JobDocAdapterState; + /** * @brief Indicates printer capabilities. * @@ -422,6 +444,96 @@ typedef struct { char *advancedOptions; } Print_PrintJob; +/** + * @brief Indicates print range structure. + * + * @since 13 + */ +typedef struct { + /** Print start page. */ + uint32_t startPage; + /** Print end page. */ + uint32_t endPage; + /** Print page array length. */ + uint32_t pagesArrayLen; + /** Print page array. */ + uint32_t* pagesArray; +} Print_Range; + +/** + * @brief Indicates print attributes structure. + * + * @since 13 + */ +typedef struct { + /** Print ranges. */ + Print_Range pageRange; + /** Print page size. */ + Print_PageSize pageSize; + /** Print margin. */ + Print_Margin pageMargin; + /** Copy numbers. */ + uint32_t copyNumber; + /** Duplex mode. */ + uint32_t duplexMode; + /** color mode. */ + uint32_t colorMode; + /** Print sequential. */ + bool isSequential; + /** Print orient. */ + bool isLandscape; + /** Print option flag. */ + bool hasOption; + /** Print options. */ + char options[256]; +} Print_PrintAttributes; + +/** + * @brief Write files result callback. + * + * @param joibId The print job id of one print task. + * @param code The result of write files. + * @since 13 + */ +typedef void(*Print_WriteResultCallback)(const char *jobId, uint32_t code); + +/** + * @brief Print start layout callback. + * + * @param jobId The print job id of one print task. + * @param fd The file descriptor to be written. + * @param oldAttrs The attribute of last. + * @param newAttrs The attribute of current. + * @param writeCallback The Write files result callback. + * @since 13 + */ +typedef void(*Print_OnStartLayoutWrite)(const char *jobId, + uint32_t fd, + const Print_PrintAttributes *oldAttrs, + const Print_PrintAttributes *newAttrs, + Print_WriteResultCallback writeCallback); + +/** + * @brief Print job state callback. + * + * @param jobId The print job id of one print task. + * @param state The state of current print job. + * @since 13 + */ +typedef void(*Print_OnJobStateChanged)(const char *jobId, uint32_t state); + +/** + * @brief Indicates print doc state callback structure. + * + * @since 13 + */ +typedef struct { + /** Print start layout callback. */ + Print_OnStartLayoutWrite startLayoutWriteCb; + /** Print job state callback. */ + Print_OnJobStateChanged jobStateChangedCb; +} Print_PrintDocCallback; + /** * @brief Printer discovery callback. * @@ -659,6 +771,23 @@ Print_ErrorCode OH_Print_UpdatePrinterProperties(const char *printerId, const Pr */ Print_ErrorCode OH_Print_RestorePrinterProperties(const char *printerId, const Print_StringList *propertyKeyList); +/** + * @brief This API restores printer properties to default settings based on the list of property keywords. + * + * @permission {@code ohos.permission.PRINT} + * @param printJobName The name of this print job. + * @param printDocCallback The print doc state callback. + * @param context The context of caller app. + * @return Returns {@link Print_ErrorCode#PRINT_ERROR_NONE} if the execution is successful. + * {@link PRINT_ERROR_NO_PERMISSION} The permission {@code ohos.permission.PRINT} is needed. + * {@link PRINT_ERROR_RPC_FAILURE} Unable to connect to the print service. + * @syscap SystemCapability.Print.PrintFramework + * @since 13 + */ +Print_ErrorCode OH_Print_StartPrintByNative(const char *printJobName, + Print_PrintDocCallback printDocCallback, + void *context); + #ifdef __cplusplus } #endif -- Gitee From cb8ad0d0b483ded9f918a764e846779046c915f4 Mon Sep 17 00:00:00 2001 From: dujingcheng Date: Thu, 29 Aug 2024 14:02:35 +0000 Subject: [PATCH 220/620] dd Signed-off-by: dujingcheng --- arkui/ace_engine/native/libace.ndk.json | 24 ++++----- .../native/native_interface_accessibility.h | 52 +++++++++---------- 2 files changed, 36 insertions(+), 40 deletions(-) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 94884c361..108067435 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2147,14 +2147,6 @@ "first_introduced": "13", "name": "OH_ArkUI_AddAndGetAccessibilityElementInfo" }, - { - "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoPageId" - }, - { - "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoComponentId" - }, { "first_introduced": "13", "name": "OH_ArkUI_SetAccessibilityElementInfoParentId" @@ -2331,10 +2323,6 @@ "first_introduced": "13", "name": "OH_ArkUI_SetAccessibilityEventEventType" }, - { - "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityEventPageId" - }, { "first_introduced": "13", "name": "OH_ArkUI_SetAccessibilityEventTextAnnouncedForAccessibility" @@ -2351,8 +2339,20 @@ "first_introduced": "13", "name": "OH_ArkUI_FindAccessibilityActionArgumentByKey" }, + { + "first_introduced": "13", + "name": "OH_ArkUI_CreateAccessibilityElementInfo" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_DestoryAccessibilityElementInfo" + }, { "first_introduced": "13", "name": "OH_NativeXComponent_GetNativeAccessibilityProvider" + }, + { + "first_introduced": "13", + "name": "OH_ArkUI_SetAccessibilityElementInfoElementId" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_interface_accessibility.h b/arkui/ace_engine/native/native_interface_accessibility.h index 0fc10b641..3c0aafba1 100644 --- a/arkui/ace_engine/native/native_interface_accessibility.h +++ b/arkui/ace_engine/native/native_interface_accessibility.h @@ -17,7 +17,7 @@ * @addtogroup ArkUI_AccessibilityProvider * @{ * - * @brief + * @brief * * @since 13 * @version 1.0 @@ -26,7 +26,7 @@ /** * @file native_interface_accessibility.h * - * @brief + * @brief * * @since 13 * @version 1.0 @@ -361,26 +361,15 @@ void OH_ArkUI_SendAccessibilityAsyncEvent( ArkUI_AccessibilityElementInfo* OH_ArkUI_AddAndGetAccessibilityElementInfo(ArkUI_AccessibilityElementInfoList* list); /** -* @brief Sets the page id of the accessibility element information. +* @brief Sets the element id of the accessibility element information. * * @param elementInfo Indicates the pointer to the accessibility element information. -* @param pageId Indicates the page id. +* @param elementId Indicates the page id. * @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. * Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoPageId(ArkUI_AccessibilityElementInfo* elementInfo, int32_t pageId); - -/** -* @brief Sets the page id of the accessibility element information. -* -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param componentId Indicates the component id. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. -* @since 13 -*/ -int32_t OH_ArkUI_SetAccessibilityElementInfoComponentId(ArkUI_AccessibilityElementInfo* elementInfo, int32_t componentId); +int32_t OH_ArkUI_SetAccessibilityElementInfoElementId(ArkUI_AccessibilityElementInfo* elementInfo, int32_t elementId); /** * @brief Sets the parent id of the accessibility element information. @@ -833,6 +822,24 @@ int32_t OH_ArkUI_SetAccessibilityElementInfoBlur(ArkUI_AccessibilityElementInfo* */ int32_t OH_ArkUI_SetAccessibilityElementInfoHitTestBehavior(ArkUI_AccessibilityElementInfo* elementInfo, const char* hitTestBehavior); +/** + * @brief Create an accessibility elementInfo. + * + * @return Returns the pointer to the accessibility elementInfo. + * @since 13 + * @version 1.0 + */ +ArkUI_AccessibilityElementInfo* OH_ArkUI_CreateAccessibilityElementInfo(void); + +/** + * @brief Destorys an accessibility elementInfo. + * + * @param elementInfo Indicates the pointer to to the accessibility elementInfo info to be destoryed. + * @since 13 + * @version 1.0 + */ +void OH_ArkUI_DestoryAccessibilityElementInfo(ArkUI_AccessibilityElementInfo* elementInfo); + /** * @brief Create an accessibility eventInfo. * @@ -862,17 +869,6 @@ void OH_ArkUI_DestoryAccessibilityEventInfo(ArkUI_AccessibilityEventInfo* eventI */ int32_t OH_ArkUI_SetAccessibilityEventEventType(ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityEventType eventType); -/** -* @brief Sets the pageId of the accessibility event information. -* -* @param eventInfo Indicates the pointer to the accessibility event information. -* @param pageId Indicates page id. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. -* @since 13 -*/ -int32_t OH_ArkUI_SetAccessibilityEventPageId(ArkUI_AccessibilityEventInfo* eventInfo, int32_t pageId); - /** * @brief Sets the textAnnouncedForAccessibility of the accessibility event information. * @@ -916,7 +912,7 @@ int32_t OH_ArkUI_SetAccessibilityEventElementInfo(ArkUI_AccessibilityEventInfo* * Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. * @since 13 */ -int32_t OH_ArkUI_FindAccessibilityActionArgumentByKey(ArkUI_AccessibilityActionArguments* arguments, const char* key, char* value); +int32_t OH_ArkUI_FindAccessibilityActionArgumentByKey(ArkUI_AccessibilityActionArguments* arguments, const char* key, char** value); #ifdef __cplusplus }; #endif -- Gitee From b54a92fcc0f56950a24a2485e9f2f5b28639ad5e Mon Sep 17 00:00:00 2001 From: s00659936 <282229496@qq.com> Date: Thu, 29 Aug 2024 19:08:02 +0800 Subject: [PATCH 221/620] =?UTF-8?q?=E6=96=B0=E5=A2=9Etelephony=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=9A=84ndk=E6=8E=A5=E5=8F=A3=EF=BC=8C=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=BB=98=E8=AE=A4=E4=B8=BB=E5=8D=A1ID=E5=92=8C?= =?UTF-8?q?=E7=BD=91=E7=BB=9C=E5=88=B6=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SJH <282229496@qq.com> Change-Id: I094500f3d3201fd199676a7bcc277973e9693b39 --- telephony/cellular_data/BUILD.gn | 29 ++++ .../cellular_data/include/telephony_data.h | 49 ++++++ .../cellular_data/libtelephony_data.json | 6 + telephony/core_service/BUILD.gn | 35 ++++ .../core_service/include/telephony_radio.h | 74 +++++++++ .../include/telephony_radio_type.h | 157 ++++++++++++++++++ .../core_service/libtelephony_radio.json | 10 ++ 7 files changed, 360 insertions(+) create mode 100755 telephony/cellular_data/BUILD.gn create mode 100755 telephony/cellular_data/include/telephony_data.h create mode 100755 telephony/cellular_data/libtelephony_data.json create mode 100755 telephony/core_service/BUILD.gn create mode 100755 telephony/core_service/include/telephony_radio.h create mode 100755 telephony/core_service/include/telephony_radio_type.h create mode 100755 telephony/core_service/libtelephony_radio.json diff --git a/telephony/cellular_data/BUILD.gn b/telephony/cellular_data/BUILD.gn new file mode 100755 index 000000000..de7e9f095 --- /dev/null +++ b/telephony/cellular_data/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") + +ohos_ndk_library("libtelephony_data") { + output_name = "telephony_data" + output_extension = "so" + ndk_description_file = "./libtelephony_data.json" + min_compact_version = "1" + system_capability = "SystemCapability.Telephony.CellularData" + + system_capability_headers = [ "telephony/cellular_data/telephony_data.h" ] +} + +ohos_ndk_headers("telephony_data_header") { + dest_dir = "$ndk_headers_out_dir/telephony/cellular_data" + sources = [ "include/telephony_data.h" ] +} diff --git a/telephony/cellular_data/include/telephony_data.h b/telephony/cellular_data/include/telephony_data.h new file mode 100755 index 000000000..801f8e819 --- /dev/null +++ b/telephony/cellular_data/include/telephony_data.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef NATIVE_TELEPHONY_DATA_API_H +#define NATIVE_TELEPHONY_DATA_API_H + +/** + * @file telephony_data.h + * + * @brief Provides C interface for the telephony cellular data. + * + * @kit TelephonyKit + * @syscap SystemCapability.Telephony.CellularData + * @library libtelephony_data.so + * @since 13 + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Obtains the default cellular data slot id. + * + * @return the default cellular data slot id (0 for slot 1, 1 for slot 2). + * @syscap SystemCapability.Telephony.CellularData + * @since 13 + */ +int32_t OH_Telephony_GetDefaultCellularDataSlotId(void); + +#ifdef __cplusplus +} +#endif + +#endif // NATIVE_TELEPHONY_DATA_API_H diff --git a/telephony/cellular_data/libtelephony_data.json b/telephony/cellular_data/libtelephony_data.json new file mode 100755 index 000000000..03c3f92a8 --- /dev/null +++ b/telephony/cellular_data/libtelephony_data.json @@ -0,0 +1,6 @@ +[ + { + "first_introduced":"13", + "name": "OH_Telephony_GetDefaultCellularDataSlotId" + } +] diff --git a/telephony/core_service/BUILD.gn b/telephony/core_service/BUILD.gn new file mode 100755 index 000000000..9e4fe5307 --- /dev/null +++ b/telephony/core_service/BUILD.gn @@ -0,0 +1,35 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") + +ohos_ndk_library("libtelephony_radio") { + output_name = "telephony_radio" + output_extension = "so" + ndk_description_file = "./libtelephony_radio.json" + min_compact_version = "1" + system_capability = "SystemCapability.Telephony.CoreService" + + system_capability_headers = [ + "telephony/core_service/telephony_radio.h", + "telephony/core_service/telephony_radio_type.h", + ] +} + +ohos_ndk_headers("telephony_radio_header") { + dest_dir = "$ndk_headers_out_dir/telephony/core_service" + sources = [ + "include/telephony_radio.h", + "include/telephony_radio_type.h", + ] +} diff --git a/telephony/core_service/include/telephony_radio.h b/telephony/core_service/include/telephony_radio.h new file mode 100755 index 000000000..26746d4be --- /dev/null +++ b/telephony/core_service/include/telephony_radio.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef NATIVE_TELEPHONY_RADIO_API_H +#define NATIVE_TELEPHONY_RADIO_API_H + +/** + * @file telephony_radio.h + * + * @brief Provides C interface for the telephony radio. + * + * @kit TelephonyKit + * @syscap SystemCapability.Telephony.CoreService + * @library libtelephony_radio.so + * @since 13 + */ + +#include "telephony_radio_type.h" +#include "stdint.h" + +#ifdef __cplusplus +extern "C" { +#endif +/** + * @brief Obtains the radio network state. + * + * @param state Pointer to the network state. + * @return the result defines in {@link Telephony_RadioResult}. + * {@link TEL_RADIO_SUCCESS} Success. + * {@link TEL_RADIO_PERMISSION_DENIED} Permission denied. + * {@link TEL_RADIO_ERR_MARSHALLING_FAILED} Low probability Marshalling failed, try again later. + * {@link TEL_RADIO_ERR_SERVICE_CONNECTION_FAILED} Unable to connect to telephony service, try again later. + * {@link TEL_RADIO_ERR_OPERATION_FAILED} Operation failed in telephony service, try again later. + * {@link TEL_RADIO_ERR_INVALID_PARAM} Invalid parameter. + * @permission ohos.permission.GET_NETWORK_INFO + * @syscap SystemCapability.Telephony.CoreService + * @since 13 + */ +Telephony_RadioResult OH_Telephony_GetNetworkState(Telephony_NetworkState *state); + +/** + * @brief Obtains the radio network state for given slot id. + * + * @param slotId the number of slot, 0 for card slot 1, 1 for card slot 2. + * @param state Pointer to the network state. + * @return the result defines in {@link Telephony_RadioResult}. + * {@link TEL_RADIO_SUCCESS} Success. + * {@link TEL_RADIO_PERMISSION_DENIED} Permission denied. + * {@link TEL_RADIO_ERR_MARSHALLING_FAILED} Low probability Marshalling failed, try again later. + * {@link TEL_RADIO_ERR_SERVICE_CONNECTION_FAILED} Unable to connect to telephony service, try again later. + * {@link TEL_RADIO_ERR_OPERATION_FAILED} Operation failed in telephony service, try again later. + * {@link TEL_RADIO_ERR_INVALID_PARAM} Invalid parameter. + * @permission ohos.permission.GET_NETWORK_INFO + * @syscap SystemCapability.Telephony.CoreService + * @since 13 + */ +Telephony_RadioResult OH_Telephony_GetNetworkStateForSlot(int32_t slotId, Telephony_NetworkState *state); +#ifdef __cplusplus +} +#endif + +#endif // NATIVE_TELEPHONY_RADIO_API_H diff --git a/telephony/core_service/include/telephony_radio_type.h b/telephony/core_service/include/telephony_radio_type.h new file mode 100755 index 000000000..15877c912 --- /dev/null +++ b/telephony/core_service/include/telephony_radio_type.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef NATIVE_TELEPHONY_RADIO_TYPE_H +#define NATIVE_TELEPHONY_RADIO_TYPE_H + +/** + * @file telephony_radio_type.h + * + * @brief Provides the data structures for the C APIs of the the telephony radio. + * + * @kit TelephonyKit + * @syscap SystemCapability.Telephony.CoreService + * @library libtelephony_radio.so + * @since 13 + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#define TELEPHONY_MAX_OPERATOR_LEN 64 +#define TELEPHONY_MAX_PLMN_NUMERIC_LEN 6 + +/** + * @brief Result code. + * + * @since 13 + */ +typedef enum { + /* @error success */ + TEL_RADIO_SUCCESS = 0, + /* @error permission denied */ + TEL_RADIO_PERMISSION_DENIED = 201, + /* @error invalid parameter */ + TEL_RADIO_ERR_INVALID_PARAM = 401, + /* @error marshalling failed, this is a low probability error, try again later when get this error */ + TEL_RADIO_ERR_MARSHALLING_FAILED = 8300001, + /* @error unable to connect to telephony service, try again later when get this error */ + TEL_RADIO_ERR_SERVICE_CONNECTION_FAILED = 8300002, + /* @error operation failed in telephony service, try again later when get this error */ + TEL_RADIO_ERR_OPERATION_FAILED = 8300003, +} Telephony_RadioResult; + +/** + * @brief network registration status. + * + * @since 13 + */ +typedef enum { + /* can not use any services */ + TEL_REG_STATE_NO_SERVICE = 0, + /* can use services properly */ + TEL_REG_STATE_IN_SERVICE = 1, + /* can use emergency call only */ + TEL_REG_STATE_EMERGENCY_CALL_ONLY = 2, + /* radio power off */ + TEL_REG_STATE_POWER_OFF = 3, +} Telephony_RegState; + +/** + * @brief radio access technologies. + * + * @since 13 + */ +typedef enum { + /* Unknown radio technology */ + TEL_RADIO_TECHNOLOGY_UNKNOWN = 0, + /* Global System for Mobile Communication (GSM) */ + TEL_RADIO_TECHNOLOGY_GSM = 1, + /* Single-Carrier Radio Transmission Technology (1XRTT) */ + TEL_RADIO_TECHNOLOGY_1XRTT = 2, + /* Wideband Code Division Multiple Access (WCDMA) */ + TEL_RADIO_TECHNOLOGY_WCDMA = 3, + /* High Speed Packet Access (HSPA) */ + TEL_RADIO_TECHNOLOGY_HSPA = 4, + /* Evolved High Speed Packet Access (HSPA+) */ + TEL_RADIO_TECHNOLOGY_HSPAP = 5, + /* Time Division-Synchronous Code Division Multiple Access(TD-SCDMA) */ + TEL_RADIO_TECHNOLOGY_TD_SCDMA = 6, + /* Evolution-Data Optimized (EVDO) */ + TEL_RADIO_TECHNOLOGY_EVDO = 7, + /* Evolved High Rate Package Data (EHRPD) */ + TEL_RADIO_TECHNOLOGY_EHRPD = 8, + /* Long Term Evolution (LTE) */ + TEL_RADIO_TECHNOLOGY_LTE = 9, + /* Long Term Evolution_Carrier Aggregation (LTE_CA) */ + TEL_RADIO_TECHNOLOGY_LTE_CA = 10, + /* Industrial Wireless LAN (IWLAN) */ + TEL_RADIO_TECHNOLOGY_IWLAN = 11, + /* New Radio (NR) */ + TEL_RADIO_TECHNOLOGY_NR = 12, +} Telephony_RadioTechnology; + +/** + * @brief NSA network state. + * + * @since 13 + */ +typedef enum { + /* The device is in idle or connected state in an LTE cell that does not support NSA */ + TEL_NSA_STATE_NOT_SUPPORTED = 1, + /* The device is in the idle state in an LTE cell that supports NSA but not NR coverage detection */ + TEL_NSA_STATE_NO_DETECTED = 2, + /* The device is connected to the LTE network in an LTE cell that supports NSA and NR coverage detection */ + TEL_NSA_STATE_CONNECTED_DETECTED = 3, + /* The device is in the idle state in an LTE cell that supports NSA and NR coverage detection */ + TEL_NSA_STATE_IDLE_DETECTED = 4, + /* The device is connected to the LTE/NR network in an LTE cell that supports NSA */ + TEL_NSA_STATE_DUAL_CONNECTED = 5, + /* The device is idle or connected to the NG-RAN cell when being attached to the 5G Core */ + TEL_NSA_STATE_SA_ATTACHED = 6, +} Telephony_NsaState; + +/** + * @brief Network status. + * + * @since 13 + */ +typedef struct { + /* Long carrier name of the registered network */ + char longOperatorName_[TELEPHONY_MAX_OPERATOR_LEN]; + /* Short carrier name of the registered network */ + char shortOperatorName_[TELEPHONY_MAX_OPERATOR_LEN]; + /* PLMN code of the registered network */ + char plmnNumeric_[TELEPHONY_MAX_PLMN_NUMERIC_LEN]; + /* Whether in roaming */ + bool isRoaming_; + /* Network registration status */ + Telephony_RegState regState_; + /* Radio technology. */ + Telephony_RadioTechnology cfgTech_; + /* NSA state */ + Telephony_NsaState nsaState_; + /* Whether Carrier Aggregation(CA) is active */ + bool isCaActive_; + /* Whether in emergency call only */ + bool isEmergency_; +} Telephony_NetworkState; + +#ifdef __cplusplus +} +#endif + +#endif // NATIVE_TELEPHONY_RADIO_TYPE_H diff --git a/telephony/core_service/libtelephony_radio.json b/telephony/core_service/libtelephony_radio.json new file mode 100755 index 000000000..b08040815 --- /dev/null +++ b/telephony/core_service/libtelephony_radio.json @@ -0,0 +1,10 @@ +[ + { + "first_introduced":"13", + "name": "OH_Telephony_GetNetworkState" + }, + { + "first_introduced":"13", + "name": "OH_Telephony_GetNetworkStateForSlot" + } +] -- Gitee From 339875e7053ef4a2ad1e4eb5343492ccd24000f8 Mon Sep 17 00:00:00 2001 From: z30053694 Date: Mon, 2 Sep 2024 11:12:17 +0800 Subject: [PATCH 222/620] fix: changed @since to version 13 and fix typos Signed-off-by: z30053694 Change-Id: I2d6edf8ed5c0fa9bfb0b177ee7f1665c9121c2c9 fix: changed version to 13 and fix typos Signed-off-by: z30053694 Change-Id: I1546a6df07010199b20a790740364f0747a47c94 fix: added comment Signed-off-by: z30053694 Change-Id: I26f987cdd7dc69daf1c8cb27782e984fd1d3f8d6 fix: typos Signed-off-by: z30053694 Change-Id: I9b667f4de5b6bf8262ed7987d696ea5b5e4881a7 --- BasicServicesKit/BUILD.gn | 2 +- BasicServicesKit/ohbattery_info.h | 34 ++++++++++++------------ BasicServicesKit/ohbattery_info.ndk.json | 6 ++--- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/BasicServicesKit/BUILD.gn b/BasicServicesKit/BUILD.gn index 2c6fa0d7e..11168e057 100644 --- a/BasicServicesKit/BUILD.gn +++ b/BasicServicesKit/BUILD.gn @@ -101,7 +101,7 @@ ohos_ndk_library("libohbattery_info_ndk") { output_name = "ohbattery_info" output_extension = "so" ndk_description_file = "./ohbattery_info.ndk.json" - min_compact_version = "12" + min_compact_version = "13" system_capability = "SystemCapability.PowerManager.BatteryManager.Core" system_capability_headers = [ "BasicServicesKit/ohbattery_info.h" ] } diff --git a/BasicServicesKit/ohbattery_info.h b/BasicServicesKit/ohbattery_info.h index bb6e2a5d1..38f289a38 100644 --- a/BasicServicesKit/ohbattery_info.h +++ b/BasicServicesKit/ohbattery_info.h @@ -20,19 +20,19 @@ * @brief Provides the definition of the C interface for the BatteryInfo module. * * @syscap SystemCapability.PowerManager.BatteryManager.Core - * @since 12 + * @since 13 * @version 1.0 */ /** * @file ohbattery_info.h * - * @brief Declares the APIs to discover and connect printers, print files from a printer, - * query the list of the added printers and the printer information within it, and so on. + * @brief Declares the APIs to get informations about the current battery capacity and the power source type, + * defines strings that identify corresponding common events. * * @library libohbattery_info.so * @kit BasicServicesKit * @syscap SystemCapability.PowerManager.BatteryManager.Core - * @since 12 + * @since 13 * @version 1.0 */ #ifndef OHBATTERY_INFO_HEADER @@ -45,20 +45,20 @@ extern "C" { #endif /* __cplusplus */ /** - * @brief a string that identifies the commen event sent after battery capacity changes - * @since 12 + * @brief A string that identifies the common event sent after battery capacity changes. + * @since 13 * @version 1.0 */ static const char* COMMON_EVENT_KEY_CAPACITY = "soc"; /** - * @brief a string that identifies the commen event sent after charge state changes - * @since 12 + * @brief A string that identifies the common event sent after charge state changes. + * @since 13 * @version 1.0 */ static const char* COMMON_EVENT_KEY_CHARGE_STATE = "chargeState"; /** - * @brief a string that identifies the commen event sent after plugged type changes - * @since 12 + * @brief A string that identifies the common event sent after plugged type changes. + * @since 13 * @version 1.0 */ static const char* COMMON_EVENT_KEY_PLUGGED_TYPE = "pluggedType"; @@ -66,7 +66,7 @@ static const char* COMMON_EVENT_KEY_PLUGGED_TYPE = "pluggedType"; /** * @brief Defines plugged types. * - * @since 12 + * @since 13 * @version 1.0 */ typedef enum { @@ -99,9 +99,9 @@ typedef enum { /** * @brief This API returns the current battery capacity. * - * @return Returns number betweem 0 and 100. - * @syscap ystemCapability.PowerManager.BatteryManager.Core - * @since 12 + * @return Returns number between 0 and 100. + * @syscap SystemCapability.PowerManager.BatteryManager.Core + * @since 13 */ int32_t OH_BatteryInfo_GetCapacity(); @@ -113,12 +113,12 @@ int32_t OH_BatteryInfo_GetCapacity(); * {@link PLUGGED_TYPE_USB} if the power source is an USB DC charger. * {@link PLUGGED_TYPE_WIRELESS} if the power source is wireless charger. * {@link PLUGGED_TYPE_BUTT} if the type is unknown. - * @syscap ystemCapability.PowerManager.BatteryManager.Core - * @since 12 + * @syscap SystemCapability.PowerManager.BatteryManager.Core + * @since 13 */ BatteryInfo_BatteryPluggedType OH_BatteryInfo_GetPluggedType(); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* OHBATTERY_INFO_HEADER */ -/** @} */ \ No newline at end of file +/** @} */ diff --git a/BasicServicesKit/ohbattery_info.ndk.json b/BasicServicesKit/ohbattery_info.ndk.json index 947048fdb..ffe1e95d2 100644 --- a/BasicServicesKit/ohbattery_info.ndk.json +++ b/BasicServicesKit/ohbattery_info.ndk.json @@ -1,8 +1,8 @@ [ - { "first_introduced": "12", + { "first_introduced": "13", "name":"OH_BatteryInfo_GetCapacity" }, - { "first_introduced": "12", + { "first_introduced": "13", "name":"OH_BatteryInfo_GetPluggedType" } -] \ No newline at end of file +] -- Gitee From ebd86cb1ddf716f6513fa8e4726be344bc28269f Mon Sep 17 00:00:00 2001 From: zwtmichael Date: Wed, 28 Aug 2024 20:13:01 +0800 Subject: [PATCH 223/620] add preferences interface Signed-off-by: zwtmichael --- distributeddatamgr/preferences/BUILD.gn | 42 ++ .../preferences/include/oh_preferences.h | 555 ++++++++++++++++++ .../preferences/libpreferences.ndk.json | 338 +++++++++++ 3 files changed, 935 insertions(+) create mode 100644 distributeddatamgr/preferences/BUILD.gn create mode 100644 distributeddatamgr/preferences/include/oh_preferences.h create mode 100644 distributeddatamgr/preferences/libpreferences.ndk.json diff --git a/distributeddatamgr/preferences/BUILD.gn b/distributeddatamgr/preferences/BUILD.gn new file mode 100644 index 000000000..73e26a566 --- /dev/null +++ b/distributeddatamgr/preferences/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") +import("//foundation/distributeddatamgr/preferences/preferences.gni") + +ohos_ndk_headers("preferences_ndk_header") { + dest_dir = "$ndk_headers_out_dir/database/preferences/" + sources = [ + "./include/udmf.h", + "./include/udmf_err_code.h", + "./include/udmf_meta.h", + "./include/uds.h", + "./include/utd.h", + ] +} + +ohos_ndk_library("libpreferences") { + output_name = "udmf" + output_extension = "so" + system_capability = "SystemCapability.DistributedDataManager.Preferences.Core" + ndk_description_file = "./libpreferences.ndk.json" + min_compact_version = "13" + system_capability_headers = [ + "$ndk_headers_out_dir/database/preferences/udmf_err_code.h", + "$ndk_headers_out_dir/database/preferences/udmf_meta.h", + "$ndk_headers_out_dir/database/preferences/udmf.h", + "$ndk_headers_out_dir/database/preferences/uds.h", + "$ndk_headers_out_dir/database/preferences/utd.h", + ] +} diff --git a/distributeddatamgr/preferences/include/oh_preferences.h b/distributeddatamgr/preferences/include/oh_preferences.h new file mode 100644 index 000000000..da57b22be --- /dev/null +++ b/distributeddatamgr/preferences/include/oh_preferences.h @@ -0,0 +1,555 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup PREFERENCES + * @{ + * + * @brief The preference manages data based on relational models. + * The Preferences module provides APIs for processing data in the form of key-value (KV) pairs, including querying, + * modifying, and persisting KV pairs. The key is of the string type, and the value can be a number, a string, + * a Boolean value, or an array of numbers, strings, or Boolean values. + * + * @since 13 + */ + +/** + * @file oh_preferences.h + * + * @brief Provides preferences related functions and enumerations. + * + * @kit ArkData + * @syscap SystemCapability.DistributedDataManager.Preferences.Core + * + * @since 12 + */ + +#ifndef OH_PREFERENCES_H +#define OH_PREFERENCES_H + +#include +#include +#include "uds.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Describes the unified preferences type. + * + * @since 13 + */ +typedef struct OH_Preferences OH_Preferences; + +/** + * @brief The callback function of data observer event. + * + * @param context Represents the context of data observer. + * @param pairs Indicates the key and value pairs that changed. + * @param count The count of changed pair accounts. + * @since 13 + */ +typedef void (*PreferencesDataObserver)(void *context, const OH_PreferencesPair *pairs, uint32_t count); + +/** + * @brief open the preferences object + * + * @param option Represents a pointer to an {@link OH_PreferencesOption} instance. + * @param errCode Represents a pointer to the status code of the execution. This parameter is the output parameter, + * See {@link OH_Preferences_ErrCode}. + * @return Returns preferences object pointer that in {@link OH_Preferences} when input parameters valid, + * otherwise return nullptr. + * @since 13 + */ +OH_Preferences *OH_Preferences_Open(OH_PreferencesOptions *option, int *errCode); + +/** + * @brief close the preferences object + * + * @param option Represents a pointer to an {@link OH_PreferencesOption} instance. + * @return Returns the status code of the execution. See {@link OH_Preferences_ErrCode}. + * @since 13 + */ +int OH_Preferences_Close(OH_PreferencesOptions *store); + +/** + * @brief Gets the value by the in preferences object. + * + * @param key Indicates the target key of the preferences. + * @param value Indicates the value that is get . + * @return Returns the status code of the execution. + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * @see PreferencesStore. + * @since 13 + */ +int OH_Preferences_GetInt(PreferencesStore *store, const char *key, int *value); + +/** + * @brief Get the value by key from a preference. + * + * @param store Represents a pointer to an {@link PreferencesStore} instance. + * @param key Indicates the key of the preferences. + * @param errCode This parameter is the output parameter, + * and the execution status of a function is written to this variable. + * @return Returns value {@link OH_PreferencesValue} object. + * @see PreferencesStore, OH_PreferencesValue + * @since 13 + */ +int OH_Preferences_GetBool(PreferencesStore *store, const char *key, bool *value); + +/** + * @brief Gets the version of a database. + * + * @param store Represents a pointer to an {@link PreferencesStore} instance. + * @param key Indicates the key of the preferences. + * @return Returns the status code of the execution. + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * @see PreferencesStore. + * @since 13 + */ +int OH_Preferences_GetString(PreferencesStore *store, const char *key, char **value); + +/** + * @brief Describes the unified data type. + * + * @since 12 + */ +typedef struct OH_UdmfData OH_UdmfData; + +/** + * @brief Describes the record type in the unified data. + * + * @since 12 + */ +typedef struct OH_UdmfRecord OH_UdmfRecord; + +/** + * @brief Describes some property parameters of unified data. + * + * @since 12 + */ +typedef struct OH_UdmfProperty OH_UdmfProperty; + +/** + * @brief Creation a pointer to the instance of the {@link OH_UdmfData}. + * + * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfData} + * structure is returned. If the operation is failed, nullptr is returned. + * @see OH_UdmfData. + * @since 12 + */ +OH_UdmfData* OH_UdmfData_Create(); + +/** + * @brief Destroy a pointer that points to the {@link OH_UdmfData} instance. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. + * @see OH_UdmfData. + * @since 12 + */ +void OH_UdmfData_Destroy(OH_UdmfData* pThis); + +/** + * @brief Add one {OH_UdmfRecord} record to the {@link OH_UdmfData} data. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. + * @param record Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @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_UdmfData Udmf_ErrCode. + * @since 12 + */ +int OH_UdmfData_AddRecord(OH_UdmfData* pThis, OH_UdmfRecord* record); + +/** + * @brief Check whether the type exists in the {@link OH_UdmfData} data. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. + * @param type Represents a string pointer of the type. + * @return Returns the status of finding type. + * {@code false} is not existed. + * {@code true} is existed. + * @see OH_UdmfData. + * @since 12 + */ +bool OH_UdmfData_HasType(OH_UdmfData* pThis, const char* type); + +/** + * @brief Get all types in the {@link OH_UdmfData} data. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. + * @param count Represents the types count that is a output param. + * @return Returns string array that in {@link OH_UdmfData} when input parameters valid, + * otherwise return nullptr. + * @see OH_UdmfData. + * @since 12 + */ +char** OH_UdmfData_GetTypes(OH_UdmfData* pThis, unsigned int* count); + +/** + * @brief Get all records in the {@link OH_UdmfData} data. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. + * @param count Represents the records count that is a output param. + * @return Returns {@link OH_UdmfRecord} pointer array when input parameters valid, otherwise return nullptr. + * @see OH_UdmfData OH_UdmfRecord. + * @since 12 + */ +OH_UdmfRecord** OH_UdmfData_GetRecords(OH_UdmfData* pThis, unsigned int* count); + +/** + * @brief Creation a pointer to the instance of the {@link OH_UdmfRecord}, it's relate with UDS data. + * + * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfRecord} + * structure is returned. If the operation is failed, nullptr is returned. + * @see OH_UdmfRecord. + * @since 12 + */ +OH_UdmfRecord* OH_UdmfRecord_Create(); + +/** + * @brief Destroy a pointer that points to an instance of {@link OH_UdmfRecord}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @see OH_UdmfRecord. + * @since 12 + */ +void OH_UdmfRecord_Destroy(OH_UdmfRecord* pThis); + +/** + * @brief Add one custom data to the {@link OH_UdmfRecord} record. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @param typeId Represents record type, reference udmf_meta.h. + * @param entry Represents custom data. + * @param count Represents the size of data param. + * @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 Udmf_ErrCode. + * @since 12 + */ +int OH_UdmfRecord_AddGeneralEntry(OH_UdmfRecord* pThis, const char* typeId, unsigned char* entry, unsigned int count); + +/** + * @brief Add one {OH_UdsPlainText} data to the {@link OH_UdmfRecord} record. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @param plainText Represents a pointer to an instance of {@link OH_UdsPlainText}. + * @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_UdsPlainText Udmf_ErrCode. + * @since 12 + */ +int OH_UdmfRecord_AddPlainText(OH_UdmfRecord* pThis, OH_UdsPlainText* plainText); + +/** + * @brief Add one {OH_UdsHyperlink} data to the {@link OH_UdmfRecord} record. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @param hyperlink Represents a pointer to an instance of {@link OH_UdsHyperlink}. + * @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_UdsHyperlink Udmf_ErrCode. + * @since 12 + */ +int OH_UdmfRecord_AddHyperlink(OH_UdmfRecord* pThis, OH_UdsHyperlink* hyperlink); + +/** + * @brief Add one {OH_UdsHtml} data to the {@link OH_UdmfRecord} record. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @param html Represents a pointer to an instance of {@link OH_UdsHtml}. + * @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_UdsHtml Udmf_ErrCode. + * @since 12 + */ +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 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. + * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. + * @see OH_UdmfRecord OH_UdsAppItem Udmf_ErrCode. + * @since 12 + */ +int OH_UdmfRecord_AddAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem); + +/** + * @brief Get all types in the {@link OH_UdmfRecord} record. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @param count Represents the types count that is a output param. + * @return Returns string array that in {@link OH_UdmfRecord} when input parameters valid, + * otherwise return nullptr. + * @see OH_UdmfRecord. + * @since 12 + */ +char** OH_UdmfRecord_GetTypes(OH_UdmfRecord* pThis, unsigned int* count); + +/** + * @brief Get one entry data from the {@link OH_UdmfRecord} record. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @param typeId Represents record type, reference udmf_meta.h. + * @param entry Represents a pointer to entry data that is a output param. + * @param count Represents the entry data length that is a output param. + * @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} Internal data error. + * @see OH_UdmfRecord Udmf_ErrCode. + * @since 12 + */ +int OH_UdmfRecord_GetGeneralEntry(OH_UdmfRecord* pThis, const char* typeId, + unsigned char** entry, unsigned int* count); + +/** + * @brief Get one {OH_UdsPlainText} data from the {@link OH_UdmfRecord} record. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @param plainText Represents a pointer to an instance of {@link OH_UdsPlainText}. + * @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} Internal data error. + * @see OH_UdmfRecord OH_UdsPlainText Udmf_ErrCode. + * @since 12 + */ +int OH_UdmfRecord_GetPlainText(OH_UdmfRecord* pThis, OH_UdsPlainText* plainText); + +/** + * @brief Get one {OH_UdsHyperlink} data from the {@link OH_UdmfRecord} record. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @param hyperlink Represents a pointer to an instance of {@link OH_UdsHyperlink}. + * @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} Internal data error. + * @see OH_UdmfRecord OH_UdsHyperlink Udmf_ErrCode. + * @since 12 + */ +int OH_UdmfRecord_GetHyperlink(OH_UdmfRecord* pThis, OH_UdsHyperlink* hyperlink); + +/** + * @brief Get one {OH_UdsHtml} data from the {@link OH_UdmfRecord} record. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @param html Represents a pointer to an instance of {@link OH_UdsHtml}. + * @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} Internal data error. + * @see OH_UdmfRecord OH_UdsHtml Udmf_ErrCode. + * @since 12 + */ +int OH_UdmfRecord_GetHtml(OH_UdmfRecord* pThis, OH_UdsHtml* html); + +/** + * @brief Get one {OH_UdsAppItem} data from the {@link OH_UdmfRecord} record. + * + * @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. + * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. + * {@link UDMF_ERR} Internal data error. + * @see OH_UdmfRecord OH_UdsAppItem Udmf_ErrCode. + * @since 12 + */ +int OH_UdmfRecord_GetAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem); + +/** + * @brief Creation a pointer to the instance of the {@link OH_UdmfProperty} + * from a {@link OH_UdmfData} data. + * + * @param unifiedData Represents a pointer to an instance of {@link OH_UdmfData}. + * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfProperty} + * structure is returned. If the operation is failed, nullptr is returned. + * @see OH_UdmfData OH_UdmfProperty. + * @since 12 + */ +OH_UdmfProperty* OH_UdmfProperty_Create(OH_UdmfData* unifiedData); + +/** + * @brief Destroy a pointer that points to the {@link OH_UdmfProperty} instance. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. + * @see OH_UdmfProperty. + * @since 12 + */ +void OH_UdmfProperty_Destroy(OH_UdmfProperty* pThis); + +/** + * @brief Get tag value from the {@link OH_UdmfProperty}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. + * @return Returns a pointer of the tag value string when input parameters valid, otherwise return nullptr. + * @see OH_UdmfProperty. + * @since 12 + */ +const char* OH_UdmfProperty_GetTag(OH_UdmfProperty* pThis); + +/** + * @brief Get timestamp value from the {@link OH_UdmfProperty}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. + * @return Returns timestamp value. + * @see OH_UdmfProperty + * @since 12 + */ +int64_t OH_UdmfProperty_GetTimestamp(OH_UdmfProperty* pThis); + +/** + * @brief Get share option value from the {@link OH_UdmfProperty}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. + * @return Returns {@link Udmf_ShareOption} value. + * @see OH_UdmfProperty Udmf_ShareOption + * @since 12 + */ +Udmf_ShareOption OH_UdmfProperty_GetShareOption(OH_UdmfProperty* pThis); + +/** + * @brief Get integer value by key from the {@link OH_UdmfProperty}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. + * @param key Represents key-value pair's key + * @param defaultValue Represents when get value failure. + * @return Returns value associated with the key in successfully, otherwise return defaultValue. + * @see OH_UdmfProperty. + * @since 12 + */ +int OH_UdmfProperty_GetExtrasIntParam(OH_UdmfProperty* pThis, + const char* key, int defaultValue); + +/** + * @brief Get tag value from the {@link OH_UdmfProperty}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. + * @param key Represents key-value pair's key. + * @return Returns a pointer of the key value string when input parameters valid, otherwise return nullptr. + * @see OH_UdmfProperty + * @since 12 + */ +const char* OH_UdmfProperty_GetExtrasStringParam(OH_UdmfProperty* pThis, const char* key); + +/** + * @brief Set tag value to {@link OH_UdmfProperty} . + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. + * @param tag Represents new tag param. + * @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_UdmfProperty Udmf_ErrCode. + * @since 12 + */ +int OH_UdmfProperty_SetTag(OH_UdmfProperty* pThis, const char* tag); + +/** + * @brief Set Udmf_ShareOption value to {@link OH_UdmfProperty}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. + * @param option Represents new {@link Udmf_ShareOption} param. + * @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_UdmfProperty Udmf_ShareOption Udmf_ErrCode. + * @since 12 + */ +int OH_UdmfProperty_SetShareOption(OH_UdmfProperty* pThis, Udmf_ShareOption option); + +/** + * @brief Set extras param to {@link OH_UdmfProperty}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. + * @param key Represents extras param's key value. + * @param param Represents value of k-v pairs. + * @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_UdmfProperty Udmf_ErrCode. + * @since 12 + */ +int OH_UdmfProperty_SetExtrasIntParam(OH_UdmfProperty* pThis, const char* key, int param); + +/** + * @brief Set extras param to {@link OH_UdmfProperty}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. + * @param key Represents extras param's key value. + * @param param Represents value of k-v pairs. + * @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_UdmfProperty Udmf_ErrCode. + * @since 12 + */ +int OH_UdmfProperty_SetExtrasStringParam(OH_UdmfProperty* pThis, + const char* key, const char* param); + +/** + * @brief Get {@link OH_UdmfData} data from udmf database. + * + * @param key Represents database store's key value. + * @param intention Represents data type {@link Udmf_Intention} + * @param unifiedData Represents output params of {@link OH_UdmfData}; + * @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} Internal data error. + * @see OH_UdmfProperty Udmf_Intention Udmf_ErrCode. + * @since 12 + */ +int OH_Udmf_GetUnifiedData(const char* key, Udmf_Intention intention, OH_UdmfData* unifiedData); + +/** + * @brief Set {@link OH_UdmfData} data to database. + * + * @param intention Represents data type {@link Udmf_Intention}. + * @param unifiedData Represents a pointer to an instance of {@link OH_UdmfData}. + * @param key Represents return value after set data to database successfully, + * it's memory size not less than {@link UDMF_KEY_BUFFER_LEN}. + * @param keyLen Represents size of key param. + * @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} Internal data error. + * @see OH_UdmfProperty Udmf_Intention Udmf_ErrCode. + * @since 12 + */ +int OH_Udmf_SetUnifiedData(Udmf_Intention intention, OH_UdmfData* unifiedData, + char* key, unsigned int keyLen); + +#ifdef __cplusplus +}; +#endif + +/** @} */ +#endif // OH_PREFERENCES_H \ No newline at end of file diff --git a/distributeddatamgr/preferences/libpreferences.ndk.json b/distributeddatamgr/preferences/libpreferences.ndk.json new file mode 100644 index 000000000..6011e71c0 --- /dev/null +++ b/distributeddatamgr/preferences/libpreferences.ndk.json @@ -0,0 +1,338 @@ +[ + { + "first_introduced": "12", + "name": "OH_Utd_Create" + }, + { + "first_introduced": "12", + "name": "OH_Utd_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_Utd_GetTypeId" + }, + { + "first_introduced": "12", + "name": "OH_Utd_GetDescription" + }, + { + "first_introduced": "12", + "name": "OH_Utd_GetReferenceUrl" + }, + { + "first_introduced": "12", + "name": "OH_Utd_GetIconFile" + }, + { + "first_introduced": "12", + "name": "OH_Utd_GetBelongingToTypes" + }, + { + "first_introduced": "12", + "name": "OH_Utd_GetFilenameExtensions" + }, + { + "first_introduced": "12", + "name": "OH_Utd_GetMimeTypes" + }, + { + "first_introduced": "12", + "name": "OH_Utd_GetTypesByFilenameExtension" + }, + { + "first_introduced": "12", + "name": "OH_Utd_GetTypesByMimeType" + }, + { + "first_introduced": "12", + "name": "OH_Utd_BelongsTo" + }, + { + "first_introduced": "12", + "name": "OH_Utd_IsLower" + }, + { + "first_introduced": "12", + "name": "OH_Utd_IsHigher" + }, + { + "first_introduced": "12", + "name": "OH_Utd_Equals" + }, + { + "first_introduced": "12", + "name": "OH_Utd_DestroyStringList" + }, + { + "first_introduced": "12", + "name": "OH_UdsPlainText_Create" + }, + { + "first_introduced": "12", + "name": "OH_UdsPlainText_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_UdsPlainText_GetType" + }, + { + "first_introduced": "12", + "name": "OH_UdsPlainText_GetContent" + }, + { + "first_introduced": "12", + "name": "OH_UdsPlainText_GetAbstract" + }, + { + "first_introduced": "12", + "name": "OH_UdsPlainText_SetContent" + }, + { + "first_introduced": "12", + "name": "OH_UdsPlainText_SetAbstract" + }, + { + "first_introduced": "12", + "name": "OH_UdsHyperlink_Create" + }, + { + "first_introduced": "12", + "name": "OH_UdsHyperlink_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_UdsHyperlink_GetType" + }, + { + "first_introduced": "12", + "name": "OH_UdsHyperlink_GetUrl" + }, + { + "first_introduced": "12", + "name": "OH_UdsHyperlink_GetDescription" + }, + { + "first_introduced": "12", + "name": "OH_UdsHyperlink_SetUrl" + }, + { + "first_introduced": "12", + "name": "OH_UdsHyperlink_SetDescription" + }, + { + "first_introduced": "12", + "name": "OH_UdsHtml_Create" + }, + { + "first_introduced": "12", + "name": "OH_UdsHtml_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_UdsHtml_GetType" + }, + { + "first_introduced": "12", + "name": "OH_UdsHtml_GetContent" + }, + { + "first_introduced": "12", + "name": "OH_UdsHtml_GetPlainContent" + }, + { + "first_introduced": "12", + "name": "OH_UdsHtml_SetContent" + }, + { + "first_introduced": "12", + "name": "OH_UdsHtml_SetPlainContent" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_Create" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_GetType" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_GetId" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_GetName" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_GetIconId" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_GetLabelId" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_GetBundleName" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_GetAbilityName" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_SetId" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_SetName" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_SetIconId" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_SetLabelId" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_SetBundleName" + }, + { + "first_introduced": "12", + "name": "OH_UdsAppItem_SetAbilityName" + }, + { + "first_introduced": "12", + "name": "OH_UdmfData_Create" + }, + { + "first_introduced": "12", + "name": "OH_UdmfData_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_UdmfData_AddRecord" + }, + { + "first_introduced": "12", + "name": "OH_UdmfData_HasType" + }, + { + "first_introduced": "12", + "name": "OH_UdmfData_GetTypes" + }, + { + "first_introduced": "12", + "name": "OH_UdmfData_GetRecords" + }, + { + "first_introduced": "12", + "name": "OH_UdmfRecord_Create" + }, + { + "first_introduced": "12", + "name": "OH_UdmfRecord_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_UdmfRecord_AddGeneralEntry" + }, + { + "first_introduced": "12", + "name": "OH_UdmfRecord_AddPlainText" + }, + { + "first_introduced": "12", + "name": "OH_UdmfRecord_AddHyperlink" + }, + { + "first_introduced": "12", + "name": "OH_UdmfRecord_AddHtml" + }, + { + "first_introduced": "12", + "name": "OH_UdmfRecord_AddAppItem" + }, + { + "first_introduced": "12", + "name": "OH_UdmfRecord_GetTypes" + }, + { + "first_introduced": "12", + "name": "OH_UdmfRecord_GetGeneralEntry" + }, + { + "first_introduced": "12", + "name": "OH_UdmfRecord_GetPlainText" + }, + { + "first_introduced": "12", + "name": "OH_UdmfRecord_GetHyperlink" + }, + { + "first_introduced": "12", + "name": "OH_UdmfRecord_GetHtml" + }, + { + "first_introduced": "12", + "name": "OH_UdmfRecord_GetAppItem" + }, + { + "first_introduced": "12", + "name": "OH_UdmfProperty_Create" + }, + { + "first_introduced": "12", + "name": "OH_UdmfProperty_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_UdmfProperty_GetTag" + }, + { + "first_introduced": "12", + "name": "OH_UdmfProperty_GetTimestamp" + }, + { + "first_introduced": "12", + "name": "OH_UdmfProperty_GetShareOption" + }, + { + "first_introduced": "12", + "name": "OH_UdmfProperty_GetExtrasIntParam" + }, + { + "first_introduced": "12", + "name": "OH_UdmfProperty_GetExtrasStringParam" + }, + { + "first_introduced": "12", + "name": "OH_UdmfProperty_SetTag" + }, + { + "first_introduced": "12", + "name": "OH_UdmfProperty_SetShareOption" + }, + { + "first_introduced": "12", + "name": "OH_UdmfProperty_SetExtrasIntParam" + }, + { + "first_introduced": "12", + "name": "OH_UdmfProperty_SetExtrasStringParam" + }, + { + "first_introduced": "12", + "name": "OH_Udmf_GetUnifiedData" + }, + { + "first_introduced": "12", + "name": "OH_Udmf_SetUnifiedData" + } +] \ No newline at end of file -- Gitee From bbe522de684739377c2931b921317a8a06b02318 Mon Sep 17 00:00:00 2001 From: zwtmichael Date: Thu, 29 Aug 2024 11:53:19 +0800 Subject: [PATCH 224/620] add preference interface Signed-off-by: zwtmichael --- distributeddatamgr/preferences/BUILD.gn | 22 +- .../preferences/include/oh_preferences.h | 584 ++++-------------- .../include/oh_preferences_err_code.h | 73 +++ .../include/oh_preferences_option.h | 112 ++++ .../include/oh_preferences_value.h | 170 +++++ .../preferences/libpreferences.ndk.json | 336 ++-------- 6 files changed, 546 insertions(+), 751 deletions(-) create mode 100644 distributeddatamgr/preferences/include/oh_preferences_err_code.h create mode 100644 distributeddatamgr/preferences/include/oh_preferences_option.h create mode 100644 distributeddatamgr/preferences/include/oh_preferences_value.h diff --git a/distributeddatamgr/preferences/BUILD.gn b/distributeddatamgr/preferences/BUILD.gn index 73e26a566..90671c646 100644 --- a/distributeddatamgr/preferences/BUILD.gn +++ b/distributeddatamgr/preferences/BUILD.gn @@ -18,25 +18,23 @@ import("//foundation/distributeddatamgr/preferences/preferences.gni") ohos_ndk_headers("preferences_ndk_header") { dest_dir = "$ndk_headers_out_dir/database/preferences/" sources = [ - "./include/udmf.h", - "./include/udmf_err_code.h", - "./include/udmf_meta.h", - "./include/uds.h", - "./include/utd.h", + "./include/oh_preferences.h", + "./include/oh_preferences_err_code.h", + "./include/oh_preferences_option.h", + "./include/oh_preferences_values.h", ] } -ohos_ndk_library("libpreferences") { - output_name = "udmf" +ohos_ndk_library("libohpreferences") { + output_name = "ohpreferences" output_extension = "so" system_capability = "SystemCapability.DistributedDataManager.Preferences.Core" ndk_description_file = "./libpreferences.ndk.json" min_compact_version = "13" system_capability_headers = [ - "$ndk_headers_out_dir/database/preferences/udmf_err_code.h", - "$ndk_headers_out_dir/database/preferences/udmf_meta.h", - "$ndk_headers_out_dir/database/preferences/udmf.h", - "$ndk_headers_out_dir/database/preferences/uds.h", - "$ndk_headers_out_dir/database/preferences/utd.h", + "$ndk_headers_out_dir/database/preferences/oh_preferences.h", + "$ndk_headers_out_dir/database/preferences/oh_preferences_err_code.h", + "$ndk_headers_out_dir/database/preferences/oh_preferences_values.h", + "$ndk_headers_out_dir/database/preferences/oh_preferences_option.h", ] } diff --git a/distributeddatamgr/preferences/include/oh_preferences.h b/distributeddatamgr/preferences/include/oh_preferences.h index da57b22be..8beda9588 100644 --- a/distributeddatamgr/preferences/include/oh_preferences.h +++ b/distributeddatamgr/preferences/include/oh_preferences.h @@ -17,10 +17,9 @@ * @addtogroup PREFERENCES * @{ * - * @brief The preference manages data based on relational models. - * The Preferences module provides APIs for processing data in the form of key-value (KV) pairs, including querying, - * modifying, and persisting KV pairs. The key is of the string type, and the value can be a number, a string, - * a Boolean value, or an array of numbers, strings, or Boolean values. + * @brief Provides APIs for processing data in the form of key-value (KV) pairs. + * You can use the APIs provided by the Preferences module to query, modify, and persist KV pairs. + * The key is of the string type, and the value can be a number, a string, a boolean value. * * @since 13 */ @@ -28,524 +27,215 @@ /** * @file oh_preferences.h * - * @brief Provides preferences related functions and enumerations. + * @brief Defines the APIS and enums of Preference. * * @kit ArkData + * @library libohpreferences.so * @syscap SystemCapability.DistributedDataManager.Preferences.Core * - * @since 12 + * @since 13 */ #ifndef OH_PREFERENCES_H #define OH_PREFERENCES_H -#include -#include -#include "uds.h" +#include + +#include "oh_preferences_value.h" +#include "oh_preferences_option.h" #ifdef __cplusplus extern "C" { #endif /** - * @brief Describes the unified preferences type. + * @brief Represents a Preferences instance. * * @since 13 */ typedef struct OH_Preferences OH_Preferences; /** - * @brief The callback function of data observer event. + * @brief Call to return the change in KV pairs. * - * @param context Represents the context of data observer. - * @param pairs Indicates the key and value pairs that changed. - * @param count The count of changed pair accounts. + * @param context Pointer to the context of data observer. + * @param pairs Pointer to the KV pairs to be observed. + * @param count Number of KV pairs to be observed. + * @see OH_PreferencesPair. * @since 13 */ -typedef void (*PreferencesDataObserver)(void *context, const OH_PreferencesPair *pairs, uint32_t count); +typedef void (*OH_PreferencesDataObserver)(void *context, const OH_PreferencesPair *pairs, uint32_t count); /** - * @brief open the preferences object + * @brief Opens a Preferences object. * - * @param option Represents a pointer to an {@link OH_PreferencesOption} instance. - * @param errCode Represents a pointer to the status code of the execution. This parameter is the output parameter, - * See {@link OH_Preferences_ErrCode}. - * @return Returns preferences object pointer that in {@link OH_Preferences} when input parameters valid, - * otherwise return nullptr. + * @param option Pointer to an {@Link OH_PreferencesOption} instance. + * @param errCode Pointer to the status code of the execution. For details, See {@link OH_Preferences_ErrCode}. + * @return Returns an pointer to the Preferences object in {@Link OH_Preferences} if the operation is successful, + * returns nullptr otherwise. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * {@link PREFERENCES_NOT_SUPPORTED} indicates the capability is not supported. + * @see OH_Preferences OH_PreferencesOption. * @since 13 */ -OH_Preferences *OH_Preferences_Open(OH_PreferencesOptions *option, int *errCode); +OH_Preferences *OH_Preferences_Open(OH_PreferencesOption *option, int *errCode); /** - * @brief close the preferences object + * @brief Closes a Preferences object. * - * @param option Represents a pointer to an {@link OH_PreferencesOption} instance. - * @return Returns the status code of the execution. See {@link OH_Preferences_ErrCode}. + * @param preference Pointer to the {@Link OH_Preferences} instance to close. + * @param option Pointer to an {@Link OH_PreferencesOption} instance. + * @return Returns the status code of the execution. For details, see {@Link OH_Preferences_ErrCode}. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * @see OH_Preferences. * @since 13 */ -int OH_Preferences_Close(OH_PreferencesOptions *store); +int OH_Preferences_Close(OH_Preferences *preference); /** - * @brief Gets the value by the in preferences object. + * @brief Obtains the integer value in a Preferences object based on the given key. * - * @param key Indicates the target key of the preferences. - * @param value Indicates the value that is get . + * @param preference Pointer to the target {@Link OH_Preferences} instance. + * @param key Pointer to the key of the value to obtain. + * @param value Pointer to the value obtained. * @return Returns the status code of the execution. - * {@link RDB_OK} - success. - * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. - * @see PreferencesStore. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * @see OH_Preferences. * @since 13 */ -int OH_Preferences_GetInt(PreferencesStore *store, const char *key, int *value); +int OH_Preferences_GetInt(OH_Preferences *preference, const char *key, int *value); /** - * @brief Get the value by key from a preference. + * @brief Obtains the Boolean value in a Preferences object based on the given key. * - * @param store Represents a pointer to an {@link PreferencesStore} instance. - * @param key Indicates the key of the preferences. - * @param errCode This parameter is the output parameter, - * and the execution status of a function is written to this variable. - * @return Returns value {@link OH_PreferencesValue} object. - * @see PreferencesStore, OH_PreferencesValue + * @param preference Pointer to the target {@Link OH_Preferences} instance. + * @param key Pointer to the key of the value to obtain. + * @param value Pointer to the Boolean value obtained. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * @see OH_Preferences. * @since 13 */ -int OH_Preferences_GetBool(PreferencesStore *store, const char *key, bool *value); +int OH_Preferences_GetBool(OH_Preferences *preference, const char *key, bool *value); /** - * @brief Gets the version of a database. + * @brief Obtains the string value in a Preferences object based on the given key. * - * @param store Represents a pointer to an {@link PreferencesStore} instance. - * @param key Indicates the key of the preferences. + * @param preference Pointer to the target {@Link OH_Preferences} instance. + * @param key Pointer to the key of the value to obtain. + * @param value Double pointer to the value obtained in an char * array. Release the memory used + * when this parameter is no longer required. + * @param valueLen Pointer to the length of the string obtained. * @return Returns the status code of the execution. - * {@link RDB_OK} - success. - * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. - * @see PreferencesStore. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * @see OH_Preferences. * @since 13 */ -int OH_Preferences_GetString(PreferencesStore *store, const char *key, char **value); - -/** - * @brief Describes the unified data type. - * - * @since 12 - */ -typedef struct OH_UdmfData OH_UdmfData; - -/** - * @brief Describes the record type in the unified data. - * - * @since 12 - */ -typedef struct OH_UdmfRecord OH_UdmfRecord; - -/** - * @brief Describes some property parameters of unified data. - * - * @since 12 - */ -typedef struct OH_UdmfProperty OH_UdmfProperty; - -/** - * @brief Creation a pointer to the instance of the {@link OH_UdmfData}. - * - * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfData} - * structure is returned. If the operation is failed, nullptr is returned. - * @see OH_UdmfData. - * @since 12 - */ -OH_UdmfData* OH_UdmfData_Create(); - -/** - * @brief Destroy a pointer that points to the {@link OH_UdmfData} instance. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. - * @see OH_UdmfData. - * @since 12 - */ -void OH_UdmfData_Destroy(OH_UdmfData* pThis); - -/** - * @brief Add one {OH_UdmfRecord} record to the {@link OH_UdmfData} data. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. - * @param record Represents a pointer to an instance of {@link OH_UdmfRecord}. - * @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_UdmfData Udmf_ErrCode. - * @since 12 - */ -int OH_UdmfData_AddRecord(OH_UdmfData* pThis, OH_UdmfRecord* record); - -/** - * @brief Check whether the type exists in the {@link OH_UdmfData} data. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. - * @param type Represents a string pointer of the type. - * @return Returns the status of finding type. - * {@code false} is not existed. - * {@code true} is existed. - * @see OH_UdmfData. - * @since 12 - */ -bool OH_UdmfData_HasType(OH_UdmfData* pThis, const char* type); - -/** - * @brief Get all types in the {@link OH_UdmfData} data. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. - * @param count Represents the types count that is a output param. - * @return Returns string array that in {@link OH_UdmfData} when input parameters valid, - * otherwise return nullptr. - * @see OH_UdmfData. - * @since 12 - */ -char** OH_UdmfData_GetTypes(OH_UdmfData* pThis, unsigned int* count); +int OH_Preferences_GetString(OH_Preferences *preference, const char *key, char **value, uint32_t *valueLen); /** - * @brief Get all records in the {@link OH_UdmfData} data. + * @brief Sets an integer in a Preferences object. * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. - * @param count Represents the records count that is a output param. - * @return Returns {@link OH_UdmfRecord} pointer array when input parameters valid, otherwise return nullptr. - * @see OH_UdmfData OH_UdmfRecord. - * @since 12 - */ -OH_UdmfRecord** OH_UdmfData_GetRecords(OH_UdmfData* pThis, unsigned int* count); - -/** - * @brief Creation a pointer to the instance of the {@link OH_UdmfRecord}, it's relate with UDS data. - * - * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfRecord} - * structure is returned. If the operation is failed, nullptr is returned. - * @see OH_UdmfRecord. - * @since 12 - */ -OH_UdmfRecord* OH_UdmfRecord_Create(); - -/** - * @brief Destroy a pointer that points to an instance of {@link OH_UdmfRecord}. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. - * @see OH_UdmfRecord. - * @since 12 - */ -void OH_UdmfRecord_Destroy(OH_UdmfRecord* pThis); - -/** - * @brief Add one custom data to the {@link OH_UdmfRecord} record. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. - * @param typeId Represents record type, reference udmf_meta.h. - * @param entry Represents custom data. - * @param count Represents the size of data param. - * @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 Udmf_ErrCode. - * @since 12 - */ -int OH_UdmfRecord_AddGeneralEntry(OH_UdmfRecord* pThis, const char* typeId, unsigned char* entry, unsigned int count); - -/** - * @brief Add one {OH_UdsPlainText} data to the {@link OH_UdmfRecord} record. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. - * @param plainText Represents a pointer to an instance of {@link OH_UdsPlainText}. - * @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_UdsPlainText Udmf_ErrCode. - * @since 12 - */ -int OH_UdmfRecord_AddPlainText(OH_UdmfRecord* pThis, OH_UdsPlainText* plainText); - -/** - * @brief Add one {OH_UdsHyperlink} data to the {@link OH_UdmfRecord} record. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. - * @param hyperlink Represents a pointer to an instance of {@link OH_UdsHyperlink}. - * @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_UdsHyperlink Udmf_ErrCode. - * @since 12 - */ -int OH_UdmfRecord_AddHyperlink(OH_UdmfRecord* pThis, OH_UdsHyperlink* hyperlink); - -/** - * @brief Add one {OH_UdsHtml} data to the {@link OH_UdmfRecord} record. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. - * @param html Represents a pointer to an instance of {@link OH_UdsHtml}. - * @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_UdsHtml Udmf_ErrCode. - * @since 12 - */ -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 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. - * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. - * @see OH_UdmfRecord OH_UdsAppItem Udmf_ErrCode. - * @since 12 - */ -int OH_UdmfRecord_AddAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem); - -/** - * @brief Get all types in the {@link OH_UdmfRecord} record. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. - * @param count Represents the types count that is a output param. - * @return Returns string array that in {@link OH_UdmfRecord} when input parameters valid, - * otherwise return nullptr. - * @see OH_UdmfRecord. - * @since 12 - */ -char** OH_UdmfRecord_GetTypes(OH_UdmfRecord* pThis, unsigned int* count); - -/** - * @brief Get one entry data from the {@link OH_UdmfRecord} record. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. - * @param typeId Represents record type, reference udmf_meta.h. - * @param entry Represents a pointer to entry data that is a output param. - * @param count Represents the entry data length that is a output param. - * @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} Internal data error. - * @see OH_UdmfRecord Udmf_ErrCode. - * @since 12 - */ -int OH_UdmfRecord_GetGeneralEntry(OH_UdmfRecord* pThis, const char* typeId, - unsigned char** entry, unsigned int* count); - -/** - * @brief Get one {OH_UdsPlainText} data from the {@link OH_UdmfRecord} record. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. - * @param plainText Represents a pointer to an instance of {@link OH_UdsPlainText}. - * @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} Internal data error. - * @see OH_UdmfRecord OH_UdsPlainText Udmf_ErrCode. - * @since 12 - */ -int OH_UdmfRecord_GetPlainText(OH_UdmfRecord* pThis, OH_UdsPlainText* plainText); - -/** - * @brief Get one {OH_UdsHyperlink} data from the {@link OH_UdmfRecord} record. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. - * @param hyperlink Represents a pointer to an instance of {@link OH_UdsHyperlink}. - * @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} Internal data error. - * @see OH_UdmfRecord OH_UdsHyperlink Udmf_ErrCode. - * @since 12 - */ -int OH_UdmfRecord_GetHyperlink(OH_UdmfRecord* pThis, OH_UdsHyperlink* hyperlink); - -/** - * @brief Get one {OH_UdsHtml} data from the {@link OH_UdmfRecord} record. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. - * @param html Represents a pointer to an instance of {@link OH_UdsHtml}. - * @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} Internal data error. - * @see OH_UdmfRecord OH_UdsHtml Udmf_ErrCode. - * @since 12 - */ -int OH_UdmfRecord_GetHtml(OH_UdmfRecord* pThis, OH_UdsHtml* html); - -/** - * @brief Get one {OH_UdsAppItem} data from the {@link OH_UdmfRecord} record. - * - * @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. - * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. - * {@link UDMF_ERR} Internal data error. - * @see OH_UdmfRecord OH_UdsAppItem Udmf_ErrCode. - * @since 12 - */ -int OH_UdmfRecord_GetAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem); - -/** - * @brief Creation a pointer to the instance of the {@link OH_UdmfProperty} - * from a {@link OH_UdmfData} data. - * - * @param unifiedData Represents a pointer to an instance of {@link OH_UdmfData}. - * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfProperty} - * structure is returned. If the operation is failed, nullptr is returned. - * @see OH_UdmfData OH_UdmfProperty. - * @since 12 - */ -OH_UdmfProperty* OH_UdmfProperty_Create(OH_UdmfData* unifiedData); - -/** - * @brief Destroy a pointer that points to the {@link OH_UdmfProperty} instance. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. - * @see OH_UdmfProperty. - * @since 12 - */ -void OH_UdmfProperty_Destroy(OH_UdmfProperty* pThis); - -/** - * @brief Get tag value from the {@link OH_UdmfProperty}. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. - * @return Returns a pointer of the tag value string when input parameters valid, otherwise return nullptr. - * @see OH_UdmfProperty. - * @since 12 - */ -const char* OH_UdmfProperty_GetTag(OH_UdmfProperty* pThis); - -/** - * @brief Get timestamp value from the {@link OH_UdmfProperty}. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. - * @return Returns timestamp value. - * @see OH_UdmfProperty - * @since 12 - */ -int64_t OH_UdmfProperty_GetTimestamp(OH_UdmfProperty* pThis); - -/** - * @brief Get share option value from the {@link OH_UdmfProperty}. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. - * @return Returns {@link Udmf_ShareOption} value. - * @see OH_UdmfProperty Udmf_ShareOption - * @since 12 - */ -Udmf_ShareOption OH_UdmfProperty_GetShareOption(OH_UdmfProperty* pThis); - -/** - * @brief Get integer value by key from the {@link OH_UdmfProperty}. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. - * @param key Represents key-value pair's key - * @param defaultValue Represents when get value failure. - * @return Returns value associated with the key in successfully, otherwise return defaultValue. - * @see OH_UdmfProperty. - * @since 12 - */ -int OH_UdmfProperty_GetExtrasIntParam(OH_UdmfProperty* pThis, - const char* key, int defaultValue); - -/** - * @brief Get tag value from the {@link OH_UdmfProperty}. - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. - * @param key Represents key-value pair's key. - * @return Returns a pointer of the key value string when input parameters valid, otherwise return nullptr. - * @see OH_UdmfProperty - * @since 12 - */ -const char* OH_UdmfProperty_GetExtrasStringParam(OH_UdmfProperty* pThis, const char* key); - -/** - * @brief Set tag value to {@link OH_UdmfProperty} . - * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. - * @param tag Represents new tag param. - * @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_UdmfProperty Udmf_ErrCode. - * @since 12 + * @param preference Pointer to the target {@Link OH_Preferences} instance. + * @param key Pointer to the key to set. + * @param value Value to set. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * @see OH_Preferences. + * @since 13 */ -int OH_UdmfProperty_SetTag(OH_UdmfProperty* pThis, const char* tag); +int OH_Preferences_SetInt(OH_Preferences *preference, const char *key, int value); /** - * @brief Set Udmf_ShareOption value to {@link OH_UdmfProperty}. + * @brief Sets a Boolean value in a Preferences object. * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. - * @param option Represents new {@link Udmf_ShareOption} param. - * @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_UdmfProperty Udmf_ShareOption Udmf_ErrCode. - * @since 12 + * @param preference Pointer to the target {@Link OH_Preferences} instance. + * @param key Pointer to the key to set. + * @param value Boolean value to set. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * @see OH_Preferences. + * @since 13 */ -int OH_UdmfProperty_SetShareOption(OH_UdmfProperty* pThis, Udmf_ShareOption option); +int OH_Preferences_SetBool(OH_Preferences *preference, const char *key, bool value); /** - * @brief Set extras param to {@link OH_UdmfProperty}. + * @brief Sets a string in a Preferences object. * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. - * @param key Represents extras param's key value. - * @param param Represents value of k-v pairs. - * @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_UdmfProperty Udmf_ErrCode. - * @since 12 + * @param preference Pointer to the target {@Link OH_Preferences} instance. + * @param key Pointer to the key to set. + * @param value Point to string to set. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * @see OH_Preferences. + * @since 13 */ -int OH_UdmfProperty_SetExtrasIntParam(OH_UdmfProperty* pThis, const char* key, int param); +int OH_Preferences_SetString(OH_Preferences *preference, const char *key, const char *value); /** - * @brief Set extras param to {@link OH_UdmfProperty}. + * @brief Deletes a KV pair from a Preferences object. * - * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. - * @param key Represents extras param's key value. - * @param param Represents value of k-v pairs. - * @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_UdmfProperty Udmf_ErrCode. - * @since 12 + * @param preference Pointer to the target {@Link OH_Preferences} instance. + * @param key Pointer to the key of the data to delete. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * @see OH_Preferences. + * @since 13 */ -int OH_UdmfProperty_SetExtrasStringParam(OH_UdmfProperty* pThis, - const char* key, const char* param); +int OH_Preferences_Delete(OH_Preferences *preference, const char *key); /** - * @brief Get {@link OH_UdmfData} data from udmf database. + * @brief Registers a data observer for a Preferences object. * - * @param key Represents database store's key value. - * @param intention Represents data type {@link Udmf_Intention} - * @param unifiedData Represents output params of {@link OH_UdmfData}; - * @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} Internal data error. - * @see OH_UdmfProperty Udmf_Intention Udmf_ErrCode. - * @since 12 + * @param preference Pointer to the target {@Link OH_Preferences} instance. + * @param context Pointer to the context of the data observer. + * @param observer Pointer to the {@Link OH_PreferencesDataObserver} to register. + * @param keys Pointer to the keys to observe. + * @param keyCount Number of keys to observe. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * @see OH_Preferences OH_PreferencesDataObserver. + * @since 13 */ -int OH_Udmf_GetUnifiedData(const char* key, Udmf_Intention intention, OH_UdmfData* unifiedData); +int OH_Preferences_RegisterDataObserver(OH_Preferences *preference, void *context, + const OH_PreferencesDataObserver *observer, const char *keys[], uint32_t keyCount); /** - * @brief Set {@link OH_UdmfData} data to database. + * @brief Unregisters a data observer for a Preferences object. * - * @param intention Represents data type {@link Udmf_Intention}. - * @param unifiedData Represents a pointer to an instance of {@link OH_UdmfData}. - * @param key Represents return value after set data to database successfully, - * it's memory size not less than {@link UDMF_KEY_BUFFER_LEN}. - * @param keyLen Represents size of key param. - * @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} Internal data error. - * @see OH_UdmfProperty Udmf_Intention Udmf_ErrCode. - * @since 12 + * @param preference Pointer to the target {@Link OH_Preferences} instance. + * @param observer Pointer to the {@Link OH_PreferencesDataObserver} to unregister. + * @param keys Pointer to the keys observed. If this parameter is null, this API unregisters the listening for all keys. + * @param keyCount Number of the keys. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * @see OH_Preferences OH_PreferencesDataObserver. + * @since 13 */ -int OH_Udmf_SetUnifiedData(Udmf_Intention intention, OH_UdmfData* unifiedData, - char* key, unsigned int keyLen); +int OH_Preferences_UnregisterDataObserver(OH_Preferences *preference, const OH_PreferencesDataObserver *observer, + const char *keys[], uint32_t keyCount); #ifdef __cplusplus }; diff --git a/distributeddatamgr/preferences/include/oh_preferences_err_code.h b/distributeddatamgr/preferences/include/oh_preferences_err_code.h new file mode 100644 index 000000000..6ece14603 --- /dev/null +++ b/distributeddatamgr/preferences/include/oh_preferences_err_code.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup PREFERENCES + * @{ + * + * @brief Provides APIs for processing data in the form of key-value (KV) pairs. + * You can use the APIs provided by the Preferences module to query, modify, and persist KV pairs. + * The key is of the string type, and the value can be a number, a string, a boolean value. + * + * @since 13 + */ + +/** + * @file preferences_err_code.h + * + * @brief Defines the status codes used in the Preferences module. + * + * @kit ArkData + * @library libohpreferences.so + * @syscap SystemCapability.DistributedDataManager.Preferences.Core + * + * @since 13 + */ + + +#ifndef OH_PREFERENCES_ERR_CODE_H +#define OH_PREFERENCES_ERR_CODE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the status codes. + * + * @since 13 + */ +typedef enum OH_Preferences_ErrCode { + /** @error Operation successful. */ + PREFERENCES_OK = 0, + /* @error Invalid args. */ + PREFERENCES_E_INVALID_PARAM = 401, + /* @error Capability not supported. */ + PREFERENCES_NOT_SUPPORTED = 801, + /* @error Base error code. */ + PREFERENCES_BASE = 15500000, + /* @error Inner error. */ + PREFERENCES_E_INNER_ERROR = PREFERENCES_BASE, + /* @error Failed to delete a file. */ + PREFERENCES_DELETE_FILE_FAIL = (PREFERENCES_BASE + 10), + /* @error Failed to get DataObsMgrClient. */ + PREFERENCES_GET_DATAOBSMGRCLIENT_FAIL = (PREFERENCES_BASE + 19), +} OH_Preferences_ErrCode; + +#ifdef __cplusplus +}; +#endif + +#endif // OH_PREFERENCES_ERR_CODE_H diff --git a/distributeddatamgr/preferences/include/oh_preferences_option.h b/distributeddatamgr/preferences/include/oh_preferences_option.h new file mode 100644 index 000000000..50eca8b61 --- /dev/null +++ b/distributeddatamgr/preferences/include/oh_preferences_option.h @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup PREFERENCES + * @{ + * + * @brief Provides APIs for processing data in the form of key-value (KV) pairs. + * You can use the APIs provided by the Preferences module to query, modify, and persist KV pairs. + * The key is of the string type, and the value can be a number, a string, a boolean value. + * + * @since 13 + */ + +/** + * @file oh_preferences_option.h + * + * @brief Defines the APIs and enums related to preferences option. + * + * @kit ArkData + * @library libohpreferences.so + * @syscap SystemCapability.DistributedDataManager.Preferences.Core + * + * @since 13 + */ + +#ifndef OH_PREFERENCES_OPTION_H +#define OH_PREFERENCES_OPTION_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Represents an OH_PreferencesOption instance. + * + * @since 13 + */ +typedef struct OH_PreferencesOption OH_PreferencesOption; + +/** + * @brief Creates an {@Link OH_PreferencesOption} instance. + * + * @return Returns a pointer to the {@Link OH_PreferencesOption} instance created if the operation is successful; + * returns nullptr otherwise. + * @see OH_PreferencesOption. + * @since 13 + */ +OH_PreferencesOption *OH_PreferencesOption_Create(); + +/** + * @brief Sets the file path in an {@Link OH_PreferencesOption} instance. + * + * @param option Pointer to the target {@Link OH_PreferencesOption} instance. + * @param filePath Pointer to the file path to set. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} success. + * @see OH_PreferencesOption. + * @since 13 + */ +int OH_PreferencesOption_SetFilePath(OH_PreferencesOption *option, const char *filePath); + +/** + * @brief Sets the bundle name in an {@Link OH_PreferencesOption} instance. + * + * @param option Pointer to the target {@Link OH_PreferencesOption} instance. + * @param bundleName Pointer to the bundle name to set. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} success. + * @see OH_PreferencesOption. + * @since 13 + */ +int OH_PreferencesOption_SetBundleName(OH_PreferencesOption *option, const char *bundleName); + +/** + * @brief Sets the data group ID in an {@Link OH_PreferencesOption} instance. + * + * @param option Represents a pointer to an {@link OH_PreferencesOption} instance. + * @param dataGroupId Represents preferences data group id param. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} success. + * @see OH_PreferencesOption. + * @since 13 + */ +int OH_PreferencesOption_SetDataGroupId(OH_PreferencesOption *option, const char *dataGroupId); + +/** + * @brief Destroys an {@Link OH_PreferencesOption} instance. + * + * @param option Pointer to the {@Link OH_PreferencesOption} instance to destroy. + * @see OH_PreferencesOption. + * @since 13 + */ +void OH_PreferencesOption_Destroy(OH_PreferencesOption *option); +#ifdef __cplusplus +}; +#endif +#endif // OH_PREFERENCES_OPTION_H \ No newline at end of file diff --git a/distributeddatamgr/preferences/include/oh_preferences_value.h b/distributeddatamgr/preferences/include/oh_preferences_value.h new file mode 100644 index 000000000..6ebd7aafd --- /dev/null +++ b/distributeddatamgr/preferences/include/oh_preferences_value.h @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup PREFERENCES + * @{ + * + * @brief Provides APIs for processing data in the form of key-value (KV) pairs. + * You can use the APIs provided by the Preferences module to query, modify, and persist KV pairs. + * The key is of the string type, and the value can be a number, a string, a boolean value. + * + * @since 13 + */ + +/** + * @file oh_preferences_value.h + * + * @brief Defines the APIs and enums related to preferences values. + * + * @kit ArkData + * @library libohpreferences.so + * @syscap SystemCapability.DistributedDataManager.Preferences.Core + * + * @since 13 + */ + +#ifndef OH_PREFERENCES_VALUE_H +#define OH_PREFERENCES_VALUE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the Preference value types. + * + * @since 13 + */ +typedef enum Preference_ValueType { + /** + * @brief Null. + */ + TYPE_NULL = 0, + /** + * @brief Int. + */ + TYPE_INT, + /** + * @brief boolean. + */ + TYPE_BOOL, + /** + * @brief String. + */ + TYPE_STRING, + /** + * @brief end butt. + */ + TYPE_BUTT +} Preference_ValueType; + +/** + * @brief Represents a KV pair in a Preferences instance. + * + * @since 13 + */ +typedef struct OH_PreferencesPair OH_PreferencesPair; + +/** + * @brief Represents the value in a KV pair of a Preferences instance. + * + * @since 13 + */ +typedef struct OH_PreferencesValue OH_PreferencesValue; + +/** + * @brief Obtains a key from an {@Link OH_PreferencesPair} instance. + * + * @param pairs Pointer to the target {@Link OH_PreferencesPair} instance. + * @param index Represents a target index of the pairs + * @return Returns preferences pointer to the key that when input parameters valid, otherwise return nullptr. + * otherwise return nullptr. + * @see OH_PreferencesPair. + * @since 13 + */ +const char *OH_PreferencesPair_GetKey(const OH_PreferencesPair *pairs, uint32_t index); + +/** + * @brief Obtains a value from an {@Link OH_PreferencesPair} instance. + * + * @param pairs Pointer to the target {@Link OH_PreferencesPair} instance. + * @param index Index of the value to obtain. + * @return Returns a pointer to the {@Link OH_PreferencesValue} obtained if the operation is successful, + * returns nullptr otherwise. + * @see OH_PreferencesValue. + * @since 13 + */ +const OH_PreferencesValue *OH_PreferencesPair_GetPreferencesValue(const OH_PreferencesPair *pairs, uint32_t index); + +/** + * @brief Obtains the type of a preferences value. + * + * @param object Pointer to the target {@Link OH_PreferencesValue} instance. + * @return Returns the value type obtained if the operation is successful, returns TYPE_NULL otherwise. + * @see OH_PreferencesValue. + * @since 13 + */ +Preference_ValueType OH_PreferencesValue_GetValueType(const OH_PreferencesValue *object); + +/** + * @brief Obtains the int value of an {@Link OH_PreferencesValue} instance. + * + * @param object Pointer to the target {@Link OH_PreferencesValue} instance. + * @param value Pointer to the value obtained. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} success. + * {@link PREFERENCES_E_INVALID_PARAM} The error code for common invalid args. + * {@link PREFERENCES_E_INNER_ERROR} The error code for Inner error. + * @see OH_PreferencesValue. + * @since 13 + */ +int OH_PreferencesValue_GetInt(const OH_PreferencesValue *object, int *value); + +/** + * @brief Obtains the Boolean value of an {@Link OH_PreferencesValue} instance. + * + * @param object Pointer to the target {@Link OH_PreferencesValue} instance. + * @param value Pointer to the Boolean value obtained. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} success. + * {@link PREFERENCES_E_INVALID_PARAM} The error code for common invalid args. + * {@link PREFERENCES_E_INNER_ERROR} The error code for Inner error. + * @see OH_PreferencesValue. + * @since 13 + */ +int OH_PreferencesValue_GetBool(const OH_PreferencesValue *object, bool *value); + +/** + * @brief Obtains the string value of an {@Link OH_PreferencesValue} instance. + * + * @param object Pointer to target {@Link OH_PreferencesValue} instance. + * @param value Pointer to the string obtained in a char * array. Release the memory used + * if this parameter is no longer required. + * @param valueLen Pointer to the string length. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} success. + * {@link PREFERENCES_E_INVALID_PARAM} The error code for common invalid args. + * {@link PREFERENCES_E_INNER_ERROR} The error code for Inner error. + * @see OH_PreferencesValue. + * @since 13 + */ +int OH_PreferencesValue_GetString(const OH_PreferencesValue *object, char **value, uint32_t *valueLen); +#ifdef __cplusplus +}; +#endif +#endif // OH_PREFERENCES_VALUE_H \ No newline at end of file diff --git a/distributeddatamgr/preferences/libpreferences.ndk.json b/distributeddatamgr/preferences/libpreferences.ndk.json index 6011e71c0..dc89114f2 100644 --- a/distributeddatamgr/preferences/libpreferences.ndk.json +++ b/distributeddatamgr/preferences/libpreferences.ndk.json @@ -1,338 +1,90 @@ [ { - "first_introduced": "12", - "name": "OH_Utd_Create" + "first_introduced": "13", + "name": "OH_Preferences_Open" }, { - "first_introduced": "12", - "name": "OH_Utd_Destroy" + "first_introduced": "13", + "name": "OH_Preferences_Close" }, { - "first_introduced": "12", - "name": "OH_Utd_GetTypeId" + "first_introduced": "13", + "name": "OH_Preferences_GetInt" }, { - "first_introduced": "12", - "name": "OH_Utd_GetDescription" + "first_introduced": "13", + "name": "OH_Preferences_GetBool" }, { - "first_introduced": "12", - "name": "OH_Utd_GetReferenceUrl" + "first_introduced": "13", + "name": "OH_Preferences_GetString" }, { - "first_introduced": "12", - "name": "OH_Utd_GetIconFile" + "first_introduced": "13", + "name": "OH_Preferences_SetInt" }, { - "first_introduced": "12", - "name": "OH_Utd_GetBelongingToTypes" + "first_introduced": "13", + "name": "OH_Preferences_SetBool" }, { - "first_introduced": "12", - "name": "OH_Utd_GetFilenameExtensions" + "first_introduced": "13", + "name": "OH_Preferences_SetString" }, { - "first_introduced": "12", - "name": "OH_Utd_GetMimeTypes" + "first_introduced": "13", + "name": "OH_Preferences_Delete" }, { - "first_introduced": "12", - "name": "OH_Utd_GetTypesByFilenameExtension" + "first_introduced": "13", + "name": "OH_Preferences_RegisterDataObserver" }, { - "first_introduced": "12", - "name": "OH_Utd_GetTypesByMimeType" + "first_introduced": "13", + "name": "OH_Preferences_UnregisterDataObserver" }, { - "first_introduced": "12", - "name": "OH_Utd_BelongsTo" + "first_introduced": "13", + "name": "OH_PreferencesOption_Create" }, { - "first_introduced": "12", - "name": "OH_Utd_IsLower" + "first_introduced": "13", + "name": "OH_PreferencesOption_SetFilePath" }, { - "first_introduced": "12", - "name": "OH_Utd_IsHigher" + "first_introduced": "13", + "name": "OH_PreferencesOption_SetBundleName" }, { - "first_introduced": "12", - "name": "OH_Utd_Equals" + "first_introduced": "13", + "name": "OH_PreferencesOption_SetDataGroupId" }, { - "first_introduced": "12", - "name": "OH_Utd_DestroyStringList" + "first_introduced": "13", + "name": "OH_PreferencesOption_Destroy" }, { - "first_introduced": "12", - "name": "OH_UdsPlainText_Create" + "first_introduced": "13", + "name": "OH_PreferencesPair_GetKey" }, { - "first_introduced": "12", - "name": "OH_UdsPlainText_Destroy" + "first_introduced": "13", + "name": "OH_PreferencesPair_GetPreferencesValue" }, { - "first_introduced": "12", - "name": "OH_UdsPlainText_GetType" + "first_introduced": "13", + "name": "OH_PreferencesValue_GetValueType" }, { - "first_introduced": "12", - "name": "OH_UdsPlainText_GetContent" + "first_introduced": "13", + "name": "OH_PreferencesValue_GetInt" }, { - "first_introduced": "12", - "name": "OH_UdsPlainText_GetAbstract" + "first_introduced": "13", + "name": "OH_PreferencesValue_GetBool" }, { - "first_introduced": "12", - "name": "OH_UdsPlainText_SetContent" - }, - { - "first_introduced": "12", - "name": "OH_UdsPlainText_SetAbstract" - }, - { - "first_introduced": "12", - "name": "OH_UdsHyperlink_Create" - }, - { - "first_introduced": "12", - "name": "OH_UdsHyperlink_Destroy" - }, - { - "first_introduced": "12", - "name": "OH_UdsHyperlink_GetType" - }, - { - "first_introduced": "12", - "name": "OH_UdsHyperlink_GetUrl" - }, - { - "first_introduced": "12", - "name": "OH_UdsHyperlink_GetDescription" - }, - { - "first_introduced": "12", - "name": "OH_UdsHyperlink_SetUrl" - }, - { - "first_introduced": "12", - "name": "OH_UdsHyperlink_SetDescription" - }, - { - "first_introduced": "12", - "name": "OH_UdsHtml_Create" - }, - { - "first_introduced": "12", - "name": "OH_UdsHtml_Destroy" - }, - { - "first_introduced": "12", - "name": "OH_UdsHtml_GetType" - }, - { - "first_introduced": "12", - "name": "OH_UdsHtml_GetContent" - }, - { - "first_introduced": "12", - "name": "OH_UdsHtml_GetPlainContent" - }, - { - "first_introduced": "12", - "name": "OH_UdsHtml_SetContent" - }, - { - "first_introduced": "12", - "name": "OH_UdsHtml_SetPlainContent" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_Create" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_Destroy" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_GetType" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_GetId" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_GetName" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_GetIconId" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_GetLabelId" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_GetBundleName" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_GetAbilityName" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_SetId" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_SetName" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_SetIconId" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_SetLabelId" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_SetBundleName" - }, - { - "first_introduced": "12", - "name": "OH_UdsAppItem_SetAbilityName" - }, - { - "first_introduced": "12", - "name": "OH_UdmfData_Create" - }, - { - "first_introduced": "12", - "name": "OH_UdmfData_Destroy" - }, - { - "first_introduced": "12", - "name": "OH_UdmfData_AddRecord" - }, - { - "first_introduced": "12", - "name": "OH_UdmfData_HasType" - }, - { - "first_introduced": "12", - "name": "OH_UdmfData_GetTypes" - }, - { - "first_introduced": "12", - "name": "OH_UdmfData_GetRecords" - }, - { - "first_introduced": "12", - "name": "OH_UdmfRecord_Create" - }, - { - "first_introduced": "12", - "name": "OH_UdmfRecord_Destroy" - }, - { - "first_introduced": "12", - "name": "OH_UdmfRecord_AddGeneralEntry" - }, - { - "first_introduced": "12", - "name": "OH_UdmfRecord_AddPlainText" - }, - { - "first_introduced": "12", - "name": "OH_UdmfRecord_AddHyperlink" - }, - { - "first_introduced": "12", - "name": "OH_UdmfRecord_AddHtml" - }, - { - "first_introduced": "12", - "name": "OH_UdmfRecord_AddAppItem" - }, - { - "first_introduced": "12", - "name": "OH_UdmfRecord_GetTypes" - }, - { - "first_introduced": "12", - "name": "OH_UdmfRecord_GetGeneralEntry" - }, - { - "first_introduced": "12", - "name": "OH_UdmfRecord_GetPlainText" - }, - { - "first_introduced": "12", - "name": "OH_UdmfRecord_GetHyperlink" - }, - { - "first_introduced": "12", - "name": "OH_UdmfRecord_GetHtml" - }, - { - "first_introduced": "12", - "name": "OH_UdmfRecord_GetAppItem" - }, - { - "first_introduced": "12", - "name": "OH_UdmfProperty_Create" - }, - { - "first_introduced": "12", - "name": "OH_UdmfProperty_Destroy" - }, - { - "first_introduced": "12", - "name": "OH_UdmfProperty_GetTag" - }, - { - "first_introduced": "12", - "name": "OH_UdmfProperty_GetTimestamp" - }, - { - "first_introduced": "12", - "name": "OH_UdmfProperty_GetShareOption" - }, - { - "first_introduced": "12", - "name": "OH_UdmfProperty_GetExtrasIntParam" - }, - { - "first_introduced": "12", - "name": "OH_UdmfProperty_GetExtrasStringParam" - }, - { - "first_introduced": "12", - "name": "OH_UdmfProperty_SetTag" - }, - { - "first_introduced": "12", - "name": "OH_UdmfProperty_SetShareOption" - }, - { - "first_introduced": "12", - "name": "OH_UdmfProperty_SetExtrasIntParam" - }, - { - "first_introduced": "12", - "name": "OH_UdmfProperty_SetExtrasStringParam" - }, - { - "first_introduced": "12", - "name": "OH_Udmf_GetUnifiedData" - }, - { - "first_introduced": "12", - "name": "OH_Udmf_SetUnifiedData" + "first_introduced": "13", + "name": "OH_PreferencesValue_GetString" } ] \ No newline at end of file -- Gitee From 4663777053a21f666b582f0676c1ca724732f9a5 Mon Sep 17 00:00:00 2001 From: zwtmichael Date: Mon, 2 Sep 2024 17:57:47 +0800 Subject: [PATCH 225/620] modify errCode Signed-off-by: zwtmichael --- .../preferences/include/oh_preferences.h | 59 +++++++++++-------- .../include/oh_preferences_err_code.h | 16 ++--- .../include/oh_preferences_option.h | 4 +- .../include/oh_preferences_value.h | 30 ++++++---- 4 files changed, 64 insertions(+), 45 deletions(-) diff --git a/distributeddatamgr/preferences/include/oh_preferences.h b/distributeddatamgr/preferences/include/oh_preferences.h index 8beda9588..1b6255549 100644 --- a/distributeddatamgr/preferences/include/oh_preferences.h +++ b/distributeddatamgr/preferences/include/oh_preferences.h @@ -74,9 +74,11 @@ typedef void (*OH_PreferencesDataObserver)(void *context, const OH_PreferencesPa * @return Returns an pointer to the Preferences object in {@Link OH_Preferences} if the operation is successful, * returns nullptr otherwise. * {@link PREFERENCES_OK} indicates the operation is successful. - * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. - * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. - * {@link PREFERENCES_NOT_SUPPORTED} indicates the capability is not supported. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_ERROR_NOT_SUPPORTED} indicates the capability is not supported. + * {@link PREFERENCES_ERROR_DELETE_FILE} indicates delete file failed. + * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. + * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. * @see OH_Preferences OH_PreferencesOption. * @since 13 */ @@ -89,8 +91,9 @@ OH_Preferences *OH_Preferences_Open(OH_PreferencesOption *option, int *errCode); * @param option Pointer to an {@Link OH_PreferencesOption} instance. * @return Returns the status code of the execution. For details, see {@Link OH_Preferences_ErrCode}. * {@link PREFERENCES_OK} indicates the operation is successful. - * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. - * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. + * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. * @see OH_Preferences. * @since 13 */ @@ -104,8 +107,9 @@ int OH_Preferences_Close(OH_Preferences *preference); * @param value Pointer to the value obtained. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} indicates the operation is successful. - * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. - * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. + * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. * @see OH_Preferences. * @since 13 */ @@ -119,8 +123,9 @@ int OH_Preferences_GetInt(OH_Preferences *preference, const char *key, int *valu * @param value Pointer to the Boolean value obtained. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} indicates the operation is successful. - * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. - * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. + * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. * @see OH_Preferences. * @since 13 */ @@ -136,8 +141,9 @@ int OH_Preferences_GetBool(OH_Preferences *preference, const char *key, bool *va * @param valueLen Pointer to the length of the string obtained. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} indicates the operation is successful. - * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. - * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. + * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. * @see OH_Preferences. * @since 13 */ @@ -151,8 +157,9 @@ int OH_Preferences_GetString(OH_Preferences *preference, const char *key, char * * @param value Value to set. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} indicates the operation is successful. - * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. - * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. + * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. * @see OH_Preferences. * @since 13 */ @@ -166,8 +173,9 @@ int OH_Preferences_SetInt(OH_Preferences *preference, const char *key, int value * @param value Boolean value to set. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} indicates the operation is successful. - * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. - * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. + * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. * @see OH_Preferences. * @since 13 */ @@ -181,8 +189,9 @@ int OH_Preferences_SetBool(OH_Preferences *preference, const char *key, bool val * @param value Point to string to set. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} indicates the operation is successful. - * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. - * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. + * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. * @see OH_Preferences. * @since 13 */ @@ -195,8 +204,9 @@ int OH_Preferences_SetString(OH_Preferences *preference, const char *key, const * @param key Pointer to the key of the data to delete. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} indicates the operation is successful. - * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. - * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. + * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. * @see OH_Preferences. * @since 13 */ @@ -212,8 +222,10 @@ int OH_Preferences_Delete(OH_Preferences *preference, const char *key); * @param keyCount Number of keys to observe. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} indicates the operation is successful. - * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. - * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. + * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. + * {@link PREFERENCES_ERROR_GET_DATAOBSMGRCLIENT} indicates get dataObsMgrClient error. * @see OH_Preferences OH_PreferencesDataObserver. * @since 13 */ @@ -229,8 +241,9 @@ int OH_Preferences_RegisterDataObserver(OH_Preferences *preference, void *contex * @param keyCount Number of the keys. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} indicates the operation is successful. - * {@link PREFERENCES_E_INVALID_PARAM} indicates invalid args are passed in. - * {@link PREFERENCES_E_INNER_ERROR} indicates an inner error. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. + * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. * @see OH_Preferences OH_PreferencesDataObserver. * @since 13 */ diff --git a/distributeddatamgr/preferences/include/oh_preferences_err_code.h b/distributeddatamgr/preferences/include/oh_preferences_err_code.h index 6ece14603..0d68f259d 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_err_code.h +++ b/distributeddatamgr/preferences/include/oh_preferences_err_code.h @@ -53,17 +53,19 @@ typedef enum OH_Preferences_ErrCode { /** @error Operation successful. */ PREFERENCES_OK = 0, /* @error Invalid args. */ - PREFERENCES_E_INVALID_PARAM = 401, + PREFERENCES_ERROR_INVALID_PARAM = 401, /* @error Capability not supported. */ - PREFERENCES_NOT_SUPPORTED = 801, + PREFERENCES_ERROR_NOT_SUPPORTED = 801, /* @error Base error code. */ - PREFERENCES_BASE = 15500000, - /* @error Inner error. */ - PREFERENCES_E_INNER_ERROR = PREFERENCES_BASE, + PREFERENCES_ERROR_BASE = 15500000, /* @error Failed to delete a file. */ - PREFERENCES_DELETE_FILE_FAIL = (PREFERENCES_BASE + 10), + PREFERENCES_ERROR_DELETE_FILE = (PREFERENCES_ERROR_BASE + 10), + /* @error Storage error. */ + PREFERENCES_ERROR_STORAGE = (PREFERENCES_ERROR_BASE + 11), + /* @error Failed to malloc memory. */ + PREFERENCES_ERROR_MALLOC = (PREFERENCES_ERROR_BASE + 12), /* @error Failed to get DataObsMgrClient. */ - PREFERENCES_GET_DATAOBSMGRCLIENT_FAIL = (PREFERENCES_BASE + 19), + PREFERENCES_ERROR_GET_DATAOBSMGRCLIENT = (PREFERENCES_ERROR_BASE + 19), } OH_Preferences_ErrCode; #ifdef __cplusplus diff --git a/distributeddatamgr/preferences/include/oh_preferences_option.h b/distributeddatamgr/preferences/include/oh_preferences_option.h index 50eca8b61..6efb917f9 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_option.h +++ b/distributeddatamgr/preferences/include/oh_preferences_option.h @@ -56,11 +56,11 @@ typedef struct OH_PreferencesOption OH_PreferencesOption; * @brief Creates an {@Link OH_PreferencesOption} instance. * * @return Returns a pointer to the {@Link OH_PreferencesOption} instance created if the operation is successful; - * returns nullptr otherwise. + * returns nullptr otherwise while malloc memory failed. * @see OH_PreferencesOption. * @since 13 */ -OH_PreferencesOption *OH_PreferencesOption_Create(); +OH_PreferencesOption *OH_PreferencesOption_Create(void); /** * @brief Sets the file path in an {@Link OH_PreferencesOption} instance. diff --git a/distributeddatamgr/preferences/include/oh_preferences_value.h b/distributeddatamgr/preferences/include/oh_preferences_value.h index 6ebd7aafd..bf3567776 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_value.h +++ b/distributeddatamgr/preferences/include/oh_preferences_value.h @@ -92,8 +92,8 @@ typedef struct OH_PreferencesValue OH_PreferencesValue; * * @param pairs Pointer to the target {@Link OH_PreferencesPair} instance. * @param index Represents a target index of the pairs - * @return Returns preferences pointer to the key that when input parameters valid, otherwise return nullptr. - * otherwise return nullptr. + * @return Returns preferences pointer to the key that when input parameters valid, + * return nullptr otherwise while invalid args are passed in. * @see OH_PreferencesPair. * @since 13 */ @@ -105,7 +105,7 @@ const char *OH_PreferencesPair_GetKey(const OH_PreferencesPair *pairs, uint32_t * @param pairs Pointer to the target {@Link OH_PreferencesPair} instance. * @param index Index of the value to obtain. * @return Returns a pointer to the {@Link OH_PreferencesValue} obtained if the operation is successful, - * returns nullptr otherwise. + * returns nullptr otherwise while invalid args are passed in. * @see OH_PreferencesValue. * @since 13 */ @@ -115,7 +115,8 @@ const OH_PreferencesValue *OH_PreferencesPair_GetPreferencesValue(const OH_Prefe * @brief Obtains the type of a preferences value. * * @param object Pointer to the target {@Link OH_PreferencesValue} instance. - * @return Returns the value type obtained if the operation is successful, returns TYPE_NULL otherwise. + * @return Returns the value type obtained. + * {@link TYPE_NULL} indicates invalid args are passed in. * @see OH_PreferencesValue. * @since 13 */ @@ -127,9 +128,10 @@ Preference_ValueType OH_PreferencesValue_GetValueType(const OH_PreferencesValue * @param object Pointer to the target {@Link OH_PreferencesValue} instance. * @param value Pointer to the value obtained. * @return Returns the status code of the execution. - * {@link PREFERENCES_OK} success. - * {@link PREFERENCES_E_INVALID_PARAM} The error code for common invalid args. - * {@link PREFERENCES_E_INNER_ERROR} The error code for Inner error. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. + * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. * @see OH_PreferencesValue. * @since 13 */ @@ -141,9 +143,10 @@ int OH_PreferencesValue_GetInt(const OH_PreferencesValue *object, int *value); * @param object Pointer to the target {@Link OH_PreferencesValue} instance. * @param value Pointer to the Boolean value obtained. * @return Returns the status code of the execution. - * {@link PREFERENCES_OK} success. - * {@link PREFERENCES_E_INVALID_PARAM} The error code for common invalid args. - * {@link PREFERENCES_E_INNER_ERROR} The error code for Inner error. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. + * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. * @see OH_PreferencesValue. * @since 13 */ @@ -157,9 +160,10 @@ int OH_PreferencesValue_GetBool(const OH_PreferencesValue *object, bool *value); * if this parameter is no longer required. * @param valueLen Pointer to the string length. * @return Returns the status code of the execution. - * {@link PREFERENCES_OK} success. - * {@link PREFERENCES_E_INVALID_PARAM} The error code for common invalid args. - * {@link PREFERENCES_E_INNER_ERROR} The error code for Inner error. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. + * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. * @see OH_PreferencesValue. * @since 13 */ -- Gitee From 4348f330734d0a402efc2f4baa0058612e98a04a Mon Sep 17 00:00:00 2001 From: zwtmichael Date: Mon, 2 Sep 2024 21:19:25 +0800 Subject: [PATCH 226/620] fix commitment Signed-off-by: zwtmichael --- .../preferences/include/oh_preferences.h | 18 ++++++++++++++---- .../include/oh_preferences_err_code.h | 8 ++++---- .../include/oh_preferences_option.h | 8 +++++++- .../preferences/include/oh_preferences_value.h | 4 ++-- .../preferences/libpreferences.ndk.json | 4 ++++ 5 files changed, 31 insertions(+), 11 deletions(-) diff --git a/distributeddatamgr/preferences/include/oh_preferences.h b/distributeddatamgr/preferences/include/oh_preferences.h index 1b6255549..4d3cbf0a7 100644 --- a/distributeddatamgr/preferences/include/oh_preferences.h +++ b/distributeddatamgr/preferences/include/oh_preferences.h @@ -136,8 +136,8 @@ int OH_Preferences_GetBool(OH_Preferences *preference, const char *key, bool *va * * @param preference Pointer to the target {@Link OH_Preferences} instance. * @param key Pointer to the key of the value to obtain. - * @param value Double pointer to the value obtained in an char * array. Release the memory used - * when this parameter is no longer required. + * @param value Double pointer to the value obtained in an char * array. Release {@Link OH_Preferences_FreeString} the + * memory by user when this parameter is no longer required. * @param valueLen Pointer to the length of the string obtained. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} indicates the operation is successful. @@ -149,6 +149,15 @@ int OH_Preferences_GetBool(OH_Preferences *preference, const char *key, bool *va */ int OH_Preferences_GetString(OH_Preferences *preference, const char *key, char **value, uint32_t *valueLen); +/** + * @brief Free a string got by Preferences object. + * + * @param string Point to string need to free. + * @see OH_Preferences. + * @since 13 + */ +void OH_Preferences_FreeString(char *string); + /** * @brief Sets an integer in a Preferences object. * @@ -236,6 +245,7 @@ int OH_Preferences_RegisterDataObserver(OH_Preferences *preference, void *contex * @brief Unregisters a data observer for a Preferences object. * * @param preference Pointer to the target {@Link OH_Preferences} instance. + * @param context Pointer to the context of the data observer. * @param observer Pointer to the {@Link OH_PreferencesDataObserver} to unregister. * @param keys Pointer to the keys observed. If this parameter is null, this API unregisters the listening for all keys. * @param keyCount Number of the keys. @@ -247,8 +257,8 @@ int OH_Preferences_RegisterDataObserver(OH_Preferences *preference, void *contex * @see OH_Preferences OH_PreferencesDataObserver. * @since 13 */ -int OH_Preferences_UnregisterDataObserver(OH_Preferences *preference, const OH_PreferencesDataObserver *observer, - const char *keys[], uint32_t keyCount); +int OH_Preferences_UnregisterDataObserver(OH_Preferences *preference, void *context, + const OH_PreferencesDataObserver *observer, const char *keys[], uint32_t keyCount); #ifdef __cplusplus }; diff --git a/distributeddatamgr/preferences/include/oh_preferences_err_code.h b/distributeddatamgr/preferences/include/oh_preferences_err_code.h index 0d68f259d..36727411d 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_err_code.h +++ b/distributeddatamgr/preferences/include/oh_preferences_err_code.h @@ -59,13 +59,13 @@ typedef enum OH_Preferences_ErrCode { /* @error Base error code. */ PREFERENCES_ERROR_BASE = 15500000, /* @error Failed to delete a file. */ - PREFERENCES_ERROR_DELETE_FILE = (PREFERENCES_ERROR_BASE + 10), + PREFERENCES_ERROR_DELETE_FILE = 15500010, /* @error Storage error. */ - PREFERENCES_ERROR_STORAGE = (PREFERENCES_ERROR_BASE + 11), + PREFERENCES_ERROR_STORAGE = 15500011, /* @error Failed to malloc memory. */ - PREFERENCES_ERROR_MALLOC = (PREFERENCES_ERROR_BASE + 12), + PREFERENCES_ERROR_MALLOC = 15500012, /* @error Failed to get DataObsMgrClient. */ - PREFERENCES_ERROR_GET_DATAOBSMGRCLIENT = (PREFERENCES_ERROR_BASE + 19), + PREFERENCES_ERROR_GET_DATAOBSMGRCLIENT = 15500019, } OH_Preferences_ErrCode; #ifdef __cplusplus diff --git a/distributeddatamgr/preferences/include/oh_preferences_option.h b/distributeddatamgr/preferences/include/oh_preferences_option.h index 6efb917f9..4b2d1d953 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_option.h +++ b/distributeddatamgr/preferences/include/oh_preferences_option.h @@ -69,6 +69,7 @@ OH_PreferencesOption *OH_PreferencesOption_Create(void); * @param filePath Pointer to the file path to set. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} success. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. * @see OH_PreferencesOption. * @since 13 */ @@ -81,6 +82,7 @@ int OH_PreferencesOption_SetFilePath(OH_PreferencesOption *option, const char *f * @param bundleName Pointer to the bundle name to set. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} success. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. * @see OH_PreferencesOption. * @since 13 */ @@ -93,6 +95,7 @@ int OH_PreferencesOption_SetBundleName(OH_PreferencesOption *option, const char * @param dataGroupId Represents preferences data group id param. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} success. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. * @see OH_PreferencesOption. * @since 13 */ @@ -102,10 +105,13 @@ int OH_PreferencesOption_SetDataGroupId(OH_PreferencesOption *option, const char * @brief Destroys an {@Link OH_PreferencesOption} instance. * * @param option Pointer to the {@Link OH_PreferencesOption} instance to destroy. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. * @see OH_PreferencesOption. * @since 13 */ -void OH_PreferencesOption_Destroy(OH_PreferencesOption *option); +int OH_PreferencesOption_Destroy(OH_PreferencesOption *option); #ifdef __cplusplus }; #endif diff --git a/distributeddatamgr/preferences/include/oh_preferences_value.h b/distributeddatamgr/preferences/include/oh_preferences_value.h index bf3567776..5fd358f32 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_value.h +++ b/distributeddatamgr/preferences/include/oh_preferences_value.h @@ -156,8 +156,8 @@ int OH_PreferencesValue_GetBool(const OH_PreferencesValue *object, bool *value); * @brief Obtains the string value of an {@Link OH_PreferencesValue} instance. * * @param object Pointer to target {@Link OH_PreferencesValue} instance. - * @param value Pointer to the string obtained in a char * array. Release the memory used - * if this parameter is no longer required. + * @param value Double pointer to the value obtained in an char * array. Release {@Link OH_Preferences_FreeString} the + * memory by user when this parameter is no longer required. * @param valueLen Pointer to the string length. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} indicates the operation is successful. diff --git a/distributeddatamgr/preferences/libpreferences.ndk.json b/distributeddatamgr/preferences/libpreferences.ndk.json index dc89114f2..fa4a164ed 100644 --- a/distributeddatamgr/preferences/libpreferences.ndk.json +++ b/distributeddatamgr/preferences/libpreferences.ndk.json @@ -19,6 +19,10 @@ "first_introduced": "13", "name": "OH_Preferences_GetString" }, + { + "first_introduced": "13", + "name": "OH_Preferences_FreeString" + }, { "first_introduced": "13", "name": "OH_Preferences_SetInt" -- Gitee From 71b383a79b24a0486164c60c5f86a3b37e584836 Mon Sep 17 00:00:00 2001 From: zwtmichael Date: Mon, 2 Sep 2024 23:19:58 +0800 Subject: [PATCH 227/620] add new errCode Signed-off-by: zwtmichael --- distributeddatamgr/preferences/include/oh_preferences.h | 3 +++ .../preferences/include/oh_preferences_err_code.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/distributeddatamgr/preferences/include/oh_preferences.h b/distributeddatamgr/preferences/include/oh_preferences.h index 4d3cbf0a7..b3ee03cb2 100644 --- a/distributeddatamgr/preferences/include/oh_preferences.h +++ b/distributeddatamgr/preferences/include/oh_preferences.h @@ -110,6 +110,7 @@ int OH_Preferences_Close(OH_Preferences *preference); * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. + * {@link PREFERENCES_ERROR_KEY_NOT_FOUND} indicates the key does not exist. * @see OH_Preferences. * @since 13 */ @@ -126,6 +127,7 @@ int OH_Preferences_GetInt(OH_Preferences *preference, const char *key, int *valu * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. + * {@link PREFERENCES_ERROR_KEY_NOT_FOUND} indicates the key does not exist. * @see OH_Preferences. * @since 13 */ @@ -144,6 +146,7 @@ int OH_Preferences_GetBool(OH_Preferences *preference, const char *key, bool *va * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. * {@link PREFERENCES_ERROR_STORAGE} indicates an storage error. * {@link PREFERENCES_ERROR_MALLOC} indicates an malloc memory error. + * {@link PREFERENCES_ERROR_KEY_NOT_FOUND} indicates the key does not exist. * @see OH_Preferences. * @since 13 */ diff --git a/distributeddatamgr/preferences/include/oh_preferences_err_code.h b/distributeddatamgr/preferences/include/oh_preferences_err_code.h index 36727411d..5b77219b9 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_err_code.h +++ b/distributeddatamgr/preferences/include/oh_preferences_err_code.h @@ -64,6 +64,8 @@ typedef enum OH_Preferences_ErrCode { PREFERENCES_ERROR_STORAGE = 15500011, /* @error Failed to malloc memory. */ PREFERENCES_ERROR_MALLOC = 15500012, + /* @error Key not found error. */ + PREFERENCES_ERROR_KEY_NOT_FOUND = 15500013, /* @error Failed to get DataObsMgrClient. */ PREFERENCES_ERROR_GET_DATAOBSMGRCLIENT = 15500019, } OH_Preferences_ErrCode; -- Gitee From d8dff3bf26d57591d23f15a236cc0270d36fb1b4 Mon Sep 17 00:00:00 2001 From: HYH Date: Tue, 3 Sep 2024 17:59:45 +0800 Subject: [PATCH 228/620] add c api Signed-off-by: HYH --- .../kits/c/input/oh_input_manager.h | 182 +++++++++++++++++- multimodalinput/kits/c/ohinput.ndk.json | 56 ++++++ 2 files changed, 236 insertions(+), 2 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 1e6c0dd85..18204bd8c 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -228,6 +228,12 @@ typedef enum Input_Result { INPUT_REPEAT_INTERCEPTOR = 4200001 } Input_Result; +/** + * @brief Callback used to return shortcut key events. + * @since 13 + */ +typedef void (*Input_HotkeyCallback)(Input_Hotkey* hotkey); + /** * @brief Defines a lifecycle callback for keyEvent. If the callback is triggered, keyEvent will be destroyed. * @@ -1187,7 +1193,7 @@ Input_Result OH_Input_AddInputEventInterceptor(Input_InterceptorEventCallback *c * @syscap SystemCapability.MultimodalInput.Input.Core * @since 12 */ -Input_Result OH_Input_RemoveKeyEventInterceptor(); +Input_Result OH_Input_RemoveKeyEventInterceptor(void); /** * @brief Removes an interceptor for input events, including mouse, touch, and axis events. @@ -1200,7 +1206,179 @@ Input_Result OH_Input_RemoveKeyEventInterceptor(); * @syscap SystemCapability.MultimodalInput.Input.Core * @since 12 */ -Input_Result OH_Input_RemoveInputEventInterceptor(); +Input_Result OH_Input_RemoveInputEventInterceptor(void); + +/** + * @brief Obtains the interval since the last system input event. + * + * @param timeInterval Interval, in microseconds. + * @return OH_Input_GetIntervalSinceLastInput status code, specifically. + * {@Link INPUT_SUCCESS} if the Operation is successful.\n + * {@Link INPUT_SERVICE_EXCEPTION} Failed to get the interval because the service is exception.\n + * {@Link INPUT_PARAMETER_ERROR} The timeInterval is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetIntervalSinceLastInput(int64_t *timeInterval); + +/** + * @brief Creates a hot key object. + * + * @return Returns an {@Link Input_Hotkey} pointer object if the operation is successful. Otherwise, a null pointer is + * returned. The possible cause is memory allocation failure. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Hotkey *OH_Input_CreateHotkey(void); + +/** + * @brief Destroys a hot key object. + * + * @param hotkey Hot key object. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +void OH_Input_DestroyHotkey(Input_Hotkey **hotkey); + +/** + * @brief Sets a modifier key. + * + * @param hotkey Hotkey key object. + * @param preKeys List of modifier keys. + * @param size Number of modifier keys. One or two modifier keys are supported. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +void OH_Input_SetPreKeys(Input_Hotkey *hotkey, int32_t *preKeys, int32_t size); + +/** + * @brief Obtains a modifier key. + * + * @param hotkey Hotkey key object. + * @param preKeys List of modifier keys. + * @param preKeyCount Number of modifier keys. + * @return OH_Input_GetPreKeys status code, specifically, + * {@link INPUT_SUCCESS} if the operation is successful;\n + * {@link INPUT_PARAMETER_ERROR} The hotkey is NULL or the pressedKeys is NULL or the pressedKeyCount + * is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetPreKeys(const Input_Hotkey *hotkey, int32_t **preKeys, int32_t *preKeyCount); + +/** + * @brief Sets a modified key. + * + * @param hotkey Hotkey key object. + * @param finalKey Modified key. Only one modified key is supported. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +void OH_Input_SetFinalKey(Input_Hotkey *hotkey, int32_t finalKey); + +/** + * @brief Obtains a modified key. + * + * @param hotkey Hotkey key object. + * @param finalKeyCode Returns the key value of the decorated key. + * @return OH_Input_GetfinalKey status code, specifically, + * {@link INPUT_SUCCESS} if the operation is successful;\n + * {@link INPUT_PARAMETER_ERROR} The hotkey is NULL or the finalKeyCode is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetFinalKey(const Input_Hotkey *hotkey, int32_t *finalKeyCode); + +/** + * @brief Creates an array of {@Link Input_Hotkey} instances. + * + * @param count Number of {@Link Input_Hotkey} instances to be created. The count must be the same as the number of + * system shortcut keys. + * @return Returns a pointer to an array of {@Link Input_Hotkey} instances if the operation is successful. If the + * operation fails, a null pointer is returned. The possible cause is memory allocation failure or count is not equal + * to the number of system hotkeys. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Hotkey **OH_Input_CreateAllSystemHotkeys(int32_t count); + +/** + * @brief Destroys an array of {@link Input_Hotkey} instances and reclaims memory. + * + * @param hotkeys Pointer to an array of {@Link Input_Hotkey } instances created by the + * {@Link OH_Input_CreateAllSystemHotkeys} method. + * @param count Count of the array to be destroyed, which must be the same as the number of system shortcut keys. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +void OH_Input_DestroyAllSystemHotkeys(Input_Hotkey **hotkeys, int32_t count); + +/** + * @brief Obtains all hot keys supported by the system. + * + * @param hotkey Array of {@Link Input_Hotkey} instances. + * When calling this API for the first time, you can pass NULL to obtain the array length. + * @param count Number of hot keys supported by the system. + * @return OH_Input_GetAllSystemHotkeys status code, specifically, + * {@link INPUT_SUCCESS} if the operation is successful;\n + * {@link INPUT_PARAMETER_ERROR} The hotkey or count is NULL, or the value of count does not match the number + * of system shortcut keys supported by the system. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_GetAllSystemHotkeys(Input_Hotkey **hotkey, int32_t *count); + +/** + * @brief Specifies whether to report repeated key events. + * + * @param hotkey Shortcut key object. + * @param isRepeat Whether to report repeated key events. + * The value true means to report repeated key events, and the value false means the opposite. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +void OH_Input_SetRepeat(Input_Hotkey* hotkey, bool isRepeat); + +/** + * @brief Checks whether to report repeated key events. + * + * @param hotkey Shortcut key object. + * @param isRepeat Whether a key event is repeated. + * @return OH_Input_GetIsRepeat status code, specifically, + * {@link INPUT_SUCCESS} if the operation is successful;\n + * {@link INPUT_PARAMETER_ERROR} otherwise.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_IsRepeat(const Input_Hotkey* hotkey, bool *isRepeat); + +/** + * @brief Subscribes to shortcut key events. + * + * @param hotkey Shortcut key object. + * @param callback Callback used to return shortcut key events. + * @return OH_Input_AddHotkeyMonitor status code, specifically, + * {@link INPUT_SUCCESS} if the operation is successful;\n + * {@link INPUT_PARAMETER_ERROR} if parameter verification fails;\n + * {@link INPUT_SERVICE_EXCEPTION} if the service is abnormal probably + * because subscription to shortcut key events has been enabled.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_AddHotkeyMonitor(const Input_Hotkey* hotkey, Input_HotkeyCallback callback); + +/** + * @brief Unsubscribes from shortcut key events. + * + * @param hotkey Shortcut key object. + * @param callback Callback used to return shortcut key events. + * @return OH_Input_RemoveHotkeyMonitor status code, specifically, + * {@link INPUT_SUCCESS} if the operation is successful;\n + * {@link INPUT_PARAMETER_ERROR} if parameter verification fails;\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ +Input_Result OH_Input_RemoveHotkeyMonitor(const Input_Hotkey* hotkey, Input_HotkeyCallback callback); #ifdef __cplusplus } #endif diff --git a/multimodalinput/kits/c/ohinput.ndk.json b/multimodalinput/kits/c/ohinput.ndk.json index cfbe993ae..ac5694b14 100644 --- a/multimodalinput/kits/c/ohinput.ndk.json +++ b/multimodalinput/kits/c/ohinput.ndk.json @@ -314,5 +314,61 @@ { "first_introduced": "12", "name": "OH_Input_RemoveInputEventInterceptor" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetIntervalSinceLastInput" + }, + { + "first_introduced": "13", + "name": "OH_Input_CreateAllSystemHotkeys" + }, + { + "first_introduced": "13", + "name": "OH_Input_DestroyAllSystemHotkeys" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetAllSystemHotkeys" + }, + { + "first_introduced": "13", + "name": "OH_Input_CreateHotkey" + }, + { + "first_introduced": "13", + "name": "OH_Input_DestroyHotkey" + }, + { + "first_introduced": "13", + "name": "OH_Input_SetPreKeys" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetPreKeys" + }, + { + "first_introduced": "13", + "name": "OH_Input_SetFinalKey" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetFinalKey" + }, + { + "first_introduced": "13", + "name": "OH_Input_AddHotkeyMonitor" + }, + { + "first_introduced": "13", + "name": "OH_Input_RemoveHotkeyMonitor" + }, + { + "first_introduced": "13", + "name": "OH_Input_SetRepeat" + }, + { + "first_introduced": "13", + "name": "OH_Input_IsRepeat" } ] \ No newline at end of file -- Gitee From 2ddbbe7e0b56f38e40ddd1d6148d735f76ff6ca5 Mon Sep 17 00:00:00 2001 From: caochuan Date: Tue, 3 Sep 2024 20:53:11 +0800 Subject: [PATCH 229/620] PictureMetadata API changed to api13 Issue:https://gitee.com/openharmony/interface_sdk_c/issues/IAOLO6?from=project-issue Signed-off-by: caochuan --- .../include/image/image_common.h | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index e9102c89c..b9173661c 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -112,14 +112,14 @@ struct Image_String { /** * @brief Define a PictureMetadata struct type, used for picture metadata. * - * @since 12 + * @since 13 */ struct OH_PictureMetadata; /** * @brief Define a PictureMetadata struct type, used for picture metadata. * - * @since 12 + * @since 13 */ typedef struct OH_PictureMetadata OH_PictureMetadata; @@ -182,7 +182,7 @@ typedef enum { /** * @brief Define the metadata type. * - * @since 12 + * @since 13 */ typedef enum { /* @@ -203,7 +203,7 @@ typedef enum { * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} metadata is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PictureMetadata_Create(Image_MetadataType metadataType, OH_PictureMetadata **metadata); @@ -218,7 +218,7 @@ Image_ErrorCode OH_PictureMetadata_Create(Image_MetadataType metadataType, OH_Pi * {@link IMAGE_BAD_PARAMETER} metadata is nullptr, or key is nullptr, or value is nullptr. * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type, or the metadata type does not match the * auxiliary picture type. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PictureMetadata_GetProperty(OH_PictureMetadata *metadata, Image_String *key, Image_String *value); @@ -233,7 +233,7 @@ Image_ErrorCode OH_PictureMetadata_GetProperty(OH_PictureMetadata *metadata, Ima * {@link IMAGE_BAD_PARAMETER} metadata is nullptr, or key is nullptr, or value is nullptr. * {@link IMAGE_UNSUPPORTED_METADATA} unsupported metadata type, or the metadata type does not match the * auxiliary picture type. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PictureMetadata_SetProperty(OH_PictureMetadata *metadata, Image_String *key, Image_String *value); @@ -244,7 +244,7 @@ Image_ErrorCode OH_PictureMetadata_SetProperty(OH_PictureMetadata *metadata, Ima * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} metadata is nullptr. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PictureMetadata_Release(OH_PictureMetadata *metadata); @@ -258,7 +258,7 @@ Image_ErrorCode OH_PictureMetadata_Release(OH_PictureMetadata *metadata); * {@link IMAGE_BAD_PARAMETER} metadata is nullptr. * {@link IMAGE_ALLOC_FAILED} memory alloc failed. * {@link IMAGE_COPY_FAILED} memory copy failed. - * @since 12 + * @since 13 */ Image_ErrorCode OH_PictureMetadata_Clone(OH_PictureMetadata *oldMetadata, OH_PictureMetadata **newMetadata); @@ -1454,7 +1454,7 @@ static const char *OHOS_IMAGE_PROPERTY_GIF_LOOP_COUNT = "GIFLoopCount"; * It is used in {@link OH_ImageSource_GetImageProperty}. * The top left corner of the fragment image is at the X-coordinate of the original image * - * @since 12 + * @since 13 */ static const char *OHOS_IMAGE_PROPERTY_X_IN_ORIGINAL = "XInOriginal"; @@ -1463,7 +1463,7 @@ static const char *OHOS_IMAGE_PROPERTY_X_IN_ORIGINAL = "XInOriginal"; * It is used in {@link OH_ImageSource_GetImageProperty}. * The top left corner of the fragment image is at the Y-coordinate of the original image * - * @since 12 + * @since 13 */ static const char *OHOS_IMAGE_PROPERTY_Y_IN_ORIGINAL = "YInOriginal"; @@ -1472,7 +1472,7 @@ static const char *OHOS_IMAGE_PROPERTY_Y_IN_ORIGINAL = "YInOriginal"; * It is used in {@link OH_ImageSource_GetImageProperty}. * The width of the fragment image * - * @since 12 + * @since 13 */ static const char *OHOS_IMAGE_PROPERTY_FRAGMENT_WIDTH = "FragmentImageWidth"; @@ -1481,7 +1481,7 @@ static const char *OHOS_IMAGE_PROPERTY_FRAGMENT_WIDTH = "FragmentImageWidth"; * It is used in {@link OH_ImageSource_GetImageProperty}. * The height of the fragment image * - * @since 12 + * @since 13 */ static const char *OHOS_IMAGE_PROPERTY_FRAGMENT_HEIGHT = "FragmentImageHeight"; #ifdef __cplusplus -- Gitee From 98e6d61a2b91e74e07a6ec89687d9d6d8fcd61c7 Mon Sep 17 00:00:00 2001 From: liu-binjun Date: Mon, 2 Sep 2024 14:21:00 +0800 Subject: [PATCH 230/620] feature:add location c api Signed-off-by: liu-binjun --- LocationKit/BUILD.gn | 35 +++ LocationKit/liblocation.ndk.json | 32 +++ LocationKit/oh_location.h | 108 ++++++++++ LocationKit/oh_location_type.h | 356 +++++++++++++++++++++++++++++++ 4 files changed, 531 insertions(+) create mode 100644 LocationKit/BUILD.gn create mode 100644 LocationKit/liblocation.ndk.json create mode 100644 LocationKit/oh_location.h create mode 100644 LocationKit/oh_location_type.h diff --git a/LocationKit/BUILD.gn b/LocationKit/BUILD.gn new file mode 100644 index 000000000..b5718e151 --- /dev/null +++ b/LocationKit/BUILD.gn @@ -0,0 +1,35 @@ +# Copyright (C) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_headers("location_ndk_header") { + dest_dir = "$ndk_headers_out_dir/LocationKit" + sources = [ + "./oh_location.h", + "./oh_location_type.h", + ] +} + +ohos_ndk_library("liblocation_ndk") { + ndk_description_file = "./liblocation.ndk.json" + output_name = "location_ndk" + output_extension = "so" + min_compact_version = "13" + system_capability = "SystemCapability.Location.Location.Core" + system_capability_headers = [ + "./oh_location.h", + "./oh_location_type.h", + ] +} diff --git a/LocationKit/liblocation.ndk.json b/LocationKit/liblocation.ndk.json new file mode 100644 index 000000000..82814ba00 --- /dev/null +++ b/LocationKit/liblocation.ndk.json @@ -0,0 +1,32 @@ +[ + { + "name": "OH_Location_IsLocatingEnabled" + }, + { + "name": "OH_Location_StartLocating" + }, + { + "name": "OH_Location_StopLocating" + }, + { + "name": "OH_LocationInfo_GetBasicInfo" + }, + { + "name": "OH_LocationInfo_GetAdditionalInfo" + }, + { + "name": "OH_Location_CreateRequestConfig" + }, + { + "name": "OH_Location_DestroyRequestConfig" + }, + { + "name": "OH_LocationRequestConfig_SetUseScene" + }, + { + "name": "OH_LocationRequestConfig_SetPowerConsumptionScene" + }, + { + "name": "OH_LocationRequestConfig_SetInterval" + } +] \ No newline at end of file diff --git a/LocationKit/oh_location.h b/LocationKit/oh_location.h new file mode 100644 index 000000000..d99c30c8c --- /dev/null +++ b/LocationKit/oh_location.h @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup Location + * @{ + * + * @brief Provide functions for querying the status of location switch, starting and stopping locating. + * @since 13 + */ +/** + * @file oh_location.h + * @kit LocationKit + * @brief Define interfaces for querying location switch status, starting locating, and stopping locating. + * @library libohlocation.so + * @syscap SystemCapability.Location.Location.Core + * @since 13 + */ + +#ifndef OH_LOCATION_H +#define OH_LOCATION_H + +#include "oh_location_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Check whether the location switch is enabled. + * + * @param enabled - It is a boolean pointer used to receive location switch status values.\n + * Equal to true indicates that the location switch is turned on, false indicates that\n + * the location switch is turned off.\n + * The caller needs to pass in a non empty boolean pointer, otherwise an error will be returned.\n + * @return Location functions result code.\n + * For a detailed definition, please refer to {@link Location_ResultCode}.\n + * {@link LOCAION_SUCCESS} Successfully obtained the location switch status.\n + * {@link LOCATION_INVALID_PARAM} The input parameter enabled is a null pointer.\n + * {@link LOCATION_SERVICE_UNAVAILABLE} Abnormal startup of location services.\n + * @since 13 + */ +Location_ResultCode OH_Location_IsLocatingEnabled(bool* enabled); + +/** + * @brief Start locating and subscribe location changed. + * + * @param requestConfig - Pointer to the locating request parameters.\n + * For details, see {@link Location_RequestConfig}.\n + * You can use {@link OH_Location_CreateRequestConfig} to create an instance.\n + * @param callback - Pointer to the callback function for reporting the location.\n + * For details, see {@link Location_InfoCallback}.\n + * A non-null pointer is required, otherwise an error is returned.\n + * @return Location functions result code.\n + * For a detailed definition, please refer to {@link Location_ResultCode}.\n + * {@link LOCAION_SUCCESS} Successfully start locating.\n + * {@link LOCATION_INVALID_PARAM} The input parameter requestConfig or callback is a null pointer.\n + * {@link LOCATION_PERMISSION_DENIED} Permission verification failed. The application does not have the\n + * permission required to call the API.\n + * {@link LOCATION_NOT_SUPPORTED} Capability not supported.\n + * Failed to call function due to limited device capabilities.\n + * {@link LOCATION_SERVICE_UNAVAILABLE} Abnormal startup of location services.\n + * {@link LOCATION_SWITCH_OFF} The location switch is off.\n + * @permission ohos.permission.APPROXIMATELY_LOCATION + * @since 13 + */ +Location_ResultCode OH_Location_StartLocating(const Location_RequestConfig* requestConfig, + Location_InfoCallback callback); + +/** + * @brief Stop locating and unsubscribe location changed. + * + * @param callback - Pointer to the callback function for reporting the location.\n + * This parameter needs to be the same as the callback pointer passed in {@link OH_Location_StartLocating}.\n + * For details, see {@link Location_InfoCallback}.\n + * A non-null pointer is required, otherwise an error is returned.\n + * @return Location functions result code.\n + * For a detailed definition, please refer to {@link Location_ResultCode}.\n + * {@link LOCAION_SUCCESS} Successfully stop locationg.\n + * {@link LOCATION_INVALID_PARAM} 1.The input parameter callback is a null pointer. + * 2.Different from the callback passed from {@link OH_Location_StartLocating}.\n + * {@link LOCATION_PERMISSION_DENIED} Permission verification failed. The application does not have the\n + * permission required to call the API.\n + * {@link LOCATION_NOT_SUPPORTED} Capability not supported.\n + * Failed to call function due to limited device capabilities.\n + * {@link LOCATION_SERVICE_UNAVAILABLE} Possible reasons: 1. Abnormal startup of location services.\n + * {@link LOCATION_SWITCH_OFF} The location switch is off.\n + * @permission ohos.permission.APPROXIMATELY_LOCATION + * @since 13 + */ +Location_ResultCode OH_Location_StopLocating(Location_InfoCallback callback); +#ifdef __cplusplus +} +#endif +/** @} */ +#endif // OH_LOCATION_H \ No newline at end of file diff --git a/LocationKit/oh_location_type.h b/LocationKit/oh_location_type.h new file mode 100644 index 000000000..8a376cda2 --- /dev/null +++ b/LocationKit/oh_location_type.h @@ -0,0 +1,356 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup Location + * @{ + * + * @brief Provide functions for querying the status of location switch, starting and stopping locating. + * + * @since 13 + */ + +/** + * @file oh_location_type.h + * @kit LocationKit + * @brief Declares the common location attributes. + * @library libohlocation.so + * @syscap SystemCapability.Location.Location.Core + * @since 13 + */ + +#ifndef OH_LOCATION_TYPE_H +#define OH_LOCATION_TYPE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the location result codes. + * + * @since 13 + */ +typedef enum Location_ResultCode { + /** + * @error The operation is successful. + */ + LOCATION_SUCCESS = 0, + /** + * @error Permission verification failed. The application does not have the + * permission required to call the API. + */ + LOCATION_PERMISSION_DENIED = 201, + /** + * @error Parameter error. Possible reasons: 1. The input parameter is a null pointer;\n + * 2. Parameter values exceed the defined range.\n + */ + LOCATION_INVALID_PARAM = 401, + /** + * @error Capability not supported. Failed to call function due to limited device capabilities. + */ + LOCATION_NOT_SUPPORTED = 801, + /** + * @error The location service is unavailable. + * Possible reasons: Abnormal startup of location services.\n + */ + LOCATION_SERVICE_UNAVAILABLE = 3301000, + /** + * @error The location switch is off. + */ + LOCATION_SWITCH_OFF = 3301100 +} Location_ResultCode; + +/** + * @brief Enumeration values of use scenarios. + * + * @since 13 + */ +typedef enum Location_UseScene { + /** + * Indicates the navigation scenario. + * This feature applies to outdoor scenarios where real-time device locations need + * to be obtained, such as vehicle-mounted and pedestrian navigation. + * The GNSS positioning technology is used to provide positioning services, and the + * power consumption is high. + */ + LOCATION_USE_SCENE_NAVIGATION = 0x0401, + /** + * Indicates the sport scenario. + * This feature applies to scenarios where user location tracks are recorded, + * for example, sports apps. The GNSS positioning technology is used to provide + * positioning services, and the power consumption is high. + */ + LOCATION_USE_SCENE_SPORT = 0x0402, + /** + * Indicates a travel scenario. + * This mode applies to travel scenarios, such as taxi and public transportation. + * The GNSS positioning technology is used to provide positioning services, and + * the power consumption is high. + */ + LOCATION_USE_SCENE_TRANSPORT = 0x0403, + /** + * Indicates the daily service usage scenario. + * This mode applies to scenarios where precise user location is not required, + * such as news, online shopping, and ordering applications. + * In this scenario, only a network positioning technology is used to provide a + * positioning service, and power consumption is relatively low. + */ + LOCATION_USE_SCENE_DAILY_LIFE_SERVICE = 0x0404 +} Location_UseScene; + +/** + * @brief Enumerates the power consumption scenario. + * + * @since 13 + */ +typedef enum Location_PowerConsumptionScene { + /** + * High power consumption. + * GNSS positioning technology is mainly used. We will use network positioning + * technology to provide services before GNSS provides stable location results; + * During continuous positioning, if the GNSS positioning result cannot be obtained + * for more than 30 seconds, the network positioning technology is used to obtain + * the location. Consumes a large number of hardware resources and power. + */ + LOCATION_HIGH_POWER_CONSUMPTION = 0x0601, + /** + * Low power consumption. + * This mode applies to scenarios that do not require high user location precision, + * such as news, online shopping, and meal ordering. + * In this scenario, only a network positioning technology is used to provide a + * positioning service, and power consumption is relatively low. + */ + LOCATION_LOW_POWER_CONSUMPTION = 0x0602, + /** + * No power consumption. + * In this scenario, the location is not proactively triggered. The location is + * returned to the current app only when other apps are located. + */ + LOCATION_NO_POWER_CONSUMPTION = 0x0603 +} Location_PowerConsumptionScene; + +/** + * @brief Enumerates the source type of location. + * + * @since 13 + */ +typedef enum Location_SourceType { + /** + * The positioning result is based on the GNSS positioning technology. + */ + LOCATION_SOURCE_TYPE_GNSS = 1, + /** + * The positioning result comes from the network positioning technology. + */ + LOCATION_SOURCE_TYPE_NETWORK = 2, + /** + * The positioning result comes from the high-precision indoor positioning technology. + */ + LOCATION_SOURCE_TYPE_INDOOR = 3, + /** + * The positioning result comes from the high-precision positioning technology. + */ + LOCATION_SOURCE_TYPE_RTK = 4 +} Location_SourceType; + +/** + * @brief Defines the location information. + * + * @since 13 + */ +typedef struct Location_BasicInfo { + /** + * Indicates latitude information, with positive values indicating north latitude\n + * and negative values indicating south latitude. The value range is -90 to 90.\n + * Only supports WGS84 coordinate system.\n + */ + double latitude; + /** + * Indicates longitude information, positive values indicate east longitude,\n + * and negative values indicate west longitude. The value range is -180 to 180.\n + * Only supports WGS84 coordinate system.\n + */ + double longitude; + /** + * Altitude in meters. + */ + double altitude; + /** + * Horizontal location accuracy in meters. + */ + double accuracy; + /** + * Speed in meters per second. + */ + double speed; + /** + * Heading in degrees. The value range is 0 to 360. + */ + double direction; + /** + * Timestamp for the location fix. Number of milliseconds since January 1, 1970. + */ + int64_t timeForFix; + /** + * Time since the system was booted, and include deep sleep. The unit is nanosecond. + */ + int64_t timeSinceBoot; + /** + * Vertical position accuracy in meters. + */ + double altitudeAccuracy; + /** + * Speed accuracy in meter per seconds. + */ + double speedAccuracy; + /** + * Direction accuracy in degrees. The value range is 0 to 360. + */ + double directionAccuracy; + /** + * Time uncertainty in nanosecond. + */ + int64_t uncertaintyOfTimeSinceBoot; + /** + * Indicates the source of the location result. + */ + Location_SourceType locationSourceType; +} Location_BasicInfo; + +/** + * @brief Define the structure of location information. + * @since 13 + */ +typedef struct Location_Info Location_Info; + +/** + * @brief Obtain basic location information. + * + * @param location - Pointer to the location information structure.\n + * A non-null pointer is required. The pointer can be obtained from {@link Location_InfoCallback}.\n + * @return Return the basic information structure of the location.\n + * For a detailed definition, please refer to {@link Location_BasicInfo}.\n + * @since 13 + */ +Location_BasicInfo OH_LocationInfo_GetBasicInfo(Location_Info* location); + +/** + * @brief Obtain additional information from the location information. + * + * @param location - Pointer to the location information structure.\n + * A non-null pointer is required. The pointer can be obtained from {@link Location_InfoCallback}.\n + * @param additionalInfo - Non null pointers of char type; This variable is used to store additional\n + * information strings. The string is in JSON format.\n + * The pointer and the corresponding memory are created by the caller.\n + * You are advised to apply for a memory of 256 bytes or more.\n + * If a null pointer is passed, an error code is returned.\n + * @param length - Memory size of additionalInfo. + * @return Location functions result code.\n + * For a detailed definition, please refer to {@link Location_ResultCode}.\n + * {@link LOCAION_SUCCESS} Successfully obtained additional information.\n + * {@link LOCATION_INVALID_PARAM} 1.The input parameter location or additionalInfo is a null pointer.\n + * 2.The input parameter length is too small to store additional information.\n + * @since 13 + */ +Location_ResultCode OH_LocationInfo_GetAdditionalInfo(Location_Info* location, + char* additionalInfo, uint32_t length); + +/** + * @brief Define the structure of location request parameters. + * @since 13 + */ +typedef struct Location_RequestConfig Location_RequestConfig; + +/** + * @brief Create a location request parameter structure instance. + * + * @return Return a pointer to the {@ link Location_RequestConfig} instance. \n + * If NULL is returned, it indicates that the creation failed. \n + * The possible reason is that the application address space is full,\n + * resulting in the inability to allocate space. \n + * @since 13 + */ +Location_RequestConfig* OH_Location_CreateRequestConfig(void); + +/** + * @brief Destroy the location request parameter instance and reclaim memory. + * + * @param requestConfig - Pointer to {@link Location_RequestConfig} instance.\n + * The instance was created by {@link OH_Location_CreateRequestConfig}.\n + * @since 13 + */ +void OH_Location_DestroyRequestConfig(Location_RequestConfig* requestConfig); + +/** + * @brief Set the use scenario in the location request parameter.\n + * Prioritize useScene in the location request parameter {@link Location_RequestConfig}.\n + * If useScene is set, powerConsumptionScene becomes invalid.\n + * If useScene is not set and powerConsumptionScene is set, this parameter takes effect.\n + * If both parameters are not set, the default useScene is\n + * {@link LOCATION_USE_SCENE_DAILY_LIFE_SERVICE},\n + * and the powerConsumptionCenario parameter is invalid.\n + * + * @param requestConfig - Pointer to the {@link Location_RequestConfig} instance.\n + * The instance was created by {@link OH_Location_CreateRequestConfig}.\n + * @param useScene - Representing the use scenario during location requests.\n + * The default value is {@link LOCATION_USE_SCENE_DAILY_LIFE_SERVICE}\n. + * For a detailed definition, please refer to {@link Location_UseScene}.\n + * @since 13 + */ +void OH_LocationRequestConfig_SetUseScene(Location_RequestConfig* requestConfig, + Location_UseScene useScene); + +/** + * @brief Set the power consumption scenario in the location request parameters. + * + * @param requestConfig - Pointer to the {@link Location_RequestConfig} instance.\n + * The instance was created by {@link OH_Location_CreateRequestConfig}.\n + * @param powerConsumptionScene - Represents the power consumption scenario for location requests.\n + * The recognition value is {@link LOCATION_LOW_POWER_CONSUMPTION}.\n + * For a detailed definition, please refer to {@link Location_PowerConsumptionScene}.\n + * @since 13 + */ +void OH_LocationRequestConfig_SetPowerConsumptionScene(Location_RequestConfig* requestConfig, + Location_PowerConsumptionScene powerConsumptionScene); + +/** + * @brief Set the location reporting interval in the location request parameter. + * + * @param requestConfig - Pointer to the {@link Location_RequestConfig} instance.\n + * The instance was created by {@link OH_Location_CreateRequestConfig}.\n + * @param interval - Indicates the time interval for location reporting, in seconds.\n + * The value is greater than or equal to 1. The default value is 1.\n + * @since 13 + */ +void OH_LocationRequestConfig_SetInterval(Location_RequestConfig* requestConfig, + int interval); + +/** + * @brief Defines the callback function used to report location data. + * + * @param location - Pointer to the {@link Location_Info} instance. Carry the latest location information.\n + * The memory of the location instance is recycled at the end of {@link Location_InfoCallback}.\n + * Before that, call {@link OH_LocationInfo_GetBasicInfo} and other interfaces to obtain location information.\n + * @since 13 + */ +typedef void (*Location_InfoCallback)(Location_Info* location); +#ifdef __cplusplus +} +#endif +/** @} */ +#endif // OH_LOCATION_TYPE_H \ No newline at end of file -- Gitee From 4898b887209a45744e1c39e58077550003bf4da0 Mon Sep 17 00:00:00 2001 From: ccfriend Date: Sat, 17 Aug 2024 20:55:12 +0800 Subject: [PATCH 231/620] add avsession ndk interface Signed-off-by: ccfriend --- multimedia/av_session/BUILD.gn | 36 + multimedia/av_session/libohavsession.ndk.json | 190 +++++ multimedia/av_session/native_avmetadata.h | 372 +++++++++ multimedia/av_session/native_avsession.h | 725 ++++++++++++++++++ .../av_session/native_avsession_errors.h | 90 +++ test.txt | 468 ----------- 6 files changed, 1413 insertions(+), 468 deletions(-) create mode 100644 multimedia/av_session/BUILD.gn create mode 100644 multimedia/av_session/libohavsession.ndk.json create mode 100644 multimedia/av_session/native_avmetadata.h create mode 100644 multimedia/av_session/native_avsession.h create mode 100644 multimedia/av_session/native_avsession_errors.h delete mode 100644 test.txt diff --git a/multimedia/av_session/BUILD.gn b/multimedia/av_session/BUILD.gn new file mode 100644 index 000000000..bf7c9da26 --- /dev/null +++ b/multimedia/av_session/BUILD.gn @@ -0,0 +1,36 @@ +# Copyright (C) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_headers("ohavsession_header") { + dest_dir = "$ndk_headers_out_dir/multimedia/av_session" + sources = [ + "native_avmetadata.h", + "native_avsession.h", + "native_avsession_errors.h", + ] +} + +ohos_ndk_library("libohavsession_ndk") { + output_name = "ohavsession" + output_extension = "so" + ndk_description_file = "./libohavsession.ndk.json" + system_capability = "SystemCapability.Multimedia.AVSession.Core" + system_capability_headers = [ + "multimedia/av_session/native_avmetadata.h", + "multimedia/av_session/native_avsession.h", + "multimedia/av_session/native_avsession_errors.h", + ] +} diff --git a/multimedia/av_session/libohavsession.ndk.json b/multimedia/av_session/libohavsession.ndk.json new file mode 100644 index 000000000..6438cd5e6 --- /dev/null +++ b/multimedia/av_session/libohavsession.ndk.json @@ -0,0 +1,190 @@ +[ + { + "first_introduced": "13", + "name": "OH_AVSession_Create" + }, + { + "first_introduced": "13", + "name": "OH_AVSession_Destroy" + }, + { + "first_introduced": "13", + "name": "OH_AVSession_Activate" + }, + { + "first_introduced": "13", + "name": "OH_AVSession_Deactivate" + }, + { + "first_introduced": "13", + "name": "OH_AVSession_GetSessionType" + }, + { + "first_introduced": "13", + "name": "OH_AVSession_GetSessionId" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_SetAVMetadata" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_SetPlaybackState" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_SetPlaybackPosition" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_SetBufferedTime" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_SetSpeed" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_SetFavorite" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_SetLoopMode" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_RegisterCommandCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_UnRegisterCommandCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_RegisterForwardCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_UnRegisterForwardCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_RegisterRewindCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_UnRegisterRewindCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_RegisterSeekCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_UnRegisterSeekCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_RegisterSpeedCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_UnRegisterSpeedCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_RegisterSetLoopModeCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_UnRegisterSetLoopModeCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_RegisterToggleFavoriteCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_UnRegisterToggleFavoriteCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_RegisterPlayFromAssetIdCallback" + }, + { + "first_introduced": "13", + "name":"OH_AVSession_UnRegisterPlayFromAssetIdCallback" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_Create" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_Destroy" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_SetAssetId" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_SetTitle" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_SetArtist" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_SetAuthor" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_SetAlbum" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_SetWriter" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_SetComposer" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_SetDuration" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_SetMediaImageUri" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_SetSubTitle" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_SetDescription" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_SetLyric" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_SetSkipIntervals" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_SetDisplayTags" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadataBuilder_GenerateAVMetadata" + }, + { + "first_introduced": "13", + "name": "OH_AVMetadata_Destroy" + } +] \ No newline at end of file diff --git a/multimedia/av_session/native_avmetadata.h b/multimedia/av_session/native_avmetadata.h new file mode 100644 index 000000000..3e6751d8c --- /dev/null +++ b/multimedia/av_session/native_avmetadata.h @@ -0,0 +1,372 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup OHAVSession + * @{ + * + * @brief Provide the definition of the C interface for the avsession module. + * + * @syscap SystemCapability.Multimedia.AVSession.Core + * + * @since 13 + * @version 1.0 + */ + +/** + * @file native_avmetadata.h + * + * @brief Declare avmetadata builder related interfaces. + * + * @library libohavsession.so + * @syscap SystemCapability.Multimedia.AVSession.Core + * @kit AVSessionKit + * @since 13 + * @version 1.0 + */ + +#ifndef NATIVE_AVMETADATA_H +#define NATIVE_AVMETADATA_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief AVMetadata error code + * + * @since 13 + * @version 1.0 + */ +typedef enum { + /** + * @error The call was successful. + */ + AVMETADATA_SUCCESS = 0, + + /** + * @error This means that the function was executed with an invalid input parameter. + */ + AVMETADATA_ERROR_INVALID_PARAM = 1, + + /** + * @error This means there is no memory left. + */ + AVMETADATA_ERROR_NO_MEMORY = 2, +} AVMetadata_Result; + +/** + * @brief Defines the skip interval when fastforward or rewind. + * + * @since 13 + * @version 1.0 + */ +typedef enum { + /** + * @brief 10 seconds + */ + SECONDS_10 = 10, + + /** + * @brief 15 seconds + */ + SECONDS_15 = 15, + + /** + * @brief 30 seconds + */ + SECONDS_30 = 30, +} AVMetadata_SkipIntervals; + +/** + * @brief Display tag + * + * @since 13 + * @version 1.0 + */ +typedef enum { + /** + * @brief Indicate the audio vivid property. + */ + AVSESSION_DISPLAYTAG_AUDIO_VIVID = 1, +} AVMetadata_DisplayTag; + +/** + * @brief Declaring the avmetadata builder. + * The instance of builder is used for creating avmetadata. + * + * @since 13 + * @version 1.0 + */ +typedef struct OH_AVMetadataBuilderStruct OH_AVMetadataBuilder; + +/** + * @brief Declaring the avmetadata. + * The instance of avmetadata set by application for current resource. + * + * @since 13 + * @version 1.0 + */ +typedef struct OH_AVMetadataStruct OH_AVMetadata; + +/** + * @brief Creates an AVMetadataBuilder instance. + * + * @param builder The builder reference to the created result. + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM} The param of builder is nullptr. + * {@link AVMETADATA_ERROR_NO_MEMORY} No memory to allocate a new instance. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_Create(OH_AVMetadataBuilder** builder); + +/** + * @brief Destroy a bulder. + * + * @param builder The metadata builder instance pointer + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM} The param of builder is nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_Destroy(OH_AVMetadataBuilder* builder); + +/** + * @brief Set current asset id of the resource + * + * @param builder The metadata builder instance pointer + * @param assetId The current assetId of resource. + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM}: + * 1.The param of builder is nullptr; + * 2.The param of assetId is nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_SetAssetId(OH_AVMetadataBuilder* builder, const char* assetId); + +/** + * @brief Set the title of the resource + * + * @param builder The metadata builder instance pointer + * @param title The title of resource. + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM}: + * 1.The param of builder is nullptr; + * 2.The param of title is nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_SetTitle(OH_AVMetadataBuilder* builder, const char* title); + +/** + * @brief Set the artist of the resource + * + * @param builder The metadata builder instance pointer + * @param artist The artist of resource. + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM}: + * 1.The param of builder is nullptr; + * 2.The param of artist is nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_SetArtist(OH_AVMetadataBuilder* builder, const char* artist); + +/** + * @brief Set the author of the resource + * + * @param builder The metadata builder instance pointer + * @param author The author of resource. + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM}: + * 1.The param of builder is nullptr; + * 2.The param of author is nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_SetAuthor(OH_AVMetadataBuilder* builder, const char* author); + +/** + * @brief Set the album information + * + * @param builder The metadata builder instance pointer + * @param album The album name + * @return Return code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM}: + * 1. The param of builder is nullptr. + * 2. The param of album is nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_SetAlbum(OH_AVMetadataBuilder* builder, const char* album); + +/** + * @brief Set the writer of the resource + * + * @param builder The metadata builder instance pointer + * @param writer The writer of resource. + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM}: + * 1. The param of builder is nullptr. + * 2. The param of writer is nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_SetWriter(OH_AVMetadataBuilder* builder, const char* writer); + +/** + * @brief Set the composer of the resource + * + * @param builder The metadata builder instance pointer + * @param composer The composer of resource. + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM}: + * 1. The param of builder is nullptr. + * 2. The param of composer is nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_SetComposer(OH_AVMetadataBuilder* builder, const char* composer); + +/** + * @brief Set the duration of the resource + * + * @param builder The metadata builder instance pointer + * @param duration The duration of resource, in miliseconds + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM} The param of builder is nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_SetDuration(OH_AVMetadataBuilder* builder, int64_t duration); + +/** + * @brief Set the media image uri of the resource + * + * @param builder The metadata builder instance pointer + * @param mediaImageUri The mediaImageUri of resource. + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM}: + * 1.The param of builder is nullptr; + * 2.The param of mediaImageUri nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_SetMediaImageUri(OH_AVMetadataBuilder* builder, const char* mediaImageUri); + +/** + * @brief Set the subtitle of the resource + * + * @param builder The metadata builder instance pointer + * @param subtitle The subtitle of resource. + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM}: + * 1.The param of builder is nullptr; + * 2.The param of subtitle nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_SetSubtitle(OH_AVMetadataBuilder* builder, const char* subtitle); + +/** + * @brief Set the media description of the resource + * + * @param builder The metadata builder instance pointer + * @param description The description of resource. + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM}: + * 1.The param of builder is nullptr; + * 2.The param of description nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_SetDescription(OH_AVMetadataBuilder* builder, const char* description); + +/** + * @brief Set the media lyric content of the resource + * + * @param builder The metadata builder instance pointer + * @param lyric The lyric of resource. + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM}: + * 1.The param of builder is nullptr; + * 2.The param of lyric nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_SetLyric(OH_AVMetadataBuilder* builder, const char* lyric); + +/** + * @brief Set the skip intervals of the resource + * + * @param builder The metadata builder instance pointer + * @param intervals The intervals of resource, only can be set : 10, 15, 30 + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM}: + * 1.The param of builder is nullptr; + * 2.The param of intervals is invalid. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_SetSkipIntervals(OH_AVMetadataBuilder* builder, + AVMetadata_SkipIntervals intervals); + +/** + * @brief Set the display tags of the resource + * + * @param builder The metadata builder instance pointer + * @param tags The display tags of resource which are supported by this app to be displayed on the media center + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM} The param of builder is nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_SetDisplayTags(OH_AVMetadataBuilder* builder, int32_t tags); + +/** + * @brief Create the avmetadta. + * + * @param builder The metadata builder instance pointer + * @param avMetadata Pointer to a viriable to receive the avMetadata object. + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM}: + * 1.The param of builder is nullptr; + * 2.The param of avMetadata is nullptr. + * @since 13 + */ +AVMetadata_Result OH_AVMetadataBuilder_GenerateAVMetadata(OH_AVMetadataBuilder* builder, + OH_AVMetadata** avMetadata); + +/** + * @brief Request to release the avmetadta. + * + * @param avMetadata Pointer to a viriable to receive the avMetadata object. + * @return Function result code: + * {@link AVMETADATA_SUCCESS} If the execution is successful. + * @since 13 + */ +AVMetadata_Result OH_AVMetadata_Destroy(OH_AVMetadata* avMetadata); + +#ifdef __cplusplus +} +#endif + +#endif // NATIVE_AVMETADATA_H +/** @} */ \ No newline at end of file diff --git a/multimedia/av_session/native_avsession.h b/multimedia/av_session/native_avsession.h new file mode 100644 index 000000000..2c6d9908f --- /dev/null +++ b/multimedia/av_session/native_avsession.h @@ -0,0 +1,725 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup OHAVSession + * @{ + * + * @brief Provide the definition of the C interface for the avsession module. + * + * @syscap SystemCapability.Multimedia.AVSession.Core + * + * @since 13 + * @version 1.0 + */ + +/** + * @file native_avsession.h + * + * @brief Declare avsession interface. + * + * @library libohavsession.so + * @syscap SystemCapability.Multimedia.AVSession.Core + * @kit AVSessionKit + * @since 13 + * @version 1.0 + */ + +#ifndef NATIVE_AVSESSION_H +#define NATIVE_AVSESSION_H + +#include +#include "native_avsession_errors.h" +#include "native_avmetadata.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enum for avsession type. + * + * @since 13 + * @version 1.0 + */ +typedef enum { + /** + * @brief audio session type. + */ + SESSION_TYPE_AUDIO = 0, + + /** + * @brief video session type. + */ + SESSION_TYPE_VIDEO = 1, + + /** + * @brief voice call session type. + */ + SESSION_TYPE_VOICE_CALL = 2, + + /** + * @brief video call session type. + */ + SESSION_TYPE_VIDEO_CALL = 3 +} AVSession_Type; + +/** + * @brief Enum for playback state. + * + * @since 13 + * @version 1.0 + */ +typedef enum { + /** + * @brief Initial state. + */ + PLAYBACK_STATE_INITIAL = 0, + + /** + * @brief Preparing state. Indicates that the media file is not ready to play. + */ + PLAYBACK_STATE_PREPARING = 1, + + /** + * @brief Playing state. + */ + PLAYBACK_STATE_PLAYING = 2, + + /** + * @brief Pause state. + */ + PLAYBACK_STATE_PAUSED = 3, + + /** + * @brief Fast forward state. + */ + PLAYBACK_STATE_FAST_FORWARDING = 4, + + /** + * @brief Rewind state. + */ + PLAYBACK_STATE_REWINDED = 5, + + /** + * @brief Stopped state. + */ + PLAYBACK_STATE_STOPPED = 6, + + /** + * @brief Complete state. + */ + PLAYBACK_STATE_COMPLETED = 7, + + /** + * @brief Release state. + */ + PLAYBACK_STATE_RELEASED = 8, + + /** + * @brief Error state. + */ + PLAYBACK_STATE_ERROR = 9, + + /** + * @brief Idle state. + */ + PLAYBACK_STATE_IDLE = 10, + + /** + * @brief Buffering state. + */ + PLAYBACK_STATE_BUFFERING = 11, + + /** + * @brief Max state. + */ + PLAYBACK_STATE_MAX = 12, +} AVSession_PlaybackState; + +/** + * @brief Defines the playback position. + * + * @since 13 + */ +typedef struct AVSession_PlaybackPosition { + /** + * @brief Elapsed time(position) of this media set by the app. + */ + int64_t elapsedTime; + + /** + * @brief Record the system time when elapsedTime is set. + */ + int64_t updateTime; +} AVSession_PlaybackPosition; + +/** + * @brief Defines the playback mode. + * + * @since 13 + */ +typedef enum { + /** + * @brief sequential playback mode + */ + LOOP_MODE_SEQUENCE = 0, + + /** + * @brief single playback mode + */ + LOOP_MODE_SINGLE = 1, + + /** + * @brief list playback mode + */ + LOOP_MODE_LIST = 2, + + /** + * @brief shuffle playback mode + */ + LOOP_MODE_SHUFFLE = 3, + + /** + * @brief custom playback mode + */ + LOOP_MODE_CUSTOM = 4, +} AVSession_LoopMode; + +/** + * @brief Enum for different control command. + * + * @since 13 + * @version 1.0 + */ +typedef enum AVSession_ControlCommand { + /** + * @brief invalid control command + */ + CONTROL_CMD_INVALID = -1, + + /** + * @brief play command + */ + CONTROL_CMD_PLAY = 0, + + /** + * @brief pause command + */ + CONTROL_CMD_PAUSE = 1, + + /** + * @brief stop command + */ + CONTROL_CMD_STOP = 2, + + /** + * @brief playnext command + */ + CONTROL_CMD_PLAY_NEXT = 3, + + /** + * @brief playprevious command + */ + CONTROL_CMD_PLAY_PREVIOUS = 4, +} AVSession_ControlCommand; + +/** + * @brief Defines enumeration of avsession callback result. + * + * @since 13 + */ +typedef enum { + /** + * @brief Result of avsession callabck is success. + */ + AVSESSION_CALLBACK_RESULT_SUCCESS = 0, + + /** + * @brief Result of avsession callabck failed. + */ + AVSESSION_CALLBACK_RESULT_FAILURE = -1, +} AVSessionCallback_Result; + +/** + * @brief AVSession object + * + * A pointer can be created using {@link OH_AVSession_Create} method. + * + * @since 13 + * @version 1.0 + */ +typedef struct OH_AVSession OH_AVSession; + +/** + * @brief Declaring the callback struct for playback command + * + * @since 13 + * @version 1.0 + */ +typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnCommand)(OH_AVSession* session, + AVSession_ControlCommand command, void* userData); + +/** + * @brief Declaring the callback struct for forward command + * + * @since 13 + * @version 1.0 + */ +typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnFastForward)(OH_AVSession* session, + uint32_t seekTime, void* userData); + +/** + * @brief Declaring the callback struct for rewind command + * + * @since 13 + * @version 1.0 + */ +typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnRewind)(OH_AVSession* session, + uint32_t seekTime, void* userData); + +/** + * @brief Declaring the callback struct for seek command + * + * @since 13 + * @version 1.0 + */ +typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnSeek)(OH_AVSession* session, + uint64_t seekTime, void* userData); + +/** + * @brief Declaring the callback struct for set speed command + * + * @since 13 + * @version 1.0 + */ +typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnSetSpeed)(OH_AVSession* session, + uint32_t speed, void* userData); + +/** + * @brief Declaring the callback struct for set loop mode command + * + * @since 13 + * @version 1.0 + */ +typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnSetLoopMode)(OH_AVSession* session, + AVSession_LoopMode curLoopMode, void* userData); + +/** + * @brief Declaring the callback struct for toggle favorite command + * + * @since 13 + * @version 1.0 + */ +typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnToggleFavorite)(OH_AVSession* session, + const char* assetId, void* userData); + +/** + * @brief Declaring the callback struct for play from assetid command + * + * @since 13 + * @version 1.0 + */ +typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnPlayFromAssetId)(OH_AVSession* session, + const char* assetId, void* userData); + +/** + * @brief Request to create the avsession. + * + * @param avsession The avsession instance pointer + * @param sessionTag The session tag set by the application + * @param bundleName The bundle name to set + * @param abilityName The abilityName name to set + * @param avsession Pointer to a viriable to receive the OH_AVSession + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER}: + * 1. The param of avsession is nullptr. + * 2. The param of bundleName is nullptr. + * 3. The param of abilityName is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_Create(AVSession_Type sessionType, const char* sessionTag, + const char* bundleName, const char* abilityName, OH_AVSession** avsession); + +/** + * @brief Request to destory the avsession. + * + * @param avsession The avsession instance pointer + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_Destroy(OH_AVSession* avsession); + +/** + * @brief Activate the avsession. + * + * @param avsession The avsession instance pointer + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_Activate(OH_AVSession* avsession); + +/** + * @brief Deactivate the avsession. + * + * @param avsession The avsession instance pointer + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_Deactivate(OH_AVSession* avsession); + +/** + * @brief Get session type. + * + * @param avsession The avsession instance pointer + * @param sessionType The returned session type + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_GetSessionType(OH_AVSession* avsession, AVSession_Type* sessionType); + +/** + * @brief Get session id. + * + * @param avsession The avsession instance pointer + * @param sessionId The returned session id + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_GetSessionId(OH_AVSession* avsession, const char** sessionId); + +/** + * @brief Request to set av metadata. + * + * @param avsession The avsession instance pointer + * @param avmetadata The metadata to set + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_SetAVMetadata(OH_AVSession* avsession, OH_AVMetadata* avmetadata); + +/** + * @brief Request to set av playbackstate. + * + * @param avsession The avsession instance pointer + * @param playbackState The playbackState to set + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_SetPlaybackState(OH_AVSession* avsession, + AVSession_PlaybackState playbackState); + +/** + * @brief Request to set playback position. + * + * @param avsession The avsession instance pointer + * @param playbackPosition The playbackPosition to set + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_SetPlaybackPosition(OH_AVSession* avsession, + AVSession_PlaybackPosition* playbackPosition); + +/** + * @brief Request to set buffered time. + * + * @param avsession The avsession instance pointer + * @param bufferedTime The bufferedTime to set + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_SetBufferedTime(OH_AVSession* avsession, uint64_t bufferedTime); + +/** + * @brief Request to set speed. + * + * @param avsession The avsession instance pointer + * @param speed The speed to set + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_SetSpeed(OH_AVSession* avsession, uint32_t speed); + +/** + * @brief Request to set favorite state. + * + * @param avsession The avsession instance pointer + * @param favorite true means making the resource to be liked, false means dislike. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_SetFavorite(OH_AVSession* avsession, bool favorite); + +/** + * @brief Request to set loop mode. + * + * @param avsession The avsession instance pointer + * @param loopMode The loopmode to be set for playback. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_SetLoopMode(OH_AVSession* avsession, AVSession_LoopMode loopMode); + +/** + * @brief Request to register command callback. + * + * @param avsession The avsession instance pointer + * @param command The control command type to be registered. + * @param callback the {@link OH_AVSessionCallback_OnCommand} to be registered. + * @param userData User data which is passed by user. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_CODE_COMMAND_INVALID} The command is not invalid. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_RegisterCommandCallback(OH_AVSession* avsession, + AVSession_ControlCommand command, OH_AVSessionCallback_OnCommand callback, void* userData); + +/** + * @brief Request to unregister command callback. + * + * @param avsession The avsession instance pointer + * @param command The control command type to be unregistered. + * @param callback the {@link OH_AVSessionCallback_OnCommand} to be unregistered. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_CODE_COMMAND_INVALID} The command is not invalid. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_UnregisterCommandCallback(OH_AVSession* avsession, + AVSession_ControlCommand command, OH_AVSessionCallback_OnCommand callback); + +/** + * @brief Request to register fastforward callback. + * + * @param avsession The avsession instance pointer + * @param callback the {@link OH_AVSessionCallback_OnFastForward} to be registered. + * @param userData User data which is passed by user. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_RegisterForwardCallback(OH_AVSession* avsession, + OH_AVSessionCallback_OnFastForward callback, void* userData); + +/** + * @brief Request to unregister fastforward callback. + * + * @param avsession The avsession instance pointer + * @param callback the {@link OH_AVSessionCallback_OnFastForward} to be unregistered. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_UnregisterForwardCallback(OH_AVSession* avsession, + OH_AVSessionCallback_OnFastForward callback); + +/** + * @brief Request to register rewind callback. + * + * @param avsession The avsession instance pointer + * @param callback the {@link OH_AVSessionCallback_OnRewind} to be registered. + * @param userData User data which is passed by user. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_RegisterRewindCallback(OH_AVSession* avsession, + OH_AVSessionCallback_OnRewind callback, void* userData); + +/** + * @brief Request to unregister rewind callback. + * + * @param avsession The avsession instance pointer + * @param callback the {@link OH_AVSessionCallback_OnRewind} to be unregistered. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_UnregisterRewindCallback(OH_AVSession* avsession, + OH_AVSessionCallback_OnRewind callback); + +/** + * @brief Request to register seek callback. + * + * @param avsession The avsession instance pointer + * @param callback the {@link OH_AVSessionCallback_OnSeek} to be registered. + * @param userData User data which is passed by user. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_RegisterSeekCallback(OH_AVSession* avsession, + OH_AVSessionCallback_OnSeek callback, void* userData); + +/** + * @brief Request to unregister seek callback. + * + * @param avsession The avsession instance pointer + * @param callback the {@link OH_AVSessionCallback_OnSeek} to be unregistered. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_UnregisterSeekCallback(OH_AVSession* avsession, + OH_AVSessionCallback_OnSeek callback); + +/** + * @brief Request to register set speed callback. + * + * @param avsession The avsession instance pointer + * @param callback the {@link OH_AVSessionCallback_OnSetSpeed} to be registered. + * @param userData User data which is passed by user. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_RegisterSpeedCallback(OH_AVSession* avsession, + OH_AVSessionCallback_OnSetSpeed callback, void* userData); + +/** + * @brief Request to unregister set speed callback. + * + * @param avsession The avsession instance pointer + * @param callback the {@link OH_AVSessionCallback_OnSetSpeed} to be unregistered. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_UnregisterSpeedCallback(OH_AVSession* avsession, + OH_AVSessionCallback_OnSetSpeed callback); + +/** + * @brief Request to register set loopmode callback. + * + * @param avsession The avsession instance pointer + * @param callback the {@link OH_AVSessionCallback_OnSetLoopMode} to be registered. + * @param userData User data which is passed by user. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_RegisterSetLoopModeCallback(OH_AVSession* avsession, + OH_AVSessionCallback_OnSetLoopMode callback, void* userData); + +/** + * @brief Request to unregister set loopmode callback. + * + * @param avsession The avsession instance pointer + * @param callback the {@link OH_AVSessionCallback_OnSetLoopMode} to be unregistered. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_UnregisterSetLoopModeCallback(OH_AVSession* avsession, + OH_AVSessionCallback_OnSetLoopMode callback); + +/** + * @brief Request to register toggle favorite callback. + * + * @param avsession The avsession instance pointer + * @param callback the {@link OH_AVSessionCallback_OnToggleFavorite} to be registered. + * @param userData User data which is passed by user. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_RegisterToggleFavoriteCallback(OH_AVSession* avsession, + OH_AVSessionCallback_OnToggleFavorite callback, void* userData); + +/** + * @brief Request to unregister toggle favorite callback. + * + * @param avsession The avsession instance pointer + * @param callback the {@link OH_AVSessionCallback_OnToggleFavorite} to be unregistered. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_UnregisterToggleFavoriteCallback(OH_AVSession* avsession, + OH_AVSessionCallback_OnToggleFavorite callback); + +/** + * @brief Request to register play from aseetid callback. + * + * @param avsession The avsession instance pointer + * @param callback the {@link OH_AVSessionCallback_OnPlayFromAssetId} to be registered. + * @param userData User data which is passed by user. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_RegisterPlayFromAssetIdCallback(OH_AVSession* avsession, + OH_AVSessionCallback_OnPlayFromAssetId callback, void* userData); + +/** + * @brief Request to unregister play from aseetid callback. + * + * @param avsession The avsession instance pointer + * @param callback the {@link OH_AVSessionCallback_OnPlayFromAssetId} to be unregistered. + * @return Function result code: + * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * @since 13 + */ +AVSession_ErrCode OH_AVSession_UnregisterPlayFromAssetIdCallback(OH_AVSession* avsession, + OH_AVSessionCallback_OnPlayFromAssetId callback); + +#ifdef __cplusplus +} +#endif + +#endif // NATIVE_AVSESSION_H +/** @} */ \ No newline at end of file diff --git a/multimedia/av_session/native_avsession_errors.h b/multimedia/av_session/native_avsession_errors.h new file mode 100644 index 000000000..e19406013 --- /dev/null +++ b/multimedia/av_session/native_avsession_errors.h @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup OHAVSession + * @{ + * + * @brief Provide the definition of the C interface for the avsession module. + * @since 13 + */ + +/** + * @file native_avsession_errors.h + * + * @brief Declare avsession related error. + * + * @library libohavsession.so + * @syscap SystemCapability.Multimedia.AVSession.Core + * @kit AVSessionKit + * @since 13 + */ + +#ifndef NATIVE_AVSESSION_ERRORS_H +#define NATIVE_AVSESSION_ERRORS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief AVSession error code + * + * @since 13 + * @version 1.0 + */ +typedef enum { + /** + * @error The operation completed successfully. + */ + AV_SESSION_ERR_SUCCESS = 0, + + /** + * @error Invalid parameter。 + */ + AV_SESSION_ERR_INVALID_PARAMETER = 401, + + /** + * @error Service exception. + */ + AV_SESSION_ERR_SERVICE_EXCEPTION = 6600101, + + /** + * @error The session does not exist. + */ + AV_SESSION_ERR_CODE_SESSION_NOT_EXIST = 6600102, + + /** + * @error Invalid session command. + */ + AV_SESSION_ERR_CODE_COMMAND_INVALID = 6600105, + + /** + * @error The session is not activated. + */ + AV_SESSION_ERR_CODE_SESSION_INACTIVE = 6600106, + + /** + * @error Too many commands or events. + */ + AV_SESSION_ERR_CODE_MESSAGE_OVERLOAD = 6600107, +} AVSession_ErrCode; + +#ifdef __cplusplus +} +#endif + +#endif // NATIVE_AVSESSION_ERRORS_H +/** @} */ \ No newline at end of file diff --git a/test.txt b/test.txt deleted file mode 100644 index 5689b5143..000000000 --- a/test.txt +++ /dev/null @@ -1,468 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @addtogroup OHAVSession - * @{ - * - * @brief Provide the definition of the C interface for the native avsession. - * - * @syscap SystemCapability.Multimedia.AVSession.Core - * - * @since 12 - * @version 1.0 - */ - -/** - * @file native_avsession.h - * - * @brief Declare avsession interface. - * - * @library libohavsession.so - * @syscap SystemCapability.Multimedia.AVSession.Core - * @kit AVSessionKit - * @since 12 - * @version 1.0 - */ - -#ifndef NATIVE_AVSESSION_H -#define NATIVE_AVSESSION_H - -#include "native_avsession_base.h" -#include "native_avsession_errors.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Capture session object - * - * A pointer can be created using {@link OH_AVSession} method. - * - * @since 12 - * @version 1.0 - */ -typedef struct OH_AVSession OH_AVSession; - -/* - * Request to create the avsession. - * - * @since 12 - * - * @param avsession reference - * @return Function result code - */ -OH_AVSession_ErrCode OH_AVSession_Create(AVSession_Type sessionType, const char* sessionTag, OH_AVSession** avsession); - -/* - * Request to release the avsession. - * - * @since 12 - * - * @param avsession reference - * @return Function result code - */ -OH_AVSession_ErrCode OH_AVSession_Destroy(OH_AVSession* avsession); - -/* - * Request to set av metadata. - * - * @since 12 - * - * @param avsession reference - * @return Function result code - */ -OH_AVSession_ErrCode OH_AVSession_SetAVMetadata(OH_AVSession* avsession, AVSession_AVMetadata* metadata); - -/* - * Request to set av playbackstate. - * - * @since 12 - * - * @param avsession reference - * @return Function result code - */ -OH_AVSession_ErrCode OH_AVSession_SetAVPlaybackState(OH_AVSession* avsession, AVSession_AVPlaybackState* playbackState); - -/* - * Request to register callback. - * - * @since 12 - * - * @param avsession reference - * @return Function result code - */ -OH_AVSession_ErrCode OH_AVSession_RegisterCallback(OH_AVSession* avsession, AVSession_Callbacks* callback); - -#ifdef __cplusplus -} -#endif -#endif // NATIVE_AVSESSION_H - -/* - * Copyright (C) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @addtogroup AVSession - * @{ - * - * @brief Provides APIs of request capability for AVSession. - * @since 12 - */ - -/** - * @file native_avsession_base.h - * - * @brief Declare avsession related definations. - * - * @library libohavsession.so - * @syscap SystemCapability.Multimedia.AVSession.Core - * @kit AVSessionKit - * @since 12 - */ - -#ifndef NATIVE_AVSESSION_ERRORS_H -#define NATIVE_AVSESSION_ERRORS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Enum for avsession type. - * - * @since 12 - * @version 1.0 - */ -typedef enum AVSession_Type { - SESSION_TYPE_INVALID = -1, - SESSION_TYPE_AUDIO = 0, - SESSION_TYPE_VIDEO = 1, - SESSION_TYPE_VOICE_CALL = 2, - SESSION_TYPE_VIDEO_CALL = 3 -} AVSession_Type; - -typedef struct AVSession_AVMetadata { - char* assetId; - char* title; - char* artist; - char* author; - // std::string avQueueName_ = ""; - // std::string avQueueId_ = ""; - // std::shared_ptr avQueueImage_ = nullptr; - // std::string avQueueImageUri_ = ""; - char* album; - // std::string writer_ = ""; - // std::string composer_ = ""; - int64_t duration; - // std::shared_ptr mediaImage_ = nullptr; - char* mediaImageUri; - // double publishDate_ = 0; - // std::string subTitle_ = ""; - // std::string description_ = ""; - // std::string lyric_ = ""; - // std::string previousAssetId_ = ""; - // std::string nextAssetId_ = ""; - // int32_t skipIntervals_ = SECONDS_15; - // int32_t filter_ = 2; - // int32_t mediaLength_ = 0; - // int32_t avQueueLength_ = 0; - // int32_t displayTags_ = 0; - // std::vector drmSchemes_; -} AVSession_AVMetadata; - -typedef enum AVSession_PlaybackState { - PLAYBACK_STATE_INITIAL = 0, - PLAYBACK_STATE_PREPARE = 1, - PLAYBACK_STATE_PLAY = 2, - PLAYBACK_STATE_PAUSE = 3, - PLAYBACK_STATE_FAST_FORWARD = 4, - PLAYBACK_STATE_REWIND = 5, - PLAYBACK_STATE_STOP = 6, - PLAYBACK_STATE_COMPLETED = 7, - PLAYBACK_STATE_RELEASED = 8, - PLAYBACK_STATE_ERROR = 9, - PLAYBACK_STATE_IDLE = 10, - PLAYBACK_STATE_BUFFERING = 11, - PLAYBACK_STATE_MAX = 12, -} AVSession_PlaybackState; - -typedef struct AVSession_PlaybackPosition { - int64_t elapsedTime_; - int64_t updateTime_; -} AVSession_PlaybackPosition; - -typedef struct AVSession_AVPlaybackState { - AVSession_PlaybackState state; - AVSession_PlaybackPosition position; - int64_t duration; -} AVSession_AVPlaybackState; - - -typedef enum AVSession_LoopMode { - LOOP_MODE_SEQUENCE = 0, - LOOP_MODE_SINGLE = 1, - LOOP_MODE_LIST = 2, - LOOP_MODE_SHUFFLE = 3, - LOOP_MODE_CUSTOM = 4, -} AVSession_LoopMode; - - -/////////////////////////////////////////////////////////////////////////////////////////// - -/** - * @brief Enum for command state. - * - * @since 12 - * @version 1.0 - */ -typedef enum AVSession_ControlCommand { - SESSION_CMD_INVALID = -1, - SESSION_CMD_PLAY = 0, - SESSION_CMD_PAUSE = 1, - SESSION_CMD_STOP = 2, - SESSION_CMD_PLAY_NEXT = 3, - SESSION_CMD_PLAY_PREVIOUS = 4, - SESSION_CMD_FAST_FORWARD = 5, - SESSION_CMD_REWIND = 6, - SESSION_CMD_SEEK = 7, - SESSION_CMD_SET_SPEED = 8, - SESSION_CMD_SET_LOOP_MODE = 9, - SESSION_CMD_TOGGLE_FAVORITE = 10, - SESSION_CMD_PLAY_FROM_ASSETID = 11, - SESSION_CMD_AVCALL_ANSWER = 12, - SESSION_CMD_AVCALL_HANG_UP = 13, - SESSION_CMD_AVCALL_TOGGLE_CALL_MUTE = 14, - SESSION_CMD_MEDIA_KEY_SUPPORT = 15, - SESSION_CMD_PLAYFROM_ASSET_ID = 16, - SESSION_CMD_MAX -} AVSession_ControlCommand; - -/** - * parameter of the command. Whether this command requires parameters, see {@link AVSessionCommand} - * seek command requires a number parameter - * setSpeed command requires a number parameter - * setLoopMode command requires a {@link LoopMode} parameter. - * toggleFavorite command requires assetId {@link AVMetadata.assetId} parameter - * other commands need no parameter - * @type { ?(LoopMode | string | number) } - * @syscap SystemCapability.Multimedia.AVSession.Core - * @atomicservice - * @since 12 - */ -// parameter?: LoopMode | string | number; -typedef union AVSession_ControlParameters { - int32_t elapsedTime_; - int64_t updateTime_; - // int32_t - // double - // int64_t - // bool - // std::string -} AVSession_ControlParameters; - -/** - * @brief Control callback to be called in {@link OH_AVSession_ControlCallback}. - * - * @param session the {@link OH_AVSession} which object delivers the callback. - * @param command the {@link AVSession_ControlCommand} which command to be received by the callback. - * @since 11 - */ -typedef void (*OH_AVSession_ControlCallback)(OH_AVSession* session, - AVSession_ControlCommand command, AVSession_ControlParameters controlParameters); - -typedef struct AVSession_Callbacks { - /** - * Control command event callback. - */ - OH_AVSession_ControlCallback onControlCallback; -} AVSession_Callbacks; - - -/////////////////////////////////////////////////////////////////////////////////////////// - -typedef void (*OH_AVSession_Callback_Play)(OH_AVSession* session); -typedef void (*OH_AVSession_Callback_Pause)(OH_AVSession* session); -typedef void (*OH_AVSession_Callback_Stop)(OH_AVSession* session); -typedef void (*OH_AVSession_Callback_Next)(OH_AVSession* session); -typedef void (*OH_AVSession_Callback_Previous)(OH_AVSession* session); -typedef void (*OH_AVSession_Callback_Forward)(OH_AVSession* session); -typedef void (*OH_AVSession_Callback_Rewind)(OH_AVSession* session); -typedef void (*OH_AVSession_Callback_SetSpeed)(OH_AVSession* session, int32_t speed); -typedef void (*OH_AVSession_Callback_SetLoopMode)(OH_AVSession* session, AVSession_LoopMode curLoopMode); -typedef void (*OH_AVSession_Callback_ToggleFavorite)(OH_AVSession* session, char* assetId); -typedef void (*OH_AVSession_Callback_Seek)(OH_AVSession* session, int64_t seekTime); -typedef void (*OH_AVSession_Callback_PlayFromAssetId)(OH_AVSession* session, char* assetId); -typedef void (*OH_AVSession_Callback_Answer)(OH_AVSession* session); -typedef void (*OH_AVSession_Callback_Hangup)(OH_AVSession* session); -typedef void (*OH_AVSession_Callback_ToggleCallMute)(OH_AVSession* session); -typedef void (*OH_AVSession_Callback_HandleKeyEvent)(OH_AVSession* session, Input_KeyEvent keyEvent); - -#ifdef __cplusplus -} -#endif - -#endif // NATIVE_AVSESSION_ERRORS_H -/** @} */ - -/* - * Copyright (C) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @addtogroup AVSession - * @{ - * - * @brief Provides APIs of request capability for AVSession. - * @since 12 - */ - -/** - * @file native_avsession_errors.h - * - * @brief Declare avsession related error. - * - * @library libohavsession.so - * @syscap SystemCapability.Multimedia.AVSession.Core - * @kit AVSessionKit - * @since 12 - */ - -#ifndef NATIVE_AVSESSION_ERRORS_H -#define NATIVE_AVSESSION_ERRORS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief AVSession error code - * @syscap SystemCapability.Multimedia.AVSession.Core - * @since 10 - * @version 1.0 - */ -typedef enum OH_AVSession_ErrCode { - /** - * @error the operation completed successfully. - */ - AV_SESSION_ERR_SUCCESS = 0, - /** - * @error basic error mask. - */ - AV_SESSION_ERR_BASE = 1000, - /** - * @error no memory. - */ - AV_SESSION_ERR_NO_MEMORY = AV_SESSION_ERR_BASE + 1, - - - AV_SESSION_ERR_INVALID_PARAM = AV_SESSION_ERR_BASE + 2, - - AV_SESSION_ERR_SERVICE_NOT_EXIST = AV_SESSION_ERR_BASE + 3, - - AV_SESSION_ERR_SESSION_LISTENER_EXIST = AV_SESSION_ERR_BASE + 4, -} OH_AVSession_ErrCode; - -#ifdef __cplusplus -} -#endif - -#endif // NATIVE_AVSESSION_ERRORS_H -/** @} */ - - -[ - { - "first_introduced": "12", - "name": "OH_AVSession_Create" - }, - { - "first_introduced": "12", - "name": "OH_AVSession_Destroy" - }, - { - "first_introduced": "12", - "name": "OH_AVSession_SetAVMetadata" - }, - { - "first_introduced": "12", - "name": "OH_AVSession_SetAVPlaybackState" - }, - { - "first_introduced": "12", - "name": "OH_AVSession_RegisterCallback" - } -] - -# Copyright (C) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/ohos.gni") -import("//build/ohos/ndk/ndk.gni") - -ohos_ndk_headers("avsession_header") { - dest_dir = "$ndk_headers_out_dir/multimedia/av_session" - sources = [ - "native_avsesion.h", - "native_avsesion_base.h", - "native_avsesion_errors.h", - ] -} - -ohos_ndk_library("libohavsession_ndk") { - output_name = "ohavsession" - output_extension = "so" - ndk_description_file = "./libavsession.ndk.json" - system_capability = "SystemCapability.Multimedia.AVSession.Core" - system_capability_headers = [ - "multimedia/av_session/native_avsesion.h", - "multimedia/av_session/native_avsesion_base.h", - "multimedia/av_session/native_avsesion_errors.h", - ] -} \ No newline at end of file -- Gitee From 8aa0addecd827bd1b8b97d7845a35e6a8aad6ae6 Mon Sep 17 00:00:00 2001 From: yanghaiming Date: Wed, 4 Sep 2024 10:24:24 +0800 Subject: [PATCH 232/620] apply for clang with -std=c++xx is on Signed-off-by: yanghaiming --- ark_runtime/jsvm/jsvm_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ark_runtime/jsvm/jsvm_types.h b/ark_runtime/jsvm/jsvm_types.h index 1f4145245..1141b051f 100644 --- a/ark_runtime/jsvm/jsvm_types.h +++ b/ark_runtime/jsvm/jsvm_types.h @@ -679,7 +679,7 @@ typedef struct { /** int type. */ int num; /** bool type. */ - _Bool boolean; + bool boolean; } content; } JSVM_CompileOptions; -- Gitee From d798329e232abb7558875c2a0e2cc64f0be98b97 Mon Sep 17 00:00:00 2001 From: HYH Date: Wed, 4 Sep 2024 14:26:38 +0800 Subject: [PATCH 233/620] dsa Signed-off-by: HYH --- multimodalinput/kits/c/input/oh_input_manager.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 18204bd8c..9d8243301 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -1350,7 +1350,7 @@ void OH_Input_SetRepeat(Input_Hotkey* hotkey, bool isRepeat); * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ -Input_Result OH_Input_IsRepeat(const Input_Hotkey* hotkey, bool *isRepeat); +Input_Result OH_Input_GetRepeat(const Input_Hotkey* hotkey, bool *isRepeat); /** * @brief Subscribes to shortcut key events. @@ -1359,8 +1359,8 @@ Input_Result OH_Input_IsRepeat(const Input_Hotkey* hotkey, bool *isRepeat); * @param callback Callback used to return shortcut key events. * @return OH_Input_AddHotkeyMonitor status code, specifically, * {@link INPUT_SUCCESS} if the operation is successful;\n - * {@link INPUT_PARAMETER_ERROR} if parameter verification fails;\n - * {@link INPUT_SERVICE_EXCEPTION} if the service is abnormal probably + * {@link INPUT_PARAMETER_ERROR} if hotkey or callback is NULL;\n + * {@link INPUT_HOTKEY_ALREADY_REGISTER} if the service is abnormal probably * because subscription to shortcut key events has been enabled.\n * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 @@ -1374,7 +1374,7 @@ Input_Result OH_Input_AddHotkeyMonitor(const Input_Hotkey* hotkey, Input_HotkeyC * @param callback Callback used to return shortcut key events. * @return OH_Input_RemoveHotkeyMonitor status code, specifically, * {@link INPUT_SUCCESS} if the operation is successful;\n - * {@link INPUT_PARAMETER_ERROR} if parameter verification fails;\n + * {@link INPUT_PARAMETER_ERROR} if hotkey or callback is NULL;\n * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ -- Gitee From dd04e0d0c3993710b6f63ca9d7da302ac405041b Mon Sep 17 00:00:00 2001 From: huchang Date: Wed, 10 Jul 2024 18:40:14 +0800 Subject: [PATCH 234/620] support for mic blocked in audio Signed-off-by: huchang Change-Id: I255c5c691babee2dcf0ef68dacacdb092bec5a09 --- .../native_audio_routing_manager.h | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h index 153d37d39..af16c23bc 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h @@ -237,6 +237,39 @@ OH_AudioCommon_Result OH_AudioRoutingManager_UnregisterDeviceChangeCallback( OH_AudioCommon_Result OH_AudioRoutingManager_ReleaseDevices( OH_AudioRoutingManager *audioRoutingManager, OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray); + +/** + * @brief This function pointer will point to the callback function that is used to return the microphones that + * are blocked. + * @param audioDeviceDescriptorArray The {@link OH_AudioDeviceDescriptorArray} + * pointer variable which will be set the audio device descriptors value. + * Do not release the audioDeviceDescriptorArray pointer separately instead of calling + * {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array when it is no use anymore. + * @param userData User data which is passed by user. + * @since 12 + */ +typedef void (*OH_AudioRoutingManager_OnMicrophoneBlockedCallback)( + OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray, + void *userData); + +/** + * @brief Set the micophone blocked callback. + * @param audioRoutingManager The {@link OH_AudioRoutingManager} handle returned by + * {@link OH_AudioManager_GetAudioRoutingManager}. + * @param callback The function pointer will point to the callback function that is used to return the microphones that + * are blocked. + * @param userData User data which is passed by user. + * @return Function result code: + * {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful. + * {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}: + * 1.The param of audioRoutingManager is nullptr; + * 2.The param of callback is nullptr. + * @since 12 + */ +OH_AudioCommon_Result OH_AudioRoutingManager_SetMicrophoneBlockedCallback( + OH_AudioRoutingManager *audioRoutingManager, + OH_AudioRoutingManager_OnMicrophoneBlockedCallback callback, + void *userData); #ifdef __cplusplus } #endif -- Gitee From 2dfbbe86bdd47b50cb26da9cfe3a98fdfc662f79 Mon Sep 17 00:00:00 2001 From: huchang Date: Thu, 18 Jul 2024 09:41:20 +0800 Subject: [PATCH 235/620] add micblocked json Signed-off-by: huchang Change-Id: Ida090f4484c431699123229fab15e9c7ba12cf24 --- .../audio_manager/native_audio_routing_manager.h | 4 ++-- multimedia/audio_framework/ohaudio.ndk.json | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h index af16c23bc..2e19d9f26 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h @@ -246,7 +246,7 @@ OH_AudioCommon_Result OH_AudioRoutingManager_ReleaseDevices( * Do not release the audioDeviceDescriptorArray pointer separately instead of calling * {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array when it is no use anymore. * @param userData User data which is passed by user. - * @since 12 + * @since 13 */ typedef void (*OH_AudioRoutingManager_OnMicrophoneBlockedCallback)( OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray, @@ -264,7 +264,7 @@ typedef void (*OH_AudioRoutingManager_OnMicrophoneBlockedCallback)( * {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}: * 1.The param of audioRoutingManager is nullptr; * 2.The param of callback is nullptr. - * @since 12 + * @since 13 */ OH_AudioCommon_Result OH_AudioRoutingManager_SetMicrophoneBlockedCallback( OH_AudioRoutingManager *audioRoutingManager, diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 06d09d6f0..6b1328f5a 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -370,5 +370,9 @@ { "first_introduced": "12", "name":"OH_AudioRenderer_SetDefaultOutputDevice" + }, + { + "first_introduced": "13", + "name": "OH_AudioRoutingManager_SetMicrophoneBlockedCallback" } ] -- Gitee From ae38849bdeb448b214cc068be35f4916bfb04136 Mon Sep 17 00:00:00 2001 From: HYH Date: Wed, 4 Sep 2024 16:30:49 +0800 Subject: [PATCH 236/620] dah Signed-off-by: HYH --- multimodalinput/kits/c/input/oh_input_manager.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 9d8243301..3e23ca4b8 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -214,6 +214,8 @@ typedef struct Input_AxisEvent Input_AxisEvent; * @since 12 */ typedef enum Input_Result { + /** Hotkey has been registered */ + INPUT_HOTKEY_ERROR_COMBINATION_KEY = -2, /** @error Success return code on success*/ INPUT_SUCCESS = 0, /** @error Permission verification failed */ -- Gitee From 9373646806d93fb4c4d8eeb0118da72aac345804 Mon Sep 17 00:00:00 2001 From: HYH Date: Wed, 4 Sep 2024 16:37:35 +0800 Subject: [PATCH 237/620] dada Signed-off-by: HYH --- multimodalinput/kits/c/input/oh_input_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 3e23ca4b8..af29b4abe 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -215,7 +215,7 @@ typedef struct Input_AxisEvent Input_AxisEvent; */ typedef enum Input_Result { /** Hotkey has been registered */ - INPUT_HOTKEY_ERROR_COMBINATION_KEY = -2, + INPUT_HOTKEY_ALREADY_REGISTER = -2, /** @error Success return code on success*/ INPUT_SUCCESS = 0, /** @error Permission verification failed */ -- Gitee From bf1845316e3869c1639f4dd1677c64731b8c77fe Mon Sep 17 00:00:00 2001 From: shenshiyi2 Date: Mon, 2 Sep 2024 20:45:15 +0800 Subject: [PATCH 238/620] =?UTF-8?q?pixelmap=20native=E5=B1=82=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=93=8D=E4=BD=9Ccolorspace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenshiyi2 --- .../include/image/pixelmap_native.h | 35 +++++++++++++++++++ .../include/image_mdk_common.h | 6 ++-- .../include/image_pixel_map_mdk.h | 4 +-- .../include/image_source_mdk.h | 6 ++-- .../image_framework/libpixelmap.ndk.json | 8 +++++ 5 files changed, 51 insertions(+), 8 deletions(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 0e5956cfe..ec7dfd496 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -62,6 +62,13 @@ typedef struct OH_PixelmapNative OH_PixelmapNative; struct OH_NativeBuffer; typedef struct OH_NativeBuffer OH_NativeBuffer; +/** + * @brief Define a native ColorSpaceManager type, used for retrieving a native ColorSpaceManager. + * + * @since 13 + */ +typedef struct OH_NativeColorSpaceManager OH_NativeColorSpaceManager; + /** * @brief Define a pixelmap alpha type. * @@ -834,6 +841,34 @@ Image_ErrorCode OH_PixelmapNative_SetMetadata(OH_PixelmapNative *pixelmap, OH_Pi */ Image_ErrorCode OH_PixelmapNative_GetNativeBuffer(OH_PixelmapNative *pixelmap, OH_NativeBuffer **nativeBuffer); +/** + * @brief Get the native colorspace from the PixelMap. + * + * @param pixelmap The native pixelmap to get the native colorspace from. + * @param colorSpaceNative The native colorspace to retrieve. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the execution is successful. + * {@link IMAGE_BAD_PARAMETER} The param of pixelmap or colorSpaceNative is nullptr or invalid. + * @see OH_PixelmapNative + * @since 13 + */ +Image_ErrorCode OH_PixelmapNative_GetColorSpaceNative(OH_PixelmapNative *pixelmap, + OH_NativeColorSpaceManager **colorSpaceNative); + +/** + * @brief Set the native colorspace for the PixelMap. + * + * @param pixelmap The native pixelmap to set the native colorspace for. + * @param colorSpaceNative The native colorspace to set. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the execution is successful. + * {@link IMAGE_BAD_PARAMETER} The param of pixelmap or colorSpaceNative is nullptr or invalid. + * @see OH_PixelmapNative + * @since 13 + */ +Image_ErrorCode OH_PixelmapNative_SetColorSpaceNative(OH_PixelmapNative *pixelmap, + OH_NativeColorSpaceManager *colorSpaceNative); + #ifdef __cplusplus }; #endif diff --git a/multimedia/image_framework/include/image_mdk_common.h b/multimedia/image_framework/include/image_mdk_common.h index 5b89d31d3..2ed208982 100644 --- a/multimedia/image_framework/include/image_mdk_common.h +++ b/multimedia/image_framework/include/image_mdk_common.h @@ -52,7 +52,7 @@ typedef enum { IMAGE_RESULT_SUCCESS = 0, // Operation success IMAGE_RESULT_BAD_PARAMETER = -1, // Invalid parameter IMAGE_RESULT_IMAGE_RESULT_BASE = IMAGE_RESULT_BASE, // Operation failed - IMAGE_RESULT_ERR_IPC = IMAGE_RESULT_BASE + 1, // IPC error. + IMAGE_RESULT_ERR_IPC = IMAGE_RESULT_BASE + 1, // ipc error IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST = IMAGE_RESULT_BASE + 2, // sharememory error IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL = IMAGE_RESULT_BASE + 3, // sharememory data abnormal IMAGE_RESULT_DECODE_ABNORMAL = IMAGE_RESULT_BASE + 4, // image decode error @@ -129,8 +129,8 @@ typedef enum { IMAGE_RESULT_MEDIA_DENCODE_ICC_FAILED = IMAGE_RESULT_BASE + 75, // image dencode ICC fail IMAGE_RESULT_MEDIA_ENCODE_ICC_FAILED = IMAGE_RESULT_BASE + 76, // image encode ICC fail - IMAGE_RESULT_MEDIA_READ_PIXELMAP_FAILED = IMAGE_RESULT_BASE + 150, // Failed to read the pixel map. - IMAGE_RESULT_MEDIA_WRITE_PIXELMAP_FAILED = IMAGE_RESULT_BASE + 151, // Failed to write the pixel map. + IMAGE_RESULT_MEDIA_READ_PIXELMAP_FAILED = IMAGE_RESULT_BASE + 150, // read pixelmap failed + IMAGE_RESULT_MEDIA_WRITE_PIXELMAP_FAILED = IMAGE_RESULT_BASE + 151, // write pixelmap failed IMAGE_RESULT_MEDIA_PIXELMAP_NOT_ALLOW_MODIFY = IMAGE_RESULT_BASE + 152, // pixelmap not allow modify IMAGE_RESULT_MEDIA_CONFIG_FAILED = IMAGE_RESULT_BASE + 153, // config error IMAGE_RESULT_JNI_ENV_ABNORMAL = IMAGE_RESULT_BASE + 154, // Abnormal JNI environment diff --git a/multimedia/image_framework/include/image_pixel_map_mdk.h b/multimedia/image_framework/include/image_pixel_map_mdk.h index 53105e9f4..b05dc9ca7 100644 --- a/multimedia/image_framework/include/image_pixel_map_mdk.h +++ b/multimedia/image_framework/include/image_pixel_map_mdk.h @@ -197,7 +197,7 @@ struct OhosPixelMapCreateOps { * returns {@link IRNdkErrCode} IMAGE_RESULT_ENCODE_FAILED - if image add pixel map fail. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_UNSUPPORT - if image hardware decode unsupported. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_FAILED - if hard decode failed. - * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if IPC error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if ipc error. * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. @@ -264,7 +264,7 @@ int32_t OH_PixelMap_CreatePixelMapWithStride(napi_env env, OhosPixelMapCreateOps * returns {@link IRNdkErrCode} IMAGE_RESULT_ENCODE_FAILED - if image add pixel map fail. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_UNSUPPORT - if image hardware decode unsupported. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_FAILED - if hard decode failed. - * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if IPC error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if ipc error. * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. diff --git a/multimedia/image_framework/include/image_source_mdk.h b/multimedia/image_framework/include/image_source_mdk.h index f51f27dd8..ae7cadf4d 100644 --- a/multimedia/image_framework/include/image_source_mdk.h +++ b/multimedia/image_framework/include/image_source_mdk.h @@ -668,7 +668,7 @@ ImageSourceNative* OH_ImageSource_InitNative(napi_env env, napi_value source); * returns {@link IRNdkErrCode} IMAGE_RESULT_ENCODE_FAILED - if image add pixel map fail. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_UNSUPPORT - if image hardware decode unsupported. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_FAILED - if hard decode failed. - * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if IPC error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if ipc error. * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. @@ -714,7 +714,7 @@ int32_t OH_ImageSource_CreatePixelMap(const ImageSourceNative* native, * returns {@link IRNdkErrCode} IMAGE_RESULT_ENCODE_FAILED - if image add pixel map fail. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_UNSUPPORT - if image hardware decode unsupported. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_FAILED - if hard decode failed. - * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if IPC error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if ipc error. * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. @@ -928,7 +928,7 @@ int32_t OH_ImageSource_ModifyImageProperty(const ImageSourceNative* native, * returns {@link IRNdkErrCode} IMAGE_RESULT_ENCODE_FAILED - image add pixel map fail. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_UNSUPPORT - if image hardware decode unsupported. * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_FAILED - if hard decode failed. - * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if IPC error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if ipc error. * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index 78c1a0235..a70c33369 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -159,6 +159,14 @@ "first_introduced": "12", "name": "OH_PixelmapNative_GetNativeBuffer" }, + { + "first_introduced": "13", + "name": "OH_PixelmapNative_GetColorSpaceNative" + }, + { + "first_introduced": "13", + "name": "OH_PixelmapNative_SetColorSpaceNative" + }, { "first_introduced": "12", "name": "OH_PixelmapNative_ConvertPixelmapNativeToNapi" -- Gitee From e7ce80f760aea2d41e850f294d169db1281c9a7c Mon Sep 17 00:00:00 2001 From: zheng_zhi_hao Date: Wed, 4 Sep 2024 13:17:27 +0800 Subject: [PATCH 239/620] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zheng_zhi_hao --- BasicServicesKit/ohprint.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BasicServicesKit/ohprint.h b/BasicServicesKit/ohprint.h index 32fa197f1..66b71c05b 100644 --- a/BasicServicesKit/ohprint.h +++ b/BasicServicesKit/ohprint.h @@ -491,7 +491,7 @@ typedef struct { /** * @brief Write files result callback. * - * @param joibId The print job id of one print task. + * @param jobId The print job id of one print task. * @param code The result of write files. * @since 13 */ @@ -772,7 +772,7 @@ Print_ErrorCode OH_Print_UpdatePrinterProperties(const char *printerId, const Pr Print_ErrorCode OH_Print_RestorePrinterProperties(const char *printerId, const Print_StringList *propertyKeyList); /** - * @brief This API restores printer properties to default settings based on the list of property keywords. + * @brief This API provide capacity to start print dialog. * * @permission {@code ohos.permission.PRINT} * @param printJobName The name of this print job. -- Gitee From 8df533a26edff16ae86f712dae984d14a880a315 Mon Sep 17 00:00:00 2001 From: HYH Date: Thu, 5 Sep 2024 11:34:13 +0800 Subject: [PATCH 240/620] dad Signed-off-by: HYH --- multimodalinput/kits/c/input/oh_input_manager.h | 9 +++++---- multimodalinput/kits/c/ohinput.ndk.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index af29b4abe..7b0f34c95 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -214,8 +214,6 @@ typedef struct Input_AxisEvent Input_AxisEvent; * @since 12 */ typedef enum Input_Result { - /** Hotkey has been registered */ - INPUT_HOTKEY_ALREADY_REGISTER = -2, /** @error Success return code on success*/ INPUT_SUCCESS = 0, /** @error Permission verification failed */ @@ -227,7 +225,9 @@ typedef enum Input_Result { /** @error Service error */ INPUT_SERVICE_EXCEPTION = 3800001, /** @error Interceptor repeatedly created for an application */ - INPUT_REPEAT_INTERCEPTOR = 4200001 + INPUT_REPEAT_INTERCEPTOR = 4200001, + /** @error Hotkey has been preempted subscription */ + INPUT_HOTKEY_ALREADY_REGISTER = 4200002, } Input_Result; /** @@ -1362,7 +1362,8 @@ Input_Result OH_Input_GetRepeat(const Input_Hotkey* hotkey, bool *isRepeat); * @return OH_Input_AddHotkeyMonitor status code, specifically, * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} if hotkey or callback is NULL;\n - * {@link INPUT_HOTKEY_ALREADY_REGISTER} if the service is abnormal probably + * {@link INPUT_HOTKEY_ALREADY_REGISTER} if hotkey has been preempted subscription;\n + * {@link INPUT_REPEAT_INTERCEPTOR} if the service is abnormal probably * because subscription to shortcut key events has been enabled.\n * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 diff --git a/multimodalinput/kits/c/ohinput.ndk.json b/multimodalinput/kits/c/ohinput.ndk.json index ac5694b14..128f479e5 100644 --- a/multimodalinput/kits/c/ohinput.ndk.json +++ b/multimodalinput/kits/c/ohinput.ndk.json @@ -369,6 +369,6 @@ }, { "first_introduced": "13", - "name": "OH_Input_IsRepeat" + "name": "OH_Input_GetRepeat" } ] \ No newline at end of file -- Gitee From ddd5fe98640eaa735714d5280d276a4bca842390 Mon Sep 17 00:00:00 2001 From: HYH Date: Thu, 5 Sep 2024 12:22:19 +0800 Subject: [PATCH 241/620] das Signed-off-by: HYH --- multimodalinput/kits/c/input/oh_input_manager.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 7b0f34c95..e139e0b7c 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -226,7 +226,7 @@ typedef enum Input_Result { INPUT_SERVICE_EXCEPTION = 3800001, /** @error Interceptor repeatedly created for an application */ INPUT_REPEAT_INTERCEPTOR = 4200001, - /** @error Hotkey has been preempted subscription */ + /** @error Subscription has been enabled */ INPUT_HOTKEY_ALREADY_REGISTER = 4200002, } Input_Result; @@ -1362,9 +1362,9 @@ Input_Result OH_Input_GetRepeat(const Input_Hotkey* hotkey, bool *isRepeat); * @return OH_Input_AddHotkeyMonitor status code, specifically, * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} if hotkey or callback is NULL;\n - * {@link INPUT_HOTKEY_ALREADY_REGISTER} if hotkey has been preempted subscription;\n - * {@link INPUT_REPEAT_INTERCEPTOR} if the service is abnormal probably - * because subscription to shortcut key events has been enabled.\n + * {@link INPUT_HOTKEY_ALREADY_REGISTER} Subscription has been enabled;\n + * {@link INPUT_REPEAT_INTERCEPTOR} The shortcut key has been occupied. + * You can use {@link getAllSystemHotkeys} to query all system shortcut keys.\n * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ -- Gitee From 61aca5d5c5cea9a1a313dc799c141585f2ca5ee4 Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Thu, 5 Sep 2024 09:49:38 +0000 Subject: [PATCH 242/620] capi configuration Signed-off-by: hellohyh001 Change-Id: I96673d200d8bab7b9e19713cb3a44cab7b2cb445 --- multimodalinput/kits/c/ohinput.ndk.json | 60 +++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/multimodalinput/kits/c/ohinput.ndk.json b/multimodalinput/kits/c/ohinput.ndk.json index 60da3d2a8..dd6878ec3 100644 --- a/multimodalinput/kits/c/ohinput.ndk.json +++ b/multimodalinput/kits/c/ohinput.ndk.json @@ -354,5 +354,65 @@ { "first_introduced": "13", "name": "OH_Input_GetFinalKey" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetDeviceIds" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetDevice" + }, + { + "first_introduced": "13", + "name": "OH_Input_CreateDeviceInfo" + }, + { + "first_introduced": "13", + "name": "OH_Input_DestroyDeviceInfo" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetKeyboardType" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetDeviceId" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetDeviceName" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetCapabilities" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetDeviceVersion" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetDeviceProduct" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetDeviceVendor" + }, + { + "first_introduced": "13", + "name": "OH_Input_GetDeviceAddress" + }, + { + "first_introduced": "13", + "name": "OH_Input_RegisterDeviceListener" + }, + { + "first_introduced": "13", + "name": "OH_Input_UnregisterDeviceListener" + }, + { + "first_introduced": "13", + "name": "OH_Input_UnregisterDeviceListeners" } ] \ No newline at end of file -- Gitee From c993cae739a810efb74446a1abaf90bea822cf76 Mon Sep 17 00:00:00 2001 From: HYH Date: Thu, 5 Sep 2024 20:03:09 +0800 Subject: [PATCH 243/620] hyb Signed-off-by: HYH --- multimodalinput/kits/c/input/oh_input_manager.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index e139e0b7c..939641642 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -226,8 +226,10 @@ typedef enum Input_Result { INPUT_SERVICE_EXCEPTION = 3800001, /** @error Interceptor repeatedly created for an application */ INPUT_REPEAT_INTERCEPTOR = 4200001, - /** @error Subscription has been enabled */ - INPUT_HOTKEY_ALREADY_REGISTER = 4200002, + /** @error Already occupied by the system */ + INPUT_OCCUPIED_BY_SYSTEM = 4200002, + /** @error Already occupied by the other */ + INPUT_OCCUPIED_BY_OTHER = 4200003, } Input_Result; /** @@ -1362,9 +1364,9 @@ Input_Result OH_Input_GetRepeat(const Input_Hotkey* hotkey, bool *isRepeat); * @return OH_Input_AddHotkeyMonitor status code, specifically, * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} if hotkey or callback is NULL;\n - * {@link INPUT_HOTKEY_ALREADY_REGISTER} Subscription has been enabled;\n - * {@link INPUT_REPEAT_INTERCEPTOR} The shortcut key has been occupied. - * You can use {@link getAllSystemHotkeys} to query all system shortcut keys.\n + * {@Link INPUT_OCCUPIED_BY_SYSTEM} The hotkey has been used by the system. You can call the {@Link + * GetAllSystemHotkeys} interface to query all system shortcut keys.\n + * {@Link INPUT_OCCUPIED_BY_OTHER} The hotkey has been subscribed to by another.\n * @syscap SystemCapability.MultimodalInput.Input.Core * @since 13 */ -- Gitee From a8ca035e138d836ad76aaf945f7e6dab9e5dcc5a Mon Sep 17 00:00:00 2001 From: dujingcheng Date: Tue, 3 Sep 2024 13:58:36 +0000 Subject: [PATCH 244/620] add fanyi Signed-off-by: dujingcheng --- arkui/ace_engine/native/libace.ndk.json | 92 +- .../native/native_interface_accessibility.h | 1038 +++++++++-------- .../native/native_interface_xcomponent.h | 11 +- 3 files changed, 626 insertions(+), 515 deletions(-) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 108067435..c6daa0bf7 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2149,167 +2149,167 @@ }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoParentId" + "name": "OH_ArkUI_AccessibilityElementInfoSetParentId" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoComponentType" + "name": "OH_ArkUI_AccessibilityElementInfoSetComponentType" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoContents" + "name": "OH_ArkUI_AccessibilityElementInfoSetContents" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoHintText" + "name": "OH_ArkUI_AccessibilityElementInfoSetHintText" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoAccessibilityText" + "name": "OH_ArkUI_AccessibilityElementInfoSetAccessibilityText" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoAccessibilityDescription" + "name": "OH_ArkUI_AccessibilityElementInfoSetAccessibilityDescription" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoChildNodeIds" + "name": "OH_ArkUI_AccessibilityElementInfoSetChildNodeIds" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoOperationActions" + "name": "OH_ArkUI_AccessibilityElementInfoSetOperationActions" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoScreenRect" + "name": "OH_ArkUI_AccessibilityElementInfoSetScreenRect" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoCheckable" + "name": "OH_ArkUI_AccessibilityElementInfoSetCheckable" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoChecked" + "name": "OH_ArkUI_AccessibilityElementInfoSetChecked" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoFocusable" + "name": "OH_ArkUI_AccessibilityElementInfoSetFocusable" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoFocused" + "name": "OH_ArkUI_AccessibilityElementInfoSetFocused" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoVisible" + "name": "OH_ArkUI_AccessibilityElementInfoSetVisible" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoAccessibilityFocused" + "name": "OH_ArkUI_AccessibilityElementInfoSetAccessibilityFocused" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoSelected" + "name": "OH_ArkUI_AccessibilityElementInfoSetSelected" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoClickable" + "name": "OH_ArkUI_AccessibilityElementInfoSetClickable" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoLongClickable" + "name": "OH_ArkUI_AccessibilityElementInfoSetLongClickable" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoEnabled" + "name": "OH_ArkUI_AccessibilityElementInfoSetEnabled" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoIsPassword" + "name": "OH_ArkUI_AccessibilityElementInfoSetIsPassword" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoScrollable" + "name": "OH_ArkUI_AccessibilityElementInfoSetScrollable" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoEditable" + "name": "OH_ArkUI_AccessibilityElementInfoSetEditable" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoIsHint" + "name": "OH_ArkUI_AccessibilityElementInfoSetIsHint" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoRangeInfo" + "name": "OH_ArkUI_AccessibilityElementInfoSetRangeInfo" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoGridInfo" + "name": "OH_ArkUI_AccessibilityElementInfoSetGridInfo" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoGridItemInfo" + "name": "OH_ArkUI_AccessibilityElementInfoSetGridItemInfo" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoTextBeginSelected" + "name": "OH_ArkUI_AccessibilityElementInfoSetSelectedTextStart" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoTextEndSelected" + "name": "OH_ArkUI_AccessibilityElementInfoSetSelectedTextEnd" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoCurrentItemIndex" + "name": "OH_ArkUI_AccessibilityElementInfoSetCurrentItemIndex" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoBeginItemIndex" + "name": "OH_ArkUI_AccessibilityElementInfoSetStartItemIndex" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoEndItemIndex" + "name": "OH_ArkUI_AccessibilityElementInfoSetEndItemIndex" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoItemCount" + "name": "OH_ArkUI_AccessibilityElementInfoSetItemCount" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoAccessibilityOffset" + "name": "OH_ArkUI_AccessibilityElementInfoSetAccessibilityOffset" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoAccessibilityGroup" + "name": "OH_ArkUI_AccessibilityElementInfoSetAccessibilityGroup" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoAccessibilityLevel" + "name": "OH_ArkUI_AccessibilityElementInfoSetAccessibilityLevel" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoZIndex" + "name": "OH_ArkUI_AccessibilityElementInfoSetZIndex" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoAccessibilityOpacity" + "name": "OH_ArkUI_AccessibilityElementInfoSetAccessibilityOpacity" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoBackgroundColor" + "name": "OH_ArkUI_AccessibilityElementInfoSetBackgroundColor" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoBackgroundImage" + "name": "OH_ArkUI_AccessibilityElementInfoSetBackgroundImage" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoBlur" + "name": "OH_ArkUI_AccessibilityElementInfoSetBlur" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoHitTestBehavior" + "name": "OH_ArkUI_AccessibilityElementInfoSetHitTestBehavior" }, { "first_introduced": "13", @@ -2321,19 +2321,19 @@ }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityEventEventType" + "name": "OH_ArkUI_AccessibilityEventSetEventType" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityEventTextAnnouncedForAccessibility" + "name": "OH_ArkUI_AccessibilityEventSetTextAnnouncedForAccessibility" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityEventRequestFocusId" + "name": "OH_ArkUI_AccessibilityEventSetRequestFocusId" }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityEventElementInfo" + "name": "OH_ArkUI_AccessibilityEventSetElementInfo" }, { "first_introduced": "13", @@ -2353,6 +2353,6 @@ }, { "first_introduced": "13", - "name": "OH_ArkUI_SetAccessibilityElementInfoElementId" + "name": "OH_ArkUI_AccessibilityElementInfoSetElementId" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_interface_accessibility.h b/arkui/ace_engine/native/native_interface_accessibility.h index 3c0aafba1..4150edcec 100644 --- a/arkui/ace_engine/native/native_interface_accessibility.h +++ b/arkui/ace_engine/native/native_interface_accessibility.h @@ -14,22 +14,22 @@ */ /** - * @addtogroup ArkUI_AccessibilityProvider + * @addtogroup ArkUI_Accessibility * @{ * - * @brief + * @brief Describes the native capabilities supported by ArkUI Accessibility, such as querying accessibility nodes and + * reporting accessibility events. * * @since 13 - * @version 1.0 */ /** * @file native_interface_accessibility.h * - * @brief - * + * @brief Declares the APIs used to access the native Accessibility. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @kit ArkUI * @since 13 - * @version 1.0 */ #ifndef _NATIVE_INTERFACE_ACCESSIBILITY_H #define _NATIVE_INTERFACE_ACCESSIBILITY_H @@ -41,878 +41,988 @@ extern "C"{ #endif /** - * @brief Provides an encapsulated ArkUI_AccessibilityElementInfo instance. + * @brief Defines a struct for accessibility element information. * * @since 13 */ typedef struct ArkUI_AccessibilityElementInfo ArkUI_AccessibilityElementInfo; /** - * @brief Defines the accessibility event info. + * @brief Defines a struct for accessibility event information. * * @since 13 */ typedef struct ArkUI_AccessibilityEventInfo ArkUI_AccessibilityEventInfo; /** - * @brief Definesthe accessibility native provider. + * @brief Defines a struct for the local provider of accessibility. * * @since 13 */ typedef struct ArkUI_AccessibilityProvider ArkUI_AccessibilityProvider; /** - * @brief Provides an encapsulated OH_NativeAccessibilityDictionary instance, Implement the function of cpp dictionary. + * @brief Defines a struct for accessibility action arguments. * * @since 13 - * @version 1.0 */ -typedef struct ArkUI_AccessibilityActionArguments ArkUI_AccessibilityActionArguments; +typedef struct ArkUI_AccessibilityActionArguments ArkUI_AccessibilityActionArguments; /** - * @brief Enumerates the API accessibility actions. + * @brief Defines an enum for accessibility action types. * * @since 13 - * @version 1.0 */ typedef enum { - /** Invalid */ - ARKUI_NATIVE_ACCESSIBILITY_ACTION_INVALID = 0, - /** After receiving the event, the component needs to respond to the click. */ - ARKUI_NATIVE_ACCESSIBILITY_ACTION_CLICK = 0x00000010, - /** After receiving the event, the component needs to respond to the long click. */ - ARKUI_NATIVE_ACCESSIBILITY_ACTION_LONG_CLICK = 0x00000020, - /** Indicates the operation of obtaining the accessibility focus. The specific component is focused */ - ARKUI_NATIVE_ACCESSIBILITY_ACTION_ACCESSIBILITY_FOCUS = 0x00000040, - /** Indicates the operation of clearing the accessibility focus. */ - ARKUI_NATIVE_ACCESSIBILITY_ACTION_CLEAR_ACCESSIBILITY_FOCUS = 0x00000080, - /** The scrolling component responds to forward scrolling action. */ - ARKUI_NATIVE_ACCESSIBILITY_ACTION_SCROLL_FORWARD = 0x00000100, - /** The scrolling component responds to backwrad scrolling action. */ - ARKUI_NATIVE_ACCESSIBILITY_ACTION_SCROLL_BACKWARD = 0x00000200, - /** Coping the selected content for the text component. */ - ARKUI_NATIVE_ACCESSIBILITY_ACTION_COPY = 0x00000400, - /** Paste the selected content for the text component. */ - ARKUI_NATIVE_ACCESSIBILITY_ACTION_PASTE = 0x00000800, - /** Cut the selected content for the text component. */ - ARKUI_NATIVE_ACCESSIBILITY_ACTION_CUT = 0x00001000, - /** Indicates the selection operation. The selectTextBegin, selectTextEnd, and selectTextInForWard parameters need to be set. Select a text segment in the edit box. */ - ARKUI_NATIVE_ACCESSIBILITY_ACTION_SET_SELECTION = 0x00002000, - /** Set the text Content for the text component. */ - ARKUI_NATIVE_ACCESSIBILITY_ACTION_SET_TEXT = 0x00004000, - /** Set the cursor position for the text component. */ - ARKUI_NATIVE_ACCESSIBILITY_ACTION_SET_CURSOR_POSITION = 0x00100000, + /** Invalid action. */ + ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_INVALID = 0, + /** Response to a click. */ + ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CLICK = 0x00000010, + /** Response to a long click. */ + ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_LONG_CLICK = 0x00000020, + /** Accessibility focus acquisition. */ + ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_GAIN_ACCESSIBILITY_FOCUS = 0x00000040, + /** Accessibility focus clearance. */ + ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CLEAR_ACCESSIBILITY_FOCUS = 0x00000080, + /** Forward scroll action. */ + ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SCROLL_FORWARD = 0x00000100, + /** Backward scroll action. */ + ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SCROLL_BACKWARD = 0x00000200, + /** Copy action for text content. */ + ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_COPY = 0x00000400, + /** Paste action for text content. */ + ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_PASTE = 0x00000800, + /** Cut action for text content. */ + ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CUT = 0x00001000, + /** Text selection action, requiring the setting of selectTextBegin, TextEnd, and TextInForward + * parameters to select a text segment in the text box. */ + ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SELECT_TEXT = 0x00002000, + /** Text content setting action. */ + ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SET_TEXT = 0x00004000, + /** Cursor position setting action. */ + ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SET_CURSOR_POSITION = 0x00100000, } ArkUI_Accessibility_ActionType; /** - * @brief Enumerates the API accessibility event types. + * @brief Defines an enum for accessibility event types. * * @since 13 - * @version 1.0 */ typedef enum { - /** Invalid */ - ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_INVALID = 0, - /** Clicked event, which is sent after the UI component responds. */ - ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_CLICKED_EVENT = 0x00000001, - /** Long-Clicked event, which is sent after the UI component responds. */ - ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_LONG_CLICKED_EVENT = 0x00000002, - /** Selected event, which is sent after the UI component responds. */ - ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_SELECTED_EVENT = 0x00000004, - /** Text update event, needs to be send when the text is updated. */ - ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_TEXT_UPDATE_EVENT = 0x00000010, - /** Page update event, which is sent when the page jumps, switchs, changes in size, or moves. */ - ARKUI_NATIVE_ACCESSIBILITY_TYPE_PAGE_STATE_UPDATE = 0x00000020, - /** Content update event, which is sent when the page content changes. */ - ARKUI_NATIVE_ACCESSIBILITY_TYPE_PAGE_CONTENT_UPDATE = 0x00000800, - /** scrolled event, this event is send when a scrolling event occurs on a component that can be scrolled. */ - ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_SCROLLED_EVENT = 0x000001000, - /** Accessibility focus event, which is send after the UI component responds. */ - ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_ACCESSIBILITY_FOCUSED_EVENT = 0x00008000, - /** Accessibility focus clear event, which is send after the UI component responds. */ - ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED_EVENT = 0x00010000, - /** Request focus for accessibility event, proactively reqeust to focus on a specified node. */ - ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_REQUEST_FOCUS_FOR_ACCESSIBILITY = 0x02000000, - /** Page open event. the event is reported when the UI component */ - ARKUI_NATIVE_ACCESSIBILITY_TYPE_PAGE_OPEN = 0x20000000, - /** Page close event. the event is reported when the UI component */ - ARKUI_NATIVE_ACCESSIBILITY_TYPE_PAGE_CLOSE = 0x08000000, - /** Announce for accessibility event, requesting to actively play the specified content event. */ - ARKUI_NATIVE_ACCESSIBILITY_TYPE_VIEW_ANNOUNCE_FOR_ACCESSIBILITY = 0x10000000, + /** Invalid event. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_INVALID = 0, + /** Click event, sent after the UI component responds. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_CLICKED = 0x00000001, + /** Long click event, sent after the UI component responds. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_LONG_CLICKED = 0x00000002, + /** Selection event, sent after the UI component responds. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_SELECTED = 0x00000004, + /** Text update event, sent when text is updated. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_TEXT_UPDATE = 0x00000010, + /** Page state update event, sent when the page transitions, switches, resizes, or moves. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_STATE_UPDATE = 0x00000020, + /** Page content update event, sent when the page content changes. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_CONTENT_UPDATE = 0x00000800, + /** Scrolled event, sent when a scrollable component experiences a scroll event. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_SCROLLED = 0x000001000, + /** Accessibility focus event, sent after the UI component responds. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ACCESSIBILITY_FOCUSED = 0x00008000, + /** Accessibility focus cleared event, sent after the UI component responds. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ACCESSIBILITY_FOCUS_CLEARED = 0x00010000, + /** FOcus request for a specific node. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_REQUEST_ACCESSIBILITY_FOCUS = 0x02000000, + /** Page open event reported by the UI component. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_OPEN = 0x20000000, + /** Page close event reported by the UI component. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_CLOSE = 0x08000000, + /** Announcement event, indicating a request to proactively announce specified content. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ANNOUNCE_FOR_ACCESSIBILITY = 0x10000000, + /** Focus update event, used for focus update scenarios. */ + ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_FOCUS_NODE_UPDATE = 0x10000001, } ArkUI_AccessibilityEventType; /** - * @brief Defines the accessible of action + * @brief Defines a struct for the accessible action. * * @since 13 - * @version 1.0 */ typedef struct { - /** action type. */ + /** Action type. */ ArkUI_Accessibility_ActionType actionType; - /** the description message of action. */ + /** Action description. */ const char* description; } ArkUI_AccessibleAction; /** - * @brief Defines the accessible of rect. + * @brief Defines a struct for the accessible rectangle. * * @since 13 - * @version 1.0 */ typedef struct { - /** the left top x pixel corrdinates. */ + /** X coordinate of the upper left corner. */ int32_t leftTopX; - /** the left top y pixel corrdinates. */ + /** Y coordinate of the upper left corner. */ int32_t leftTopY; - /** the right bottom x pixel corrdinates. */ + /** X coordinate of the lower right corner. */ int32_t rightBottomX; - /** the right bottom y pixel corrdinates. */ + /** Y coordinate of the lower right corner. */ int32_t rightBottomY; } ArkUI_AccessibleRect; /** - * @brief Defines the accessible of range info. + * @brief Define a struct for the accessible range information. * * @since 13 - * @version 1.0 */ typedef struct { - /** the min value. */ + /** Minimum value. */ double min; - /** the max value. */ + /** Maximum value. */ double max; - /** the current value. */ + /** Current value. */ double current; } ArkUI_AccessibleRangeInfo; /** - * @brief Defines the accessible of grid info. + * @brief Defines a struct for the accessible grid information. * * @since 13 - * @version 1.0 */ typedef struct { - /** The number of row. */ + /** Number of rows. */ int32_t rowCount; - /** The number of column. */ + /** Number of columns. */ int32_t columnCount; - /** 0: select one line only, otherwise select multilines. */ + /** Selection mode. The value 0 indicates that only one row can be selected. */ int32_t selectionMode; } ArkUI_AccessibleGridInfo; /** - * @brief Defines the accessible of grid item info. + * @brief Defines a struct for the accessible grid item information. * * @since 13 - * @version 1.0 */ typedef struct { - /** true: The item isHeading, otherwise is not */ + /** Whether it is a header. */ bool heading; - /** true: The item selected, otherwise is not */ + /** Whether it is selected. */ bool selected; - /** the index of column */ + /** Column index. */ int32_t columnIndex; - /** the index of row */ + /** Row index. */ int32_t rowIndex; - /** the column spanned */ + /** Column span. */ int32_t columnSpan; - /** the row spanned */ + /** Row span. */ int32_t rowSpan; } ArkUI_AccessibleGridItemInfo; /** - * @brief Enumerates the API accessibility ErrorCode states. + * @brief Enumerates the accessibility error codes. * * @since 13 - * @version 1.0 */ -enum AcessbilityErrorCode{ - /** Successful. */ - OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS = 0, - /** Failed. */ - OH_ARKUI_ACCESSIBILITY_RESULT_FAILED = -1, - /** Invalid parameters. */ - OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER = -2, - /** Out of memory. */ - OH_ARKUI_ACCESSIBILITY_RESULT_OUT_OF_MEMORY = -3, -} ; - -/** - * @brief Enumerates the API accessibility search mode. +typedef enum { + /** + * @error Success. + */ + ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL = 0, + /** + * @error Failure. + */ + ARKUI_ACCESSIBILITY_NATIVE_RESULT_FAILED = -1, + /** + * @error Invalid parameter. + */ + ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER = -2, + /** + * @error Out of memory. + */ + ARKUI_ACCESSIBILITY_NATIVE_RESULT_OUT_OF_MEMORY = -3, +} ArkUI_AcessbilityErrorCode; + +/** + * @brief Defines an enum for the accessibility search modes. * * @since 13 - * @version 1.0 */ typedef enum { - /** predecessors */ - NATIVE_SEARCH_MODE_PREFETCH_PREDECESSORS = 1 << 0, - /** slbings */ - NATIVE_SEARCH_MODE_PREFETCH_SIBLINGS = 1 << 1, - /** children */ - NATIVE_SEARCH_MODE_PREFETCH_CHILDREN = 1 << 2, - /** recusive children */ - NATIVE_SEARCH_MODE_PREFETCH_RECURSIVE_CHILDREN = 1 << 3, + /** Search for current nodes. */ + ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_CURRENT = 0, + /** Search for parent nodes. */ + ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_PREDECESSORS = 1 << 0, + /** Search for sibling nodes. */ + ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_SIBLINGS = 1 << 1, + /** Search for child nodes at the next level. */ + ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_CHILDREN = 1 << 2, + /** Search for all child nodes. */ + ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_RECURSIVE_CHILDREN = 1 << 3, } ArkUI_AccessibilitySearchMode; /** - * @brief Enumerates the API accessibility focus type. + * @brief Defines an enum for the accessibility focus types. * * @since 13 - * @version 1.0 */ typedef enum { - /** Invalid */ - NATIVE_FOCUS_TYPE_INVALID = -1, - /** Input focus type */ - NATIVE_FOCUS_TYPE_INPUT = 1 << 0, - /** Accessibility focus type */ - NATIVE_FOCUS_TYPE_ACCESSIBILITY = 1 << 1, + /** Invalid type. */ + ARKUI_ACCESSIBILITY_NATIVE_FOCUS_TYPE_INVALID = -1, + /** Input focus type. */ + ARKUI_ACCESSIBILITY_NATIVE_FOCUS_TYPE_INPUT = 1 << 0, + /** Accessibility focus type. */ + ARKUI_ACCESSIBILITY_NATIVE_FOCUS_TYPE_ACCESSIBILITY = 1 << 1, } ArkUI_AccessibilityFocusType; /** - * @brief Enumerates the API accessibility focus move direction. + * @brief Enumerates the directions for moving the accessibility focus. * * @since 13 - * @version 1.0 */ typedef enum { - /** Invalid */ - NATIVE_DIRECTION_INVALID = 0, - /** up direction. */ - NATIVE_DIRECTION_UP = 0x00000001, - /** down direction. */ - NATIVE_DIRECTION_DOWN = 0x00000002, - /** left direction. */ - NATIVE_DIRECTION_LEFT = 0x00000004, - /** right direction. */ - NATIVE_DIRECTION_RIGHT = 0x00000008, - /** forward direction. */ - NATIVE_DIRECTION_FORWARD = 0x00000010, - /** backward direction. */ - NATIVE_DIRECTION_BACKWARD = 0x00000020, + /** Invalid direction. */ + ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_INVALID = 0, + /** Up. */ + ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_UP = 0x00000001, + /** Down. */ + ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_DOWN = 0x00000002, + /** Left. */ + ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_LEFT = 0x00000004, + /** Right. */ + ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_RIGHT = 0x00000008, + /** Forward. */ + ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_FORWARD = 0x00000010, + /** Backward. */ + ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_BACKWARD = 0x00000020, } ArkUI_AccessibilityFocusMoveDirection; /** - * @brief Provides an encapsulated ArkUI_AccessibilityElementInfoList instance. + * @brief Defines a struct for the accessibility element information list. * * @since 13 - * @version 1.0 */ typedef struct ArkUI_AccessibilityElementInfoList ArkUI_AccessibilityElementInfoList; /** - * @brief Registers the accessibility provider callbacks + * @brief Registers callbacks for the accessibility provider. * * @since 13 - * @version 1.0 */ typedef struct ArkUI_AccessibilityProviderCallbacks { - /** Called when need to get element infos based on a specified node. */ - int32_t (*FindAccessibilityNodeInfosById)(int64_t elementId, ArkUI_AccessibilitySearchMode mode, int32_t requestId, ArkUI_AccessibilityElementInfoList* elementList); - /** Called when need to get element infos based on a specified node and text content. */ - int32_t (*FindAccessibilityNodeInfosByText)(int64_t elementId, const char* text, int32_t requestId, ArkUI_AccessibilityElementInfoList* elementList); - /** Called when need to get the focused element info based on a specified node. */ - int32_t (*FindFocusedAccessibilityNode)(int64_t elementId, ArkUI_AccessibilityFocusType focusType, int32_t requestId, ArkUI_AccessibilityElementInfo* elementinfo); - /** Query the node that can be focused based on the reference node. Query the next node that can be focused based on the mode and direction. */ - int32_t (*FindNextFocusAccessibilityNode)(int64_t elementId, ArkUI_AccessibilityFocusMoveDirection direction, int32_t requestId, ArkUI_AccessibilityElementInfo* elementList); - /** Performing the Action operation on a specified node. */ - int32_t (*ExecuteAccessibilityAction)(int64_t elementId, ArkUI_Accessibility_ActionType action, ArkUI_AccessibilityActionArguments *actionArguments, int32_t requestId); - /** Clears the focus status of the currently focused node */ - int32_t (*ClearFocusedFocusAccessibilityNode)(); - /** Queries the current cursor position of a specified node. */ - int32_t (*GetAccessibilityNodeCursorPosition)(int64_t elementId, int32_t requestId, int32_t* index); + /** + * @brief Called to obtain element information based on a specified node. + * + * @param elementId Indicates the element ID. + * @param mode Indicates accessibility search mode. + * @param requestId Indicates the request ID. + * @param elementList Indicates accessibility elementInfo list. + * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. + * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. + */ + int32_t (*findAccessibilityNodeInfosById)(int64_t elementId, ArkUI_AccessibilitySearchMode mode, + int32_t requestId, ArkUI_AccessibilityElementInfoList* elementList); + /** + * @brief Called to obtain element information based on a specified node and text content. + * + * @param elementId Indicates the element ID. + * @param text Indicates accessibility text. + * @param requestId Indicates the request ID. + * @param elementList Indicates accessibility elementInfo list. + * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. + * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. + */ + int32_t (*findAccessibilityNodeInfosByText)(int64_t elementId, const char* text, int32_t requestId, + ArkUI_AccessibilityElementInfoList* elementList); + /** + * @brief Called to obtain focused element information based on a specified node. + * + * @param elementId Indicates the element ID. + * @param focusType Indicates focus type. + * @param requestId Indicates the request ID. + * @param elementInfo Indicates accessibility elementInfo. + * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. + * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. + */ + int32_t (*findFocusedAccessibilityNode)(int64_t elementId, ArkUI_AccessibilityFocusType focusType, + int32_t requestId, ArkUI_AccessibilityElementInfo* elementInfo); + /** + * @brief Called to find the next focusable node based on the reference node. + * + * @param elementId Indicates the element ID. + * @param direction Indicates direction. + * @param requestId Indicates the request ID. + * @param elementInfo Indicates accessibility elementInfo. + * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. + * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. + */ + int32_t (*findNextFocusAccessibilityNode)( + int64_t elementId, ArkUI_AccessibilityFocusMoveDirection direction, + int32_t requestId, ArkUI_AccessibilityElementInfo* elementInfo); + /** + * @brief Called to execute a specified action on a specified node. + * + * @param elementId Indicates the element ID. + * @param action Indicates action. + * @param actionArguments Indicates action arguments. + * @param requestId Indicates the request ID. + * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. + * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. + */ + int32_t (*executeAccessibilityAction)(int64_t elementId, ArkUI_Accessibility_ActionType action, + ArkUI_AccessibilityActionArguments *actionArguments, int32_t requestId); + /** + * @brief Called to clear the focus state of the current focused node. + * + * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. + * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_FAILED} if the operation is failed. + */ + int32_t (*clearFocusedFocusAccessibilityNode)(); + /** + * @brief Called to query the current cursor position of the specified node. + * + * @param elementId Indicates the element ID. + * @param requestId Indicates the request ID. + * @param index Indicates index. + * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. + * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. + */ + int32_t (*getAccessibilityNodeCursorPosition)(int64_t elementId, int32_t requestId, int32_t* index); } ArkUI_AccessibilityProviderCallbacks; /** * @brief Registers a callback for this ArkUI_AccessibilityProvider instance. * - * @param provider Indicates the pointer to this ArkUI_AccessibilityProvider instance. - * @param callbacks Indicates the pointer to a GetAccessibilityNodeCursorPosition callback. - * @return Returns the status code of the execution. + * @param provider Indicates the pointer to the ArkUI_AccessibilityProvider instance. + * @param callbacks Indicates the pointer to the GetAccessibilityNodeCursorPosition callback. + * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. + * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 - * @version 1.0 */ int32_t OH_ArkUI_AccessibilityProviderRegisterCallback( - ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityProviderCallbacks* callbacks); + ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityProviderCallbacks* callbacks); /** - * @brief send accessibility event info. - * - * @param provider Indicates the pointer to this ArkUI_AccessibilityProvider instance. - * @param eventInfo Indicates the pointer to the accessibility event info. - * @param callback Indicates the pointer to a SendAccessibilityAsyncEvent callback. - * @return Returns the status code of the execution. + * @brief Sends accessibility event information. + * + * @param provider Indicates the pointer to the ArkUI_AccessibilityProvider instance. + * @param eventInfo Indicates the pointer to the accessibility event information. + * @param callback Indicates the pointer to the callback that is called after the event is sent. * @since 13 - * @version 1.0 - */ + */ void OH_ArkUI_SendAccessibilityAsyncEvent( - ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityEventInfo* eventInfo, void (*callback)(int32_t errorCode)); + ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityEventInfo* eventInfo, + void (*callback)(int32_t errorCode)); /** - * @brief Adds an element to the list. - * - * @param list Indicates the pointer to the accessibility element list. - * @return Returns the pointer to the accessibility elementInfo. + * @brief Adds and obtains the pointer to an ArkUI_AccessibilityElementInfo object. + * + * @param list Indicates the pointer to an ArkUI_AccessibilityElementInfoList object. + * @return Returns the pointer to the ArkUI_AccessibilityElementInfo object. * @since 13 - * @version 1.0 */ -ArkUI_AccessibilityElementInfo* OH_ArkUI_AddAndGetAccessibilityElementInfo(ArkUI_AccessibilityElementInfoList* list); +ArkUI_AccessibilityElementInfo* OH_ArkUI_AddAndGetAccessibilityElementInfo( + ArkUI_AccessibilityElementInfoList* list); /** -* @brief Sets the element id of the accessibility element information. +* @brief Sets the element ID for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param elementId Indicates the page id. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param elementId Indicates the element ID. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoElementId(ArkUI_AccessibilityElementInfo* elementInfo, int32_t elementId); +int32_t OH_ArkUI_AccessibilityElementInfoSetElementId( + ArkUI_AccessibilityElementInfo* elementInfo, int32_t elementId); /** -* @brief Sets the parent id of the accessibility element information. +* @brief Sets the parent ID for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param parentId Indicates the parent id. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param parentId Indicates the parent ID. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoParentId(ArkUI_AccessibilityElementInfo* elementInfo, int32_t parentId); +int32_t OH_ArkUI_AccessibilityElementInfoSetParentId( + ArkUI_AccessibilityElementInfo* elementInfo, int32_t parentId); /** -* @brief Sets the component type of the accessibility element information. +* @brief Sets the component type for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. * @param componentType Indicates the component type. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoComponentType(ArkUI_AccessibilityElementInfo* elementInfo, const char* componentType); +int32_t OH_ArkUI_AccessibilityElementInfoSetComponentType( + ArkUI_AccessibilityElementInfo* elementInfo, const char* componentType); /** -* @brief Sets the component contents of the accessibility element information. +* @brief Sets the component content for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param contents Indicates the component contents. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param contents Indicates the component content. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoContents(ArkUI_AccessibilityElementInfo* elementInfo, const char* contents); +int32_t OH_ArkUI_AccessibilityElementInfoSetContents( + ArkUI_AccessibilityElementInfo* elementInfo, const char* contents); /** -* @brief Sets the hint text of the accessibility element information. +* @brief Sets the hint text for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. * @param hintText Indicates the hint text. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoHintText(ArkUI_AccessibilityElementInfo* elementInfo, const char* hintText); +int32_t OH_ArkUI_AccessibilityElementInfoSetHintText( + ArkUI_AccessibilityElementInfo* elementInfo, const char* hintText); /** -* @brief Sets the accessibility text of the accessibility element information. +* @brief Sets the accessibility text for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. * @param accessibilityText Indicates the accessibility text. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoAccessibilityText(ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityText); +int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityText( + ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityText); /** -* @brief Sets the accessibility description of the accessibility element information. +* @brief Sets the accessibility description for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. * @param accessibilityDescription Indicates the accessibility description. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoAccessibilityDescription(ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityDescription); +int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityDescription( + ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityDescription); /** -* @brief Sets the child node ids of the accessibility element information. +* @brief Set the number of child nodes and child node IDs for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param childCount Indicates the child count. -* @param childNodeIds Indicates the child node ids. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param childCount Indicates the number of child nodes. +* @param childNodeIds Indicates an array of child node IDs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoChildNodeIds(ArkUI_AccessibilityElementInfo* elementInfo, int32_t childCount, int64_t* childNodeIds); +int32_t OH_ArkUI_AccessibilityElementInfoSetChildNodeIds( + ArkUI_AccessibilityElementInfo* elementInfo, int32_t childCount, int64_t* childNodeIds); /** -* @brief Sets the child count of the accessibility element information. +* @brief Sets the operation actions for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param operationActions Indicates All actions supported by the element. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param operationCount Indicates the operation count. +* @param operationActions Indicates the operation actions. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoOperationActions(ArkUI_AccessibilityElementInfo* elementInfo, int32_t operationCount, ArkUI_AccessibleAction* operationActions); +int32_t OH_ArkUI_AccessibilityElementInfoSetOperationActions(ArkUI_AccessibilityElementInfo* elementInfo, + int32_t operationCount, ArkUI_AccessibleAction* operationActions); /** -* @brief Sets the screen rect of the accessibility element information. +* @brief Sets the screen area for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param screenRect Indicates screen rect. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param screenRect Indicates the screen area. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoScreenRect(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRect* screenRect); +int32_t OH_ArkUI_AccessibilityElementInfoSetScreenRect( + ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRect* screenRect); /** -* @brief Sets the checkable of the accessibility element information. +* @brief Sets whether the element is checkable for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param checkable Indicates checkable. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param checkable Indicates whether the element is checkable. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoCheckable(ArkUI_AccessibilityElementInfo* elementInfo, bool checkable); +int32_t OH_ArkUI_AccessibilityElementInfoSetCheckable( + ArkUI_AccessibilityElementInfo* elementInfo, bool checkable); /** -* @brief Sets the checked of the accessibility element information. +* @brief Sets whether the element is checked for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. * @param checked Indicates whether the element is checked. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoChecked(ArkUI_AccessibilityElementInfo* elementInfo, bool checked); +int32_t OH_ArkUI_AccessibilityElementInfoSetChecked( + ArkUI_AccessibilityElementInfo* elementInfo, bool checked); /** -* @brief Sets the focusable of the accessibility element information. -* @param elementInfo Indicates the pointer to the accessibility element information. +* @brief Sets whether the element is focusable for an ArkUI_AccessibilityElementInfo object. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. * @param focusable Indicates whether the element is focusable. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoFocusable(ArkUI_AccessibilityElementInfo* elementInfo, bool focusable); +int32_t OH_ArkUI_AccessibilityElementInfoSetFocusable( + ArkUI_AccessibilityElementInfo* elementInfo, bool focusable); /** -* @brief Sets the isFocused of the accessibility element information. +* @brief Sets whether the element is focused for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. * @param isFocused Indicates whether the element is focused. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoFocused(ArkUI_AccessibilityElementInfo* elementInfo, bool isFocused); +int32_t OH_ArkUI_AccessibilityElementInfoSetFocused( + ArkUI_AccessibilityElementInfo* elementInfo, bool isFocused); /** -* @brief Sets the isVisible of the accessibility element information. +* @brief Sets whether the element is visible for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. * @param isVisible Indicates whether the element is visible. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoVisible(ArkUI_AccessibilityElementInfo* elementInfo, bool isVisible); +int32_t OH_ArkUI_AccessibilityElementInfoSetVisible( + ArkUI_AccessibilityElementInfo* elementInfo, bool isVisible); /** -* @brief Sets the accessibilityFocused of the accessibility element information. +* @brief Sets the accessibility focus state for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param accessibilityFocused Indicates whether the element is accessibility focused. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param accessibilityFocused Indicates whether the element has accessibility focus. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoAccessibilityFocused(ArkUI_AccessibilityElementInfo* elementInfo, bool accessibilityFocused); +int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityFocused( + ArkUI_AccessibilityElementInfo* elementInfo, bool accessibilityFocused); /** -* @brief Sets the selected of the accessibility element information. +* @brief Sets whether the element is selected for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. * @param selected Indicates whether the element is selected. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoSelected(ArkUI_AccessibilityElementInfo* elementInfo, bool selected); +int32_t OH_ArkUI_AccessibilityElementInfoSetSelected( + ArkUI_AccessibilityElementInfo* elementInfo, bool selected); /** -* @brief Sets the clickable of the accessibility element information. +* @brief Sets whether the element is clickable for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. * @param clickable Indicates whether the element is clickable. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoClickable(ArkUI_AccessibilityElementInfo* elementInfo, bool clickable); +int32_t OH_ArkUI_AccessibilityElementInfoSetClickable( + ArkUI_AccessibilityElementInfo* elementInfo, bool clickable); /** -* @brief Sets the longClickable of the accessibility element information. +* @brief Sets whether the element is long clickable for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. * @param longClickable Indicates whether the element is long clickable. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoLongClickable(ArkUI_AccessibilityElementInfo* elementInfo, bool longClickable); +int32_t OH_ArkUI_AccessibilityElementInfoSetLongClickable( + ArkUI_AccessibilityElementInfo* elementInfo, bool longClickable); /** -* @brief Sets the isEnabled of the accessibility element information. +* @brief Sets whether the element is enabled for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param isEnable Indicates whether the element is enable. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param isEnabled Indicates whether the element is enabled. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoEnabled(ArkUI_AccessibilityElementInfo* elementInfo, bool isEnabled); +int32_t OH_ArkUI_AccessibilityElementInfoSetEnabled( + ArkUI_AccessibilityElementInfo* elementInfo, bool isEnabled); /** -* @brief Sets the isPassword of the accessibility element information. +* @brief Sets whether the element is a password for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. * @param isPassword Indicates whether the element is a password. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoIsPassword(ArkUI_AccessibilityElementInfo* elementInfo, bool isPassword); +int32_t OH_ArkUI_AccessibilityElementInfoSetIsPassword( + ArkUI_AccessibilityElementInfo* elementInfo, bool isPassword); /** -* @brief Sets the scrollable of the accessibility element information. +* @brief Sets whether the element is scrollable for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. * @param scrollable Indicates whether the element is scrollable. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoScrollable(ArkUI_AccessibilityElementInfo* elementInfo, bool scrollable); +int32_t OH_ArkUI_AccessibilityElementInfoSetScrollable( + ArkUI_AccessibilityElementInfo* elementInfo, bool scrollable); /** -* @brief Sets the editable of the accessibility element information. +* @brief Sets whether the element is editable for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. * @param editable Indicates whether the element is editable. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoEditable(ArkUI_AccessibilityElementInfo* elementInfo, bool editable); +int32_t OH_ArkUI_AccessibilityElementInfoSetEditable( + ArkUI_AccessibilityElementInfo* elementInfo, bool editable); /** -* @brief Sets the isHint of the accessibility element information. +* @brief Sets whether the element is a hint for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param isHint Indicates whether the element is in the hint state. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param isHint Indicates whether the element is a hint. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoIsHint(ArkUI_AccessibilityElementInfo* elementInfo, bool isHint); +int32_t OH_ArkUI_AccessibilityElementInfoSetIsHint( + ArkUI_AccessibilityElementInfo* elementInfo, bool isHint); /** -* @brief Sets the rangeInfo of the accessibility element information. +* @brief Sets the range information for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param rangeInfo Indicates element's range info. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param rangeInfo Indicates the range information. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoRangeInfo(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRangeInfo* rangeInfo); +int32_t OH_ArkUI_AccessibilityElementInfoSetRangeInfo( + ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRangeInfo* rangeInfo); /** -* @brief Sets the grid of the accessibility element information. +* @brief Sets the grid information for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param gridInfo Indicates element's grid info. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param gridInfo Indicates the grid information. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoGridInfo(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridInfo* gridInfo); +int32_t OH_ArkUI_AccessibilityElementInfoSetGridInfo( + ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridInfo* gridInfo); /** -* @brief Sets the gridItem of the accessibility element information. +* @brief Sets the grid item for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param gridItem Indicates element's grid item info. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param gridItem Indicates the grid item. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoGridItemInfo(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridItemInfo* gridItem); +int32_t OH_ArkUI_AccessibilityElementInfoSetGridItemInfo( + ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridItemInfo* gridItem); /** -* @brief Sets the textBeginSelected of the accessibility element information. +* @brief Sets the starting index of the selected text for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param textBeginSelected Indicates the start position of the selection. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param selectedTextStart Indicates the starting index of the selected text +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoTextBeginSelected(ArkUI_AccessibilityElementInfo* elementInfo, int32_t textBeginSelected); +int32_t OH_ArkUI_AccessibilityElementInfoSetSelectedTextStart( + ArkUI_AccessibilityElementInfo* elementInfo, int32_t selectedTextStart); /** -* @brief Sets the textEndSelected of the accessibility element information. +* @brief Sets the end index of the selected text for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param textEndSelected Indicates the end position of the selection. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param selectedTextEnd Indicates the end index of the selected text +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoTextEndSelected(ArkUI_AccessibilityElementInfo* elementInfo, int32_t textEndSelected); +int32_t OH_ArkUI_AccessibilityElementInfoSetSelectedTextEnd( + ArkUI_AccessibilityElementInfo* elementInfo, int32_t selectedTextEnd); /** -* @brief Sets the currentItemIndex of the accessibility element information. +* @brief Sets the index of the currently selected item for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param currentItemIndex Indicates index of the current item. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param currentItemIndex Indicates the index of the currently selected item. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoCurrentItemIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t currentItemIndex); +int32_t OH_ArkUI_AccessibilityElementInfoSetCurrentItemIndex( + ArkUI_AccessibilityElementInfo* elementInfo, int32_t currentItemIndex); /** -* @brief Sets the beginItemIndex of the accessibility element information. +* @brief Sets the index of the first item for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param beginItemIndex Indicates index of the begin item. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param startItemIndex Indicates the index of the first item. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoBeginItemIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t beginItemIndex); +int32_t OH_ArkUI_AccessibilityElementInfoSetStartItemIndex( + ArkUI_AccessibilityElementInfo* elementInfo, int32_t startItemIndex); /** -* @brief Sets the endItemIndex of the accessibility element information. +* @brief Sets the index of the last item for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param endItemIndex Indicates index of the end item. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param endItemIndex Indicates the index of the last item. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoEndItemIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t endItemIndex); +int32_t OH_ArkUI_AccessibilityElementInfoSetEndItemIndex( + ArkUI_AccessibilityElementInfo* elementInfo, int32_t endItemIndex); /** -* @brief Sets the itemCount of the accessibility element information. +* @brief Sets the number of items for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param itemCount Indicates total number of items. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param itemCount Indicates the number of items. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoItemCount(ArkUI_AccessibilityElementInfo* elementInfo, int32_t itemCount); +int32_t OH_ArkUI_AccessibilityElementInfoSetItemCount( + ArkUI_AccessibilityElementInfo* elementInfo, int32_t itemCount); /** -* @brief Sets the offset of the accessibility element information. +* @brief Sets the offset for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param offset Indicates pixel offset for scrolling relative to the top coordinate of the element. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param offset Indicates the scroll pixel offset relative to the top of the element. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoAccessibilityOffset(ArkUI_AccessibilityElementInfo* elementInfo, int32_t offset); +int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityOffset( + ArkUI_AccessibilityElementInfo* elementInfo, int32_t offset); /** -* @brief Sets the accessibilityGroup of the accessibility element information. +* @brief Sets the accessibility group for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param accessibilityGroup Indicates accessibility group. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param accessibilityGroup Indicates the accessibility group. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoAccessibilityGroup(ArkUI_AccessibilityElementInfo* elementInfo, bool accessibilityGroup); +int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityGroup( + ArkUI_AccessibilityElementInfo* elementInfo, bool accessibilityGroup); /** -* @brief Sets the accessibilityLevel of the accessibility element information. +* @brief Sets the accessibility level for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param accessibilityLevel Indicates accessibility level. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param accessibilityLevel Indicates the accessibility level. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoAccessibilityLevel(ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityLevel); +int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityLevel( + ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityLevel); /** -* @brief Sets the zIndex of the accessibility element information. +* @brief Sets the z-index for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param zIndex Indicates z index. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param zIndex Indicates the z-index value. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoZIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t zIndex); +int32_t OH_ArkUI_AccessibilityElementInfoSetZIndex( + ArkUI_AccessibilityElementInfo* elementInfo, int32_t zIndex); /** -* @brief Sets the opacity of the accessibility element information. +* @brief Sets the opacity for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param opacity Indicates opacity. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param opacity Indicates the opacity. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoAccessibilityOpacity(ArkUI_AccessibilityElementInfo* elementInfo, float opacity); +int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityOpacity( + ArkUI_AccessibilityElementInfo* elementInfo, float opacity); /** -* @brief Sets the backgroundColor of the accessibility element information. +* @brief Sets the background color for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param backgroundColor Indicates background color. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param backgroundColor Indicates the background color. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoBackgroundColor(ArkUI_AccessibilityElementInfo* elementInfo, const char* backgroundColor); +int32_t OH_ArkUI_AccessibilityElementInfoSetBackgroundColor( + ArkUI_AccessibilityElementInfo* elementInfo, const char* backgroundColor); /** -* @brief Sets the backgroundImage of the accessibility element information. +* @brief Sets the background image for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param backgroundImage Indicates background image. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param backgroundImage Indicates the backgroundImage. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoBackgroundImage(ArkUI_AccessibilityElementInfo* elementInfo, const char* backgroundImage); +int32_t OH_ArkUI_AccessibilityElementInfoSetBackgroundImage( + ArkUI_AccessibilityElementInfo* elementInfo, const char* backgroundImage); /** -* @brief Sets the blur of the accessibility element information. +* @brief Sets the blur effect for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param blur Indicates blur. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param blur Indicates the blur effect. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoBlur(ArkUI_AccessibilityElementInfo* elementInfo, const char* blur); +int32_t OH_ArkUI_AccessibilityElementInfoSetBlur( + ArkUI_AccessibilityElementInfo* elementInfo, const char* blur); /** -* @brief Sets the hitTestBehavior of the accessibility element information. +* @brief Sets the hit test behavior for an ArkUI_AccessibilityElementInfo object. * -* @param elementInfo Indicates the pointer to the accessibility element information. -* @param hitTestBehavior Indicates hitTest behavior. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @param hitTestBehavior Indicates the hit test behavior. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityElementInfoHitTestBehavior(ArkUI_AccessibilityElementInfo* elementInfo, const char* hitTestBehavior); +int32_t OH_ArkUI_AccessibilityElementInfoSetHitTestBehavior( + ArkUI_AccessibilityElementInfo* elementInfo, const char* hitTestBehavior); /** - * @brief Create an accessibility elementInfo. + * @brief Creates an ArkUI_AccessibilityElementInfo object. * - * @return Returns the pointer to the accessibility elementInfo. + * @return Returns the ArkUI_AccessibilityElementInfo object, or NULL if it fails to create. + * The possible reason for failure is that the memory error occurred during object creation. * @since 13 * @version 1.0 */ ArkUI_AccessibilityElementInfo* OH_ArkUI_CreateAccessibilityElementInfo(void); /** - * @brief Destorys an accessibility elementInfo. + * @brief Destroys an ArkUI_AccessibilityElementInfo object. * - * @param elementInfo Indicates the pointer to to the accessibility elementInfo info to be destoryed. + * @param elementInfo Indicates the pointer to the ArkUI_AccessibilityElementInfo object to destroy. * @since 13 * @version 1.0 */ void OH_ArkUI_DestoryAccessibilityElementInfo(ArkUI_AccessibilityElementInfo* elementInfo); /** - * @brief Create an accessibility eventInfo. + * @brief Creates an ArkUI_AccessibilityEventInfo object. * - * @return Returns the pointer to the accessibility event info. + * @return Returns the ArkUI_AccessibilityEventInfo object, or NULL if it fails to create. + * The possible reason for failure is that the memory error occurred during object creation. * @since 13 - * @version 1.0 */ ArkUI_AccessibilityEventInfo* OH_ArkUI_CreateAccessibilityEventInfo(void); /** - * @brief Destorys an accessibility eventInfo. + * @brief Destroys an ArkUI_AccessibilityEventInfo object. * - * @param eventInfo Indicates the pointer to to the accessibility event info to be destoryed. + * @param eventInfo Indicates the pointer to the ArkUI_AccessibilityEventInfo object to destroy. * @since 13 - * @version 1.0 */ void OH_ArkUI_DestoryAccessibilityEventInfo(ArkUI_AccessibilityEventInfo* eventInfo); /** -* @brief Sets the eventType of the accessibility event information. +* @brief Sets the event type for an ArkUI_AccessibilityEventInfo object. * -* @param eventInfo Indicates the pointer to the accessibility event information. -* @param eventType Indicates event type. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param eventInfo Indicates the pointer to an ArkUI_AccessibilityEventInfo object. +* @param eventType Indicates the event type. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityEventEventType(ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityEventType eventType); +int32_t OH_ArkUI_AccessibilityEventSetEventType( + ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityEventType eventType); /** -* @brief Sets the textAnnouncedForAccessibility of the accessibility event information. +* @brief Sets the text announced for accessibility for an ArkUI_AccessibilityEventInfo object. * -* @param eventInfo Indicates the pointer to the accessibility event information. -* @param textAnnouncedForAccessibility Indicates text announced for accessibility. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param eventInfo Indicates the pointer to an ArkUI_AccessibilityEventInfo object. +* @param textAnnouncedForAccessibility Indicates the text announced for accessibility. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityEventTextAnnouncedForAccessibility(ArkUI_AccessibilityEventInfo* eventInfo, const char* textAnnouncedForAccessibility); +int32_t OH_ArkUI_AccessibilityEventSetTextAnnouncedForAccessibility( + ArkUI_AccessibilityEventInfo* eventInfo, const char* textAnnouncedForAccessibility); /** -* @brief Sets the requestFocusId of the accessibility event information. +* @brief Sets the request focus ID for an ArkUI_AccessibilityEventInfo object. * -* @param eventInfo Indicates the pointer to the accessibility event information. -* @param requestFocusId Indicates ID of the request for active focus. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param eventInfo Indicates the pointer to an ArkUI_AccessibilityEventInfo object. +* @param requestFocusId Indicates the request focus ID. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityEventRequestFocusId(ArkUI_AccessibilityEventInfo* eventInfo, int32_t requestFocusId); +int32_t OH_ArkUI_AccessibilityEventSetRequestFocusId( + ArkUI_AccessibilityEventInfo* eventInfo, int32_t requestFocusId); /** -* @brief Sets the elementInfo of the accessibility event information. +* @brief Sets the element information for an ArkUI_AccessibilityEventInfo object. * -* @param eventInfo Indicates the pointer to the accessibility event information. -* @param elementInfo Indicates element Info. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param eventInfo Indicates the pointer to an ArkUI_AccessibilityEventInfo object. +* @param elementInfo Indicates the pointer to an ArkUI_AccessibilityElementInfo object. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_SetAccessibilityEventElementInfo(ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityElementInfo* elementInfo); +int32_t OH_ArkUI_AccessibilityEventSetElementInfo( + ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityElementInfo* elementInfo); /** -* @brief Gets the value of the accessibility action argument by key. +* @brief Obtains the value of a key from an ArkUI_AccessibilityActionArguments object. * -* @param arguments Indicates the pointer to the accessibility action arguments. -* @param key Indicates key. -* @param value Indicates value. -* @return Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_SUCCESS} if success. -* Returns {@link OH_ARKUI_ACCESSIBILITY_RESULT_BAD_PARAMETER} if a parameter exception occurs. +* @param arguments Indicates the pointer to an ArkUI_AccessibilityActionArguments object. +* @param key Indicates the key. +* @param value Indicates the value. +* @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. +* Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. * @since 13 */ -int32_t OH_ArkUI_FindAccessibilityActionArgumentByKey(ArkUI_AccessibilityActionArguments* arguments, const char* key, char** value); +int32_t OH_ArkUI_FindAccessibilityActionArgumentByKey( + ArkUI_AccessibilityActionArguments* arguments, const char* key, char** value); #ifdef __cplusplus }; #endif diff --git a/arkui/ace_engine/native/native_interface_xcomponent.h b/arkui/ace_engine/native/native_interface_xcomponent.h index ae0edc011..0dbaa75af 100644 --- a/arkui/ace_engine/native/native_interface_xcomponent.h +++ b/arkui/ace_engine/native/native_interface_xcomponent.h @@ -817,13 +817,14 @@ int32_t OH_NativeXComponent_GetTouchEventSourceType( OH_NativeXComponent* OH_NativeXComponent_GetNativeXComponent(ArkUI_NodeHandle node); /** - * @brief Obtains the accessibility handle by the ArkUI XComponent. + * @brief Obtains the pointer to the ArkUI_AccessibilityProvider + * instance of this OH_NativeXComponent instance. * - * @param component Indicates the pointer to this OH_NativeXComponent instance. - * @param provider Indicates the pointer to pointer of ArkUI_AccessibilityProvider instance. - * @return Returns the status code of the execution. + * @param component Indicates the pointer to the OH_NativeXComponent instance. + * @param handle Indicates the pointer to the ArkUI_AccessibilityProvider instance. + * @return Returns {@link OH_NATIVEXCOMPONENT_RESULT_SUCCESS} if the operation is successful. + * Returns {@link OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER} if a parameter error occurs. * @since 13 - * @version 1.0 */ int32_t OH_NativeXComponent_GetNativeAccessibilityProvider( OH_NativeXComponent* component, ArkUI_AccessibilityProvider** handle); -- Gitee From 0a8044d4ddc269bbe5fd81212eed330b509e84ae Mon Sep 17 00:00:00 2001 From: ccfriend Date: Thu, 5 Sep 2024 22:43:53 +0800 Subject: [PATCH 245/620] remove unused interface Signed-off-by: ccfriend --- multimedia/av_session/libohavsession.ndk.json | 24 ----- multimedia/av_session/native_avsession.h | 96 ------------------- 2 files changed, 120 deletions(-) diff --git a/multimedia/av_session/libohavsession.ndk.json b/multimedia/av_session/libohavsession.ndk.json index 6438cd5e6..a87d19b90 100644 --- a/multimedia/av_session/libohavsession.ndk.json +++ b/multimedia/av_session/libohavsession.ndk.json @@ -35,14 +35,6 @@ "first_introduced": "13", "name":"OH_AVSession_SetPlaybackPosition" }, - { - "first_introduced": "13", - "name":"OH_AVSession_SetBufferedTime" - }, - { - "first_introduced": "13", - "name":"OH_AVSession_SetSpeed" - }, { "first_introduced": "13", "name":"OH_AVSession_SetFavorite" @@ -83,14 +75,6 @@ "first_introduced": "13", "name":"OH_AVSession_UnRegisterSeekCallback" }, - { - "first_introduced": "13", - "name":"OH_AVSession_RegisterSpeedCallback" - }, - { - "first_introduced": "13", - "name":"OH_AVSession_UnRegisterSpeedCallback" - }, { "first_introduced": "13", "name":"OH_AVSession_RegisterSetLoopModeCallback" @@ -107,14 +91,6 @@ "first_introduced": "13", "name":"OH_AVSession_UnRegisterToggleFavoriteCallback" }, - { - "first_introduced": "13", - "name":"OH_AVSession_RegisterPlayFromAssetIdCallback" - }, - { - "first_introduced": "13", - "name":"OH_AVSession_UnRegisterPlayFromAssetIdCallback" - }, { "first_introduced": "13", "name": "OH_AVMetadataBuilder_Create" diff --git a/multimedia/av_session/native_avsession.h b/multimedia/av_session/native_avsession.h index 2c6d9908f..caab9f203 100644 --- a/multimedia/av_session/native_avsession.h +++ b/multimedia/av_session/native_avsession.h @@ -299,15 +299,6 @@ typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnRewind)(OH_AVSession* typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnSeek)(OH_AVSession* session, uint64_t seekTime, void* userData); -/** - * @brief Declaring the callback struct for set speed command - * - * @since 13 - * @version 1.0 - */ -typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnSetSpeed)(OH_AVSession* session, - uint32_t speed, void* userData); - /** * @brief Declaring the callback struct for set loop mode command * @@ -326,15 +317,6 @@ typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnSetLoopMode)(OH_AVSess typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnToggleFavorite)(OH_AVSession* session, const char* assetId, void* userData); -/** - * @brief Declaring the callback struct for play from assetid command - * - * @since 13 - * @version 1.0 - */ -typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnPlayFromAssetId)(OH_AVSession* session, - const char* assetId, void* userData); - /** * @brief Request to create the avsession. * @@ -449,30 +431,6 @@ AVSession_ErrCode OH_AVSession_SetPlaybackState(OH_AVSession* avsession, AVSession_ErrCode OH_AVSession_SetPlaybackPosition(OH_AVSession* avsession, AVSession_PlaybackPosition* playbackPosition); -/** - * @brief Request to set buffered time. - * - * @param avsession The avsession instance pointer - * @param bufferedTime The bufferedTime to set - * @return Function result code: - * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. - * @since 13 - */ -AVSession_ErrCode OH_AVSession_SetBufferedTime(OH_AVSession* avsession, uint64_t bufferedTime); - -/** - * @brief Request to set speed. - * - * @param avsession The avsession instance pointer - * @param speed The speed to set - * @return Function result code: - * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. - * @since 13 - */ -AVSession_ErrCode OH_AVSession_SetSpeed(OH_AVSession* avsession, uint32_t speed); - /** * @brief Request to set favorite state. * @@ -609,33 +567,6 @@ AVSession_ErrCode OH_AVSession_RegisterSeekCallback(OH_AVSession* avsession, AVSession_ErrCode OH_AVSession_UnregisterSeekCallback(OH_AVSession* avsession, OH_AVSessionCallback_OnSeek callback); -/** - * @brief Request to register set speed callback. - * - * @param avsession The avsession instance pointer - * @param callback the {@link OH_AVSessionCallback_OnSetSpeed} to be registered. - * @param userData User data which is passed by user. - * @return Function result code: - * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. - * @since 13 - */ -AVSession_ErrCode OH_AVSession_RegisterSpeedCallback(OH_AVSession* avsession, - OH_AVSessionCallback_OnSetSpeed callback, void* userData); - -/** - * @brief Request to unregister set speed callback. - * - * @param avsession The avsession instance pointer - * @param callback the {@link OH_AVSessionCallback_OnSetSpeed} to be unregistered. - * @return Function result code: - * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. - * @since 13 - */ -AVSession_ErrCode OH_AVSession_UnregisterSpeedCallback(OH_AVSession* avsession, - OH_AVSessionCallback_OnSetSpeed callback); - /** * @brief Request to register set loopmode callback. * @@ -690,33 +621,6 @@ AVSession_ErrCode OH_AVSession_RegisterToggleFavoriteCallback(OH_AVSession* avse AVSession_ErrCode OH_AVSession_UnregisterToggleFavoriteCallback(OH_AVSession* avsession, OH_AVSessionCallback_OnToggleFavorite callback); -/** - * @brief Request to register play from aseetid callback. - * - * @param avsession The avsession instance pointer - * @param callback the {@link OH_AVSessionCallback_OnPlayFromAssetId} to be registered. - * @param userData User data which is passed by user. - * @return Function result code: - * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. - * @since 13 - */ -AVSession_ErrCode OH_AVSession_RegisterPlayFromAssetIdCallback(OH_AVSession* avsession, - OH_AVSessionCallback_OnPlayFromAssetId callback, void* userData); - -/** - * @brief Request to unregister play from aseetid callback. - * - * @param avsession The avsession instance pointer - * @param callback the {@link OH_AVSessionCallback_OnPlayFromAssetId} to be unregistered. - * @return Function result code: - * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. - * @since 13 - */ -AVSession_ErrCode OH_AVSession_UnregisterPlayFromAssetIdCallback(OH_AVSession* avsession, - OH_AVSessionCallback_OnPlayFromAssetId callback); - #ifdef __cplusplus } #endif -- Gitee From a75e323d9e2a49452aa9d0386c80aeca6083e0a1 Mon Sep 17 00:00:00 2001 From: shanhaiyang Date: Thu, 5 Sep 2024 23:19:43 +0800 Subject: [PATCH 246/620] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BE=AE=E4=BF=A1ndk?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shanhaiyang --- BasicServicesKit/ohprint.ndk.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BasicServicesKit/ohprint.ndk.json b/BasicServicesKit/ohprint.ndk.json index 8d2491d0f..e4e54c4fd 100644 --- a/BasicServicesKit/ohprint.ndk.json +++ b/BasicServicesKit/ohprint.ndk.json @@ -66,5 +66,9 @@ { "first_introduced": "12", "name": "OH_Print_RestorePrinterProperties" + }, + { + "first_introduced": "13", + "name": "OH_Print_StartPrintByNative" } ] -- Gitee From 5dca68614956ec8d53f2212d423569836ea0a633 Mon Sep 17 00:00:00 2001 From: HYH Date: Fri, 6 Sep 2024 01:10:21 +0000 Subject: [PATCH 247/620] update multimodalinput/kits/c/ohinput.ndk.json. 1 Signed-off-by: HYH --- multimodalinput/kits/c/ohinput.ndk.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/multimodalinput/kits/c/ohinput.ndk.json b/multimodalinput/kits/c/ohinput.ndk.json index 4e5accf18..0a906be71 100644 --- a/multimodalinput/kits/c/ohinput.ndk.json +++ b/multimodalinput/kits/c/ohinput.ndk.json @@ -370,6 +370,9 @@ { "first_introduced": "13", "name": "OH_Input_GetRepeat" + }, + { + "first_introduced": "13", "name": "OH_Input_GetDeviceIds" }, { -- Gitee From 958988b15e25312c31f76674b545bc051d467fb1 Mon Sep 17 00:00:00 2001 From: cuile4 Date: Fri, 6 Sep 2024 09:41:31 +0800 Subject: [PATCH 248/620] Add ndk interface of udmf into ndk json. > Signed-off-by: cuile4 --- distributeddatamgr/udmf/libudmf.ndk.json | 124 +++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/distributeddatamgr/udmf/libudmf.ndk.json b/distributeddatamgr/udmf/libudmf.ndk.json index 6011e71c0..fc246ae6d 100644 --- a/distributeddatamgr/udmf/libudmf.ndk.json +++ b/distributeddatamgr/udmf/libudmf.ndk.json @@ -334,5 +334,129 @@ { "first_introduced": "12", "name": "OH_Udmf_SetUnifiedData" + }, + { + "first_introduced": "13", + "name": "OH_UdmfRecordProvider_Create" + }, + { + "first_introduced": "13", + "name": "OH_UdmfRecordProvider_Destroy" + }, + { + "first_introduced": "13", + "name": "OH_UdmfRecordProvider_SetData" + }, + { + "first_introduced": "13", + "name": "OH_UdmfRecord_AddFileUri" + }, + { + "first_introduced": "13", + "name": "OH_UdmfRecord_AddPixelMap" + }, + { + "first_introduced": "13", + "name": "OH_UdmfRecord_AddArrayBuffer" + }, + { + "first_introduced": "13", + "name": "OH_UdmfRecord_SetProvider" + }, + { + "first_introduced": "13", + "name": "OH_UdmfRecord_GetFileUri" + }, + { + "first_introduced": "13", + "name": "OH_UdmfRecord_GetPixelMap" + }, + { + "first_introduced": "13", + "name": "OH_UdmfRecord_GetArrayBuffer" + }, + { + "first_introduced": "13", + "name": "OH_UdmfData_GetPrimaryPlainText" + }, + { + "first_introduced": "13", + "name": "OH_UdmfData_GetPrimaryHtml" + }, + { + "first_introduced": "13", + "name": "OH_UdmfData_GetRecordCount" + }, + { + "first_introduced": "13", + "name": "OH_UdmfData_GetRecord" + }, + { + "first_introduced": "13", + "name": "OH_UdmfData_IsLocal" + }, + { + "first_introduced": "13", + "name": "OH_UdsFileUri_Create" + }, + { + "first_introduced": "13", + "name": "OH_UdsFileUri_Destroy" + }, + { + "first_introduced": "13", + "name": "OH_UdsFileUri_GetType" + }, + { + "first_introduced": "13", + "name": "OH_UdsFileUri_GetFileUri" + }, + { + "first_introduced": "13", + "name": "OH_UdsFileUri_GetFileType" + }, + { + "first_introduced": "13", + "name": "OH_UdsFileUri_SetFileUri" + }, + { + "first_introduced": "13", + "name": "OH_UdsFileUri_SetFileType" + }, + { + "first_introduced": "13", + "name": "OH_UdsPixelMap_Create" + }, + { + "first_introduced": "13", + "name": "OH_UdsPixelMap_Destroy" + }, + { + "first_introduced": "13", + "name": "OH_UdsPixelMap_GetType" + }, + { + "first_introduced": "13", + "name": "OH_UdsPixelMap_GetPixelMap" + }, + { + "first_introduced": "13", + "name": "OH_UdsPixelMap_SetPixelMap" + }, + { + "first_introduced": "13", + "name": "OH_UdsArrayBuffer_Create" + }, + { + "first_introduced": "13", + "name": "OH_UdsArrayBuffer_Destroy" + }, + { + "first_introduced": "13", + "name": "OH_UdsArrayBuffer_SetData" + }, + { + "first_introduced": "13", + "name": "OH_UdsArrayBuffer_GetData" } ] \ No newline at end of file -- Gitee From acb06a3c877dd9bed7679d9c698dd18ebb70e439 Mon Sep 17 00:00:00 2001 From: jiang-qunchao Date: Fri, 6 Sep 2024 10:16:25 +0800 Subject: [PATCH 249/620] add some JSVM function's result code Signed-off-by: jiang-qunchao --- ark_runtime/jsvm/jsvm.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ark_runtime/jsvm/jsvm.h b/ark_runtime/jsvm/jsvm.h index 0d9fa9ad1..3f47366b4 100644 --- a/ark_runtime/jsvm/jsvm.h +++ b/ark_runtime/jsvm/jsvm.h @@ -2839,7 +2839,9 @@ JSVM_Status JSVM_CDECL OH_JSVM_IsConstructor(JSVM_Env env, * @return Only returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n - * {@link JSVM_PENDING_EXCPTION } If the API throws an exception during runtime.\n + * {@link JSVM_STRING_EXPECTED } If the value of 'value' is not a string.\n + * {@link JSVM_GENERIC_FAILURE } If create RegExp failed.\n + * {@link JSVM_PENDING_EXCEPTION } If the API throws an exception during runtime.\n * @since 12 */ JSVM_Status JSVM_CDECL OH_JSVM_CreateRegExp(JSVM_Env env, -- Gitee From b32e38272e6825751286b65e1d6b42a5e836e2af Mon Sep 17 00:00:00 2001 From: ccfriend Date: Fri, 6 Sep 2024 11:39:39 +0800 Subject: [PATCH 250/620] modify json config Signed-off-by: ccfriend --- multimedia/av_session/libohavsession.ndk.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/av_session/libohavsession.ndk.json b/multimedia/av_session/libohavsession.ndk.json index 6438cd5e6..a410da167 100644 --- a/multimedia/av_session/libohavsession.ndk.json +++ b/multimedia/av_session/libohavsession.ndk.json @@ -161,7 +161,7 @@ }, { "first_introduced": "13", - "name": "OH_AVMetadataBuilder_SetSubTitle" + "name": "OH_AVMetadataBuilder_SetSubtitle" }, { "first_introduced": "13", -- Gitee From 885bf4bd2d112b6b2dd972d691ebad923f37a6a7 Mon Sep 17 00:00:00 2001 From: liushang Date: Fri, 6 Sep 2024 13:41:51 +0800 Subject: [PATCH 251/620] fix colorspaceinfo Signed-off-by: liushang --- multimedia/video_processing_engine/image_processing_types.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index 5f9562325..f05531332 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -148,11 +148,11 @@ extern const char* IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL; * @since 13 */ typedef struct ImageProcessing_ColorSpaceInfo { - /** define metadata type */ + /** define metadata type, {@link enum OH_Pixelmap_HdrMetadataKey} */ int32_t metadataType; - /** define color space, {@link enum OH_NativeBuffer_ColorSpace} */ + /** define color space */ int32_t colorSpace; - /** define pixel format, {@link enum OH_NativeBuffer_Format} */ + /** define pixel format, {@link enum PIXEL_FORMAT} */ int32_t pixelFormat; } ImageProcessing_ColorSpaceInfo; -- Gitee From b127c20d2d73811a0d8802f91f785ad2d0b2786b Mon Sep 17 00:00:00 2001 From: liu-binjun Date: Thu, 5 Sep 2024 19:44:29 +0800 Subject: [PATCH 252/620] bugfix:add userData Signed-off-by: liu-binjun --- LocationKit/liblocation.ndk.json | 3 +++ LocationKit/oh_location.h | 22 +++++++++------------- LocationKit/oh_location_type.h | 26 +++++++++++++++++++++----- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/LocationKit/liblocation.ndk.json b/LocationKit/liblocation.ndk.json index 82814ba00..181ff9dc1 100644 --- a/LocationKit/liblocation.ndk.json +++ b/LocationKit/liblocation.ndk.json @@ -28,5 +28,8 @@ }, { "name": "OH_LocationRequestConfig_SetInterval" + }, + { + "name": "OH_LocationRequestConfig_SetCallback" } ] \ No newline at end of file diff --git a/LocationKit/oh_location.h b/LocationKit/oh_location.h index d99c30c8c..b4d3bbc5c 100644 --- a/LocationKit/oh_location.h +++ b/LocationKit/oh_location.h @@ -60,13 +60,10 @@ Location_ResultCode OH_Location_IsLocatingEnabled(bool* enabled); * @param requestConfig - Pointer to the locating request parameters.\n * For details, see {@link Location_RequestConfig}.\n * You can use {@link OH_Location_CreateRequestConfig} to create an instance.\n - * @param callback - Pointer to the callback function for reporting the location.\n - * For details, see {@link Location_InfoCallback}.\n - * A non-null pointer is required, otherwise an error is returned.\n * @return Location functions result code.\n * For a detailed definition, please refer to {@link Location_ResultCode}.\n * {@link LOCAION_SUCCESS} Successfully start locating.\n - * {@link LOCATION_INVALID_PARAM} The input parameter requestConfig or callback is a null pointer.\n + * {@link LOCATION_INVALID_PARAM} The input parameter requestConfig is a null pointer.\n * {@link LOCATION_PERMISSION_DENIED} Permission verification failed. The application does not have the\n * permission required to call the API.\n * {@link LOCATION_NOT_SUPPORTED} Capability not supported.\n @@ -76,21 +73,20 @@ Location_ResultCode OH_Location_IsLocatingEnabled(bool* enabled); * @permission ohos.permission.APPROXIMATELY_LOCATION * @since 13 */ -Location_ResultCode OH_Location_StartLocating(const Location_RequestConfig* requestConfig, - Location_InfoCallback callback); +Location_ResultCode OH_Location_StartLocating(const Location_RequestConfig* requestConfig); /** * @brief Stop locating and unsubscribe location changed. * - * @param callback - Pointer to the callback function for reporting the location.\n - * This parameter needs to be the same as the callback pointer passed in {@link OH_Location_StartLocating}.\n - * For details, see {@link Location_InfoCallback}.\n - * A non-null pointer is required, otherwise an error is returned.\n + * @param requestConfig - Pointer to the locating request parameters.\n + * For details, see {@link Location_RequestConfig}.\n + * This parameter needs to be the same as the requestConfig pointer passed in\n + * {@link OH_Location_StartLocating}.\n * @return Location functions result code.\n * For a detailed definition, please refer to {@link Location_ResultCode}.\n * {@link LOCAION_SUCCESS} Successfully stop locationg.\n - * {@link LOCATION_INVALID_PARAM} 1.The input parameter callback is a null pointer. - * 2.Different from the callback passed from {@link OH_Location_StartLocating}.\n + * {@link LOCATION_INVALID_PARAM} 1.The input parameter is a null pointer.\n + * 2.Different from the requestConfig pointer passed from {@link OH_Location_StartLocating}.\n * {@link LOCATION_PERMISSION_DENIED} Permission verification failed. The application does not have the\n * permission required to call the API.\n * {@link LOCATION_NOT_SUPPORTED} Capability not supported.\n @@ -100,7 +96,7 @@ Location_ResultCode OH_Location_StartLocating(const Location_RequestConfig* requ * @permission ohos.permission.APPROXIMATELY_LOCATION * @since 13 */ -Location_ResultCode OH_Location_StopLocating(Location_InfoCallback callback); +Location_ResultCode OH_Location_StopLocating(const Location_RequestConfig* requestConfig); #ifdef __cplusplus } #endif diff --git a/LocationKit/oh_location_type.h b/LocationKit/oh_location_type.h index 8a376cda2..235c436ff 100644 --- a/LocationKit/oh_location_type.h +++ b/LocationKit/oh_location_type.h @@ -270,6 +270,18 @@ Location_BasicInfo OH_LocationInfo_GetBasicInfo(Location_Info* location); Location_ResultCode OH_LocationInfo_GetAdditionalInfo(Location_Info* location, char* additionalInfo, uint32_t length); +/** + * @brief Defines the callback function used to report location data. + * + * @param location - Pointer to the {@link Location_Info} instance. Carry the latest location information.\n + * The memory of the location instance is recycled at the end of {@link Location_InfoCallback}.\n + * Before that, call {@link OH_LocationInfo_GetBasicInfo} and other interfaces to obtain location information.\n + * @param userData - Pointer to an application data structure, this parameter is passed in\n + * through {@link OH_LocationRequestConfig_SetCallback}.\n + * @since 13 + */ +typedef void (*Location_InfoCallback)(Location_Info* location, void* userData); + /** * @brief Define the structure of location request parameters. * @since 13 @@ -341,14 +353,18 @@ void OH_LocationRequestConfig_SetInterval(Location_RequestConfig* requestConfig, int interval); /** - * @brief Defines the callback function used to report location data. + * @brief Set up a callback function for receiving location information. * - * @param location - Pointer to the {@link Location_Info} instance. Carry the latest location information.\n - * The memory of the location instance is recycled at the end of {@link Location_InfoCallback}.\n - * Before that, call {@link OH_LocationInfo_GetBasicInfo} and other interfaces to obtain location information.\n + * @param requestConfig - Pointer to the {@link Location_RequestConfig} instance.\n + * The instance was created by {@link OH_Location_CreateRequestConfig}.\n + * @param callback - Pointer to the callback function for receiving the location.\n + * For details, see {@link Location_InfoCallback}.\n + * @param userData - Pointer to the application data structure, which will be\n + * carried in the callback function.\n * @since 13 */ -typedef void (*Location_InfoCallback)(Location_Info* location); +void OH_LocationRequestConfig_SetCallback(Location_RequestConfig* requestConfig, + Location_InfoCallback callback, void* userData); #ifdef __cplusplus } #endif -- Gitee From b0d5f1f604f823a03e64f16ac24605eb6430a3b5 Mon Sep 17 00:00:00 2001 From: ccfriend Date: Fri, 6 Sep 2024 18:16:29 +0800 Subject: [PATCH 253/620] modify json config name Signed-off-by: ccfriend --- multimedia/av_session/libohavsession.ndk.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/multimedia/av_session/libohavsession.ndk.json b/multimedia/av_session/libohavsession.ndk.json index a410da167..bb1890b89 100644 --- a/multimedia/av_session/libohavsession.ndk.json +++ b/multimedia/av_session/libohavsession.ndk.json @@ -57,7 +57,7 @@ }, { "first_introduced": "13", - "name":"OH_AVSession_UnRegisterCommandCallback" + "name":"OH_AVSession_UnregisterCommandCallback" }, { "first_introduced": "13", @@ -65,7 +65,7 @@ }, { "first_introduced": "13", - "name":"OH_AVSession_UnRegisterForwardCallback" + "name":"OH_AVSession_UnregisterForwardCallback" }, { "first_introduced": "13", @@ -73,7 +73,7 @@ }, { "first_introduced": "13", - "name":"OH_AVSession_UnRegisterRewindCallback" + "name":"OH_AVSession_UnregisterRewindCallback" }, { "first_introduced": "13", @@ -81,7 +81,7 @@ }, { "first_introduced": "13", - "name":"OH_AVSession_UnRegisterSeekCallback" + "name":"OH_AVSession_UnregisterSeekCallback" }, { "first_introduced": "13", @@ -89,7 +89,7 @@ }, { "first_introduced": "13", - "name":"OH_AVSession_UnRegisterSpeedCallback" + "name":"OH_AVSession_UnregisterSpeedCallback" }, { "first_introduced": "13", @@ -97,7 +97,7 @@ }, { "first_introduced": "13", - "name":"OH_AVSession_UnRegisterSetLoopModeCallback" + "name":"OH_AVSession_UnregisterSetLoopModeCallback" }, { "first_introduced": "13", @@ -105,7 +105,7 @@ }, { "first_introduced": "13", - "name":"OH_AVSession_UnRegisterToggleFavoriteCallback" + "name":"OH_AVSession_UnregisterToggleFavoriteCallback" }, { "first_introduced": "13", @@ -113,7 +113,7 @@ }, { "first_introduced": "13", - "name":"OH_AVSession_UnRegisterPlayFromAssetIdCallback" + "name":"OH_AVSession_UnregisterPlayFromAssetIdCallback" }, { "first_introduced": "13", -- Gitee From f22f09ce25df2d113f8d6b2a65d4ba09a514fc4f Mon Sep 17 00:00:00 2001 From: zwtmichael Date: Wed, 4 Sep 2024 15:56:46 +0800 Subject: [PATCH 254/620] modify build gn file name Signed-off-by: zwtmichael --- distributeddatamgr/preferences/BUILD.gn | 10 +++++----- .../preferences/include/oh_preferences.h | 3 ++- .../preferences/include/oh_preferences_option.h | 2 +- .../preferences/include/oh_preferences_value.h | 3 ++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/distributeddatamgr/preferences/BUILD.gn b/distributeddatamgr/preferences/BUILD.gn index 90671c646..77c03331c 100644 --- a/distributeddatamgr/preferences/BUILD.gn +++ b/distributeddatamgr/preferences/BUILD.gn @@ -21,7 +21,7 @@ ohos_ndk_headers("preferences_ndk_header") { "./include/oh_preferences.h", "./include/oh_preferences_err_code.h", "./include/oh_preferences_option.h", - "./include/oh_preferences_values.h", + "./include/oh_preferences_value.h", ] } @@ -32,9 +32,9 @@ ohos_ndk_library("libohpreferences") { ndk_description_file = "./libpreferences.ndk.json" min_compact_version = "13" system_capability_headers = [ - "$ndk_headers_out_dir/database/preferences/oh_preferences.h", - "$ndk_headers_out_dir/database/preferences/oh_preferences_err_code.h", - "$ndk_headers_out_dir/database/preferences/oh_preferences_values.h", - "$ndk_headers_out_dir/database/preferences/oh_preferences_option.h", + "database/preferences/oh_preferences.h", + "database/preferences/oh_preferences_err_code.h", + "database/preferences/oh_preferences_value.h", + "database/preferences/oh_preferences_option.h", ] } diff --git a/distributeddatamgr/preferences/include/oh_preferences.h b/distributeddatamgr/preferences/include/oh_preferences.h index b3ee03cb2..f7531f81c 100644 --- a/distributeddatamgr/preferences/include/oh_preferences.h +++ b/distributeddatamgr/preferences/include/oh_preferences.h @@ -39,7 +39,8 @@ #ifndef OH_PREFERENCES_H #define OH_PREFERENCES_H -#include +#include +#include #include "oh_preferences_value.h" #include "oh_preferences_option.h" diff --git a/distributeddatamgr/preferences/include/oh_preferences_option.h b/distributeddatamgr/preferences/include/oh_preferences_option.h index 4b2d1d953..2c616d055 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_option.h +++ b/distributeddatamgr/preferences/include/oh_preferences_option.h @@ -39,7 +39,7 @@ #ifndef OH_PREFERENCES_OPTION_H #define OH_PREFERENCES_OPTION_H -#include +#include #ifdef __cplusplus extern "C" { diff --git a/distributeddatamgr/preferences/include/oh_preferences_value.h b/distributeddatamgr/preferences/include/oh_preferences_value.h index 5fd358f32..c1a0e3579 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_value.h +++ b/distributeddatamgr/preferences/include/oh_preferences_value.h @@ -39,7 +39,8 @@ #ifndef OH_PREFERENCES_VALUE_H #define OH_PREFERENCES_VALUE_H -#include +#include +#include #ifdef __cplusplus extern "C" { -- Gitee From 4677d991d57fc856a1fa99fc7d60889c1486d6ff Mon Sep 17 00:00:00 2001 From: caochuan Date: Mon, 2 Sep 2024 14:38:59 +0800 Subject: [PATCH 255/620] add media library 0826 api Signed-off-by: caochuan --- .../media_library/media_access_helper_capi.h | 2 +- .../media_library/media_asset_base_capi.h | 25 ++++ multimedia/media_library/media_asset_capi.h | 141 +++++++++++++++++- .../media_asset_change_request_capi.h | 40 ++++- .../media_asset_manager/BUILD.gn | 2 + .../lib_media_asset_namager_capi.ndk.json | 72 +++++++++ .../media_library/media_asset_manager_capi.h | 37 +++++ multimedia/media_library/moving_photo_capi.h | 138 +++++++++++++++++ 8 files changed, 454 insertions(+), 3 deletions(-) create mode 100644 multimedia/media_library/moving_photo_capi.h diff --git a/multimedia/media_library/media_access_helper_capi.h b/multimedia/media_library/media_access_helper_capi.h index 776bc9e2c..7579ee148 100644 --- a/multimedia/media_library/media_access_helper_capi.h +++ b/multimedia/media_library/media_access_helper_capi.h @@ -14,7 +14,7 @@ */ /** - * @addtogroup MediaAccessHelper + * @addtogroup MediaAssetManager * @{ * * @brief Provides APIs of request capability for Media Source. diff --git a/multimedia/media_library/media_asset_base_capi.h b/multimedia/media_library/media_asset_base_capi.h index a0caef2b3..57391fb1e 100644 --- a/multimedia/media_library/media_asset_base_capi.h +++ b/multimedia/media_library/media_asset_base_capi.h @@ -82,6 +82,15 @@ typedef struct OH_MediaAssetManager OH_MediaAssetManager; */ typedef struct OH_MediaAssetChangeRequest OH_MediaAssetChangeRequest; +/** + * @brief Define Moving Photo + * + * This structure provides the ability to obtain information about moving photo. + * + * @since 13 + */ +typedef struct OH_MovingPhoto OH_MovingPhoto; + /** * @brief Define Media Asset * @@ -291,6 +300,22 @@ typedef void (*OH_MediaLibrary_OnImageDataPrepared)(MediaLibrary_ErrorCode resul MediaLibrary_RequestId requestId, MediaLibrary_MediaQuality mediaQuality, MediaLibrary_MediaContentType type, OH_ImageSourceNative* imageSourceNative); +/** + * @brief Called when a requested moving photo is prepared. + * + * This function is called when the requested moving photo is prepared. + * + * @param result results {@link MediaLibrary_ErrorCode} of the processing of the requested resources. + * @param requestId indicates the {@link MediaLibrary_RequestId} of the request. + * @param mediaQuality the {@link MediaLibrary_MediaQuality} of the requested source. + * @param type the {@link MediaLibrary_MediaContentType} of the requested source. + * @param movingPhoto it used to obtain {@link OH_MovingPhoto} information when the data is prepared. + * @since 13 + */ +typedef void (*OH_MediaLibrary_OnMovingPhotoDataPrepared)(MediaLibrary_ErrorCode result, + MediaLibrary_RequestId requestId, MediaLibrary_MediaQuality mediaQuality, MediaLibrary_MediaContentType type, + OH_MovingPhoto* movingPhoto); + #ifdef __cplusplus } #endif diff --git a/multimedia/media_library/media_asset_capi.h b/multimedia/media_library/media_asset_capi.h index 772e4be5d..04fb1b2d6 100644 --- a/multimedia/media_library/media_asset_capi.h +++ b/multimedia/media_library/media_asset_capi.h @@ -14,7 +14,7 @@ */ /** - * @addtogroup MediaAsset + * @addtogroup MediaAssetManager * @{ * * @brief Provides APIs of request capability for Media Source. @@ -59,6 +59,37 @@ extern "C" { */ MediaLibrary_ErrorCode OH_MediaAsset_GetUri(OH_MediaAsset* mediaAsset, const char** uri); +/** + * @brief Get the media file type of the media asset. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param mediaType the media file type of the media asset. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetMediaType(OH_MediaAsset* mediaAsset, MediaLibrary_MediaType* mediaType); + +/** + * @brief Get the subtype of the media asset. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param mediaSubType the subtype of the media asset. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetMediaSubType(OH_MediaAsset* mediaAsset, + MediaLibrary_MediaSubType* mediaSubType); + /** * @brief Get the display name of the media asset. * @@ -89,6 +120,69 @@ MediaLibrary_ErrorCode OH_MediaAsset_GetDisplayName(OH_MediaAsset* mediaAsset, c */ MediaLibrary_ErrorCode OH_MediaAsset_GetSize(OH_MediaAsset* mediaAsset, uint32_t* size); +/** + * @brief Get the date of asset creation. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param dateAdded the creation date of the asset. + * The value is the number of seconds elapsed since the Epoch time (00:00:00 UTC on January 1, 1970). + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetDateAdded(OH_MediaAsset* mediaAsset, uint32_t* dateAdded); + +/** + * @brief Get the modified date of the asset. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param dateModified the modified date of the asset. + * The value is the number of seconds elapsed since the Epoch time. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetDateModified(OH_MediaAsset* mediaAsset, uint32_t* dateModified); + +/** + * @brief Get the date taken of the asset. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param dateTaken the date taken of the asset. + * The value is the number of seconds elapsed since the Epoch time. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetDateTaken(OH_MediaAsset* mediaAsset, uint32_t* dateTaken); + +/** + * @brief Get the creation time of the asset in milliseconds. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param dateAddedMs the creation time of the asset in milliseconds. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetDateAddedMs(OH_MediaAsset* mediaAsset, uint32_t* dateAddedMs); + /** * @brief Get the modified time of the asset in milliseconds. * @@ -104,6 +198,21 @@ MediaLibrary_ErrorCode OH_MediaAsset_GetSize(OH_MediaAsset* mediaAsset, uint32_t */ MediaLibrary_ErrorCode OH_MediaAsset_GetDateModifiedMs(OH_MediaAsset* mediaAsset, uint32_t* dateModifiedMs); +/** + * @brief Get the duration of the media asset in milliseconds. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param duration the duration of the media asset in milliseconds. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetDuration(OH_MediaAsset* mediaAsset, uint32_t* duration); + /** * @brief Get the image width(in pixels) of the media asset. * @@ -149,6 +258,36 @@ MediaLibrary_ErrorCode OH_MediaAsset_GetHeight(OH_MediaAsset* mediaAsset, uint32 */ MediaLibrary_ErrorCode OH_MediaAsset_GetOrientation(OH_MediaAsset* mediaAsset, uint32_t* orientation); +/** + * @brief Get the favorite state of the asset. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param favorite the favorite state of the media asset. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_IsFavorite(OH_MediaAsset* mediaAsset, uint32_t* favorite); + +/** + * @brief Get the title of the media asset. + * + * @param mediaAsset the {@link OH_MediaAsset} instance. + * @param title the title of the media asset. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MediaAsset_GetTitle(OH_MediaAsset* mediaAsset, const char** title); + /** * @brief Release the media asset * diff --git a/multimedia/media_library/media_asset_change_request_capi.h b/multimedia/media_library/media_asset_change_request_capi.h index d4bb6a772..aedbff48a 100644 --- a/multimedia/media_library/media_asset_change_request_capi.h +++ b/multimedia/media_library/media_asset_change_request_capi.h @@ -14,7 +14,7 @@ */ /** - * @addtogroup MediaAssetChangeRequest + * @addtogroup MediaAssetManager * @{ * * @brief Provides APIs of request capability for Media Source. @@ -58,6 +58,25 @@ extern "C" { */ OH_MediaAssetChangeRequest* OH_MediaAssetChangeRequest_Create(OH_MediaAsset* mediaAsset); +/** + * @brief Add resource of the asset using file uri. + * + * @param changeRequest the {@link OH_MediaAssetChangeRequest} instance. + * @param resourceType the {@link MediaLibrary_ResourceType} of the resource to add. + * @param fileUri the file uri. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_NO_SUCH_FILE} if file does not exist. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * {@link #MEDIA_LIBRARY_OPERATION_NOT_SUPPORTED} if operation is not supported. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MediaAssetChangeRequest_AddResourceWithUri(OH_MediaAssetChangeRequest* changeRequest, + MediaLibrary_ResourceType resourceType, char* fileUri); + /** * @brief Add resource of the asset using ArrayBuffer. * @@ -77,6 +96,25 @@ OH_MediaAssetChangeRequest* OH_MediaAssetChangeRequest_Create(OH_MediaAsset* med MediaLibrary_ErrorCode OH_MediaAssetChangeRequest_AddResourceWithBuffer(OH_MediaAssetChangeRequest* changeRequest, MediaLibrary_ResourceType resourceType, uint8_t* buffer, uint32_t length); +/** + * @brief Get write cache handler. + * + * @permission ohos.permission.WRITE_IMAGEVIDEO + * @param changeRequest the {@link OH_MediaAssetChangeRequest} instance. + * @param fd the write cache handler. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied. + * {@link #MEDIA_LIBRARY_OPERATION_NOT_SUPPORTED} if operation is not supported. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MediaAssetChangeRequest_GetWriteCacheHandler(OH_MediaAssetChangeRequest* changeRequest, + int32_t* fd); + /** * @brief Save the photo asset captured by camera. * diff --git a/multimedia/media_library/media_asset_manager/BUILD.gn b/multimedia/media_library/media_asset_manager/BUILD.gn index a56329237..9385e2e92 100644 --- a/multimedia/media_library/media_asset_manager/BUILD.gn +++ b/multimedia/media_library/media_asset_manager/BUILD.gn @@ -23,6 +23,7 @@ ohos_ndk_headers("media_asset_manager_header") { "../media_asset_capi.h", "../media_asset_change_request_capi.h", "../media_asset_manager_capi.h", + "../moving_photo_capi.h", ] } @@ -36,6 +37,7 @@ ohos_ndk_library("libmedia_asset_manager") { "multimedia/media_library/media_asset_base_capi.h", "multimedia/media_library/media_access_helper_capi.h", "multimedia/media_library/media_asset_capi.h", + "multimedia/media_library/moving_photo_capi.h", "multimedia/media_library/media_asset_change_request_capi.h", ] } diff --git a/multimedia/media_library/media_asset_manager/lib_media_asset_namager_capi.ndk.json b/multimedia/media_library/media_asset_manager/lib_media_asset_namager_capi.ndk.json index 6cc799cb7..077fecaab 100644 --- a/multimedia/media_library/media_asset_manager/lib_media_asset_namager_capi.ndk.json +++ b/multimedia/media_library/media_asset_manager/lib_media_asset_namager_capi.ndk.json @@ -15,10 +15,18 @@ "first_introduced": "12", "name": "OH_MediaAssetManager_CancelRequest" }, + { + "first_introduced": "13", + "name": "OH_MediaAssetManager_RequestMovingPhoto" + }, { "first_introduced": "12", "name": "OH_MediaAssetManager_RequestImage" }, + { + "first_introduced": "13", + "name": "OH_MediaAssetManager_Release" + }, { "first_introduced": "12", "name": "OH_MediaAccessHelper_ApplyChanges" @@ -27,6 +35,14 @@ "first_introduced": "12", "name": "OH_MediaAsset_GetUri" }, + { + "first_introduced": "13", + "name": "OH_MediaAsset_GetMediaType" + }, + { + "first_introduced": "13", + "name": "OH_MediaAsset_GetMediaSubType" + }, { "first_introduced": "12", "name": "OH_MediaAsset_GetDisplayName" @@ -35,10 +51,30 @@ "first_introduced": "12", "name": "OH_MediaAsset_GetSize" }, + { + "first_introduced": "13", + "name": "OH_MediaAsset_GetDateAdded" + }, + { + "first_introduced": "13", + "name": "OH_MediaAsset_GetDateModified" + }, + { + "first_introduced": "13", + "name": "OH_MediaAsset_GetDateTaken" + }, + { + "first_introduced": "13", + "name": "OH_MediaAsset_GetDateAddedMs" + }, { "first_introduced": "12", "name": "OH_MediaAsset_GetDateModifiedMs" }, + { + "first_introduced": "13", + "name": "OH_MediaAsset_GetDuration" + }, { "first_introduced": "12", "name": "OH_MediaAsset_GetWidth" @@ -51,18 +87,54 @@ "first_introduced": "12", "name": "OH_MediaAsset_GetOrientation" }, + { + "first_introduced": "13", + "name": "OH_MediaAsset_IsFavorite" + }, + { + "first_introduced": "13", + "name": "OH_MediaAsset_GetTitle" + }, { "first_introduced": "12", "name": "OH_MediaAsset_Release" }, + { + "first_introduced": "13", + "name": "OH_MovingPhoto_GetUri" + }, + { + "first_introduced": "13", + "name": "OH_MovingPhoto_RequestContentWithUris" + }, + { + "first_introduced": "13", + "name": "OH_MovingPhoto_RequestContentWithUri" + }, + { + "first_introduced": "13", + "name": "OH_MovingPhoto_RequestContentWithBuffer" + }, + { + "first_introduced": "13", + "name": "OH_MovingPhoto_Release" + }, { "first_introduced": "12", "name": "OH_MediaAssetChangeRequest_Create" }, + { + "first_introduced": "13", + "name": "OH_MediaAssetChangeRequest_AddResourceWithUri" + }, { "first_introduced": "12", "name": "OH_MediaAssetChangeRequest_AddResourceWithBuffer" }, + { + "first_introduced": "13", + "name": "OH_MediaAssetChangeRequest_GetWriteCacheHandler" + }, { "first_introduced": "12", "name": "OH_MediaAssetChangeRequest_SaveCameraPhoto" diff --git a/multimedia/media_library/media_asset_manager_capi.h b/multimedia/media_library/media_asset_manager_capi.h index 6be1ab5e4..67b5d4b79 100644 --- a/multimedia/media_library/media_asset_manager_capi.h +++ b/multimedia/media_library/media_asset_manager_capi.h @@ -96,6 +96,30 @@ MediaLibrary_RequestId OH_MediaAssetManager_RequestVideoForPath(OH_MediaAssetMan */ bool OH_MediaAssetManager_CancelRequest(OH_MediaAssetManager* manager, const MediaLibrary_RequestId requestId); +/** + * @brief Request moving photo object. + * + * @permission ohos.permission.READ_IMAGEVIDEO + * @param manager the pointer to {@link OH_MediaAssetManager} instance. + * @param mediaAsset the {@link OH_MediaAsset} instance of media file object to be requested. + * @param requestOptions the {@link MediaLibrary_RequestOptions} for image request strategy mode. + * @param requestId indicates the {@link MediaLibrary_RequestId} of the request, which is an output parameter. + * @param callback the {@link OH_MediaLibrary_OnMovingPhotoDataPrepared} that will be called + * when the requested source is prepared. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_OPERATION_NOT_SUPPORTED} if operation is not supported. + * {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MediaAssetManager_RequestMovingPhoto(OH_MediaAssetManager* manager, + OH_MediaAsset* mediaAsset, MediaLibrary_RequestOptions requestOptions, MediaLibrary_RequestId* requestId, + OH_MediaLibrary_OnMovingPhotoDataPrepared callback); + /** * @brief Request image resources based on different strategy modes. * @@ -120,6 +144,19 @@ MediaLibrary_ErrorCode OH_MediaAssetManager_RequestImage(OH_MediaAssetManager* m MediaLibrary_RequestOptions requestOptions, MediaLibrary_RequestId* requestId, OH_MediaLibrary_OnImageDataPrepared callback); +/** + * @brief Release the {@link OH_MediaAssetManager} instance. + * + * @param manager the {@link OH_MediaAssetManager} instance. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MediaAssetManager_Release(OH_MediaAssetManager* manager); + #ifdef __cplusplus } #endif diff --git a/multimedia/media_library/moving_photo_capi.h b/multimedia/media_library/moving_photo_capi.h new file mode 100644 index 000000000..ce079ecd3 --- /dev/null +++ b/multimedia/media_library/moving_photo_capi.h @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup MediaAssetManager + * @{ + * + * @brief Provides APIs of request capability for Media Source. + * + * @since 13 + */ + +/** + * @file moving_photo_capi.h + * + * @brief Defines APIs related to moving photo. + * + * Provides the ability to obtain moving photo information. + * + * @kit MediaLibraryKit + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @library libmedia_asset_manager.so + * @since 13 + */ + +#ifndef MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MOVING_PHOTO_H +#define MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MOVING_PHOTO_H + +#include "media_asset_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Get uri of the moving photo. + * + * @param movingPhoto the {@link OH_MovingPhoto} instance. + * @param uri the uri of the moving photo. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MovingPhoto_GetUri(OH_MovingPhoto* movingPhoto, const char** uri); + +/** + * @brief Request the image and video content of the moving photo and write to destination uri. + * + * @permission ohos.permission.READ_IMAGEVIDEO + * @param movingPhoto the {@link OH_MovingPhoto} instance. + * @param imageUri the destination file uri to save the image data. + * @param videoUri the destination file uri to save the video data. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MovingPhoto_RequestContentWithUris(OH_MovingPhoto* movingPhoto, char* imageUri, + char* videoUri); + +/** + * @brief Request the image or video content of the moving photo and write to destination uri. + * + * @permission ohos.permission.READ_IMAGEVIDEO + * @param movingPhoto the {@link OH_MovingPhoto} instance. + * @param resourceType the {@link MediaLibrary_ResourceType} of the moving photo content to request. + * @param uri the destination file uri to save the data. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MovingPhoto_RequestContentWithUri(OH_MovingPhoto* movingPhoto, + MediaLibrary_ResourceType resourceType, char* uri); + +/** + * @brief Request data of the moving photo. + * + * @permission ohos.permission.READ_IMAGEVIDEO + * @param movingPhoto the {@link OH_MovingPhoto} instance. + * @param resourceType the {@link MediaLibrary_ResourceType} of the moving photo content to request. + * @param buffer the buffer of the content. + * @param size the size of the buffer. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied. + * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MovingPhoto_RequestContentWithBuffer(OH_MovingPhoto* movingPhoto, + MediaLibrary_ResourceType resourceType, const uint8_t** buffer, uint32_t* size); + +/** + * @brief Release the {@link OH_MovingPhoto} instance. + * + * @param movingPhoto the {@link OH_MovingPhoto} instance. + * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. + * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * @since 13 +*/ +MediaLibrary_ErrorCode OH_MovingPhoto_Release(OH_MovingPhoto* movingPhoto); + +#ifdef __cplusplus +} +#endif + +#endif // MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MOVING_PHOTO_H +/** @} */ \ No newline at end of file -- Gitee From 9a419f7eff1572744bb2e7e9085a00f42d1f9fc6 Mon Sep 17 00:00:00 2001 From: huanghuijin Date: Wed, 4 Sep 2024 20:48:20 +0800 Subject: [PATCH 256/620] add build targets section Signed-off-by: huanghuijin --- .gitee/ISSUE_TEMPLATE.en.md | 11 +++++++++++ .gitee/ISSUE_TEMPLATE.zh-CN.md | 11 +++++++++++ .gitee/PULL_REQUEST_TEMPLATE.en.md | 19 +++++++++++++++++++ .gitee/PULL_REQUEST_TEMPLATE.zh-CN.md | 19 +++++++++++++++++++ docs/howto_add.md | 18 +++++++++++++++++- 5 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 .gitee/ISSUE_TEMPLATE.en.md create mode 100644 .gitee/ISSUE_TEMPLATE.zh-CN.md create mode 100644 .gitee/PULL_REQUEST_TEMPLATE.en.md create mode 100644 .gitee/PULL_REQUEST_TEMPLATE.zh-CN.md diff --git a/.gitee/ISSUE_TEMPLATE.en.md b/.gitee/ISSUE_TEMPLATE.en.md new file mode 100644 index 000000000..f1a77b33d --- /dev/null +++ b/.gitee/ISSUE_TEMPLATE.en.md @@ -0,0 +1,11 @@ +### Description? + + + +### Steps to reproduce + + + +### Error results + + diff --git a/.gitee/ISSUE_TEMPLATE.zh-CN.md b/.gitee/ISSUE_TEMPLATE.zh-CN.md new file mode 100644 index 000000000..84543046a --- /dev/null +++ b/.gitee/ISSUE_TEMPLATE.zh-CN.md @@ -0,0 +1,11 @@ +### 该问题是怎么引起的? + + + +### 重现步骤 + + + +### 报错信息 + + diff --git a/.gitee/PULL_REQUEST_TEMPLATE.en.md b/.gitee/PULL_REQUEST_TEMPLATE.en.md new file mode 100644 index 000000000..073fa0eac --- /dev/null +++ b/.gitee/PULL_REQUEST_TEMPLATE.en.md @@ -0,0 +1,19 @@ +### Issue + + +### Reason + + +### how to fix + + +### Test (libc-test is mandatory, but not limited to) +- [ ] pass c syntax checker +- [ ] pass interface checker +- [ ] add symbol to json +- [ ] merge the implementation +- [ ] add target to ndk.targets in build + +### Compatibility impact assessment, please indicate (Y/N) +- [ ] not compatible + - [ ] evaluated by committee diff --git a/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md b/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md new file mode 100644 index 000000000..5af541eea --- /dev/null +++ b/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md @@ -0,0 +1,19 @@ +### 相关的Issue + + +### 原因(目的、解决的问题等) + + +### 描述(做了什么,变更了什么) + + +### 自检结果(结果截图添加到下面) +- [ ] 是否通过C语法扫描 +- [ ] 是否通过注释规则扫描 +- [ ] 是否更新json文件 +- [ ] 实现代码是否已经合入 +- [ ] 目标是否已经添加到build仓ndk依赖目标里 + +### 兼容性影响评估,如有影响请写明(Y/N) +- [ ] 不兼容 + - [ ] 是否经过评审 diff --git a/docs/howto_add.md b/docs/howto_add.md index aeb70e52f..9ff64faba 100644 --- a/docs/howto_add.md +++ b/docs/howto_add.md @@ -17,7 +17,7 @@ GN语法,https://zhuanlan.zhihu.com/p/136954435 ``` ./build.sh --product-name ohos-sdk ``` -更加详细的SDK编译指导,请参考[如何编译full-SDK](http://https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/faqs/full-sdk-compile-guide.md)。 +更加详细的SDK编译指导,请参考[如何编译full-SDK](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/faqs/full-sdk-compile-guide.md)。 ## 编译结果 @@ -113,6 +113,22 @@ sources = [ 这个模板只针对mac/win/linux平台的几个工具链,一般开发同学使用不到。 输入参数含义同ohos_ndk_headers。ohos_ndk_toolchains目标的默认dest_dir为$root_out_dir/sdk-native/sysroot/usr/lib +## 添加到build系统 + +上面添加的目标需要加到build的[ndk依赖目标](https://gitee.com/openharmony/build/blob/master/ohos/ndk/ndk_targets.gni)文件的_ndk_library_targets变量里面,这样在编译 +SDK的时候,才会被依赖到。 + +新增如下 +``` +_ndk_library_targets = [ + "//interface/sdk_c/sensors/miscdevice/vibrator:lib_vibrator_ndk", + "//interface/sdk_c/sensors/miscdevice/vibrator:ndk_vibrator_header", + ... + "//interface/sdk_c/sensors/sensor:libsensor_ndk", + "//interface/sdk_c/sensors/sensor:sensor_ndk_header", +] +``` + ## 文档 C API的文档生成在docs目录,需要安装doxygen工具,在ubuntu上使用`sudo apt-get install doxygen`即可安装。如果编译机上没有安装doxygen,文档将无法生成。 -- Gitee From 31167a5019944877ddff4db0743fd688b5b79d30 Mon Sep 17 00:00:00 2001 From: cuile4 Date: Sun, 8 Sep 2024 14:54:50 +0800 Subject: [PATCH 257/620] paste board ndk json fix Signed-off-by: cuile4 --- .../pasteboard/libpasteboard.ndk.json | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/distributeddatamgr/pasteboard/libpasteboard.ndk.json b/distributeddatamgr/pasteboard/libpasteboard.ndk.json index 37b1151fb..829a3ba45 100644 --- a/distributeddatamgr/pasteboard/libpasteboard.ndk.json +++ b/distributeddatamgr/pasteboard/libpasteboard.ndk.json @@ -17,42 +17,42 @@ }, { "first_introduced": "13", - "name": "OH_PasteBoard_Destroy" + "name": "OH_Pasteboard_Destroy" }, { "first_introduced": "13", - "name": "OH_PasteBoard_Subcribe" + "name": "OH_Pasteboard_Subscribe" }, { "first_introduced": "13", - "name": "OH_PasteBoard_Unsubcribe" + "name": "OH_Pasteboard_Unsubscribe" }, { "first_introduced": "13", - "name": "OH_PasteBoard_IsRemoteData" + "name": "OH_Pasteboard_IsRemoteData" }, { "first_introduced": "13", - "name": "OH_PasteBoard_GetDataSrouce" + "name": "OH_Pasteboard_GetDataSource" }, { "first_introduced": "13", - "name": "OH_PasteBoard_HasType" + "name": "OH_Pasteboard_HasType" }, { "first_introduced": "13", - "name": "OH_PasteBoard_HasData" + "name": "OH_Pasteboard_HasData" }, { "first_introduced": "13", - "name": "OH_PasteBoard_GetData" + "name": "OH_Pasteboard_GetData" }, { "first_introduced": "13", - "name": "OH_PasteBoard_SetData" + "name": "OH_Pasteboard_SetData" }, { "first_introduced": "13", - "name": "OH_PasteBoard_ClearData" + "name": "OH_Pasteboard_ClearData" } ] \ No newline at end of file -- Gitee From f1895005754d3a497552b8cfdc307f76e885e234 Mon Sep 17 00:00:00 2001 From: yangzk Date: Sun, 8 Sep 2024 17:18:49 +0800 Subject: [PATCH 258/620] =?UTF-8?q?Description:=20=E6=96=B0=E5=A2=9Eapplic?= =?UTF-8?q?ationContext=E9=94=99=E8=AF=AF=E7=A0=81ABILITY=5FRUNTIME=5FERRO?= =?UTF-8?q?R=5FCODE=5FCONTEXT=5FNOT=5FEXIST=20IssueNo:=20#IAPOX6=20Sig:=20?= =?UTF-8?q?SIG=5FApplicationFramework=20Feature=20or=20Bugfix:=20Bugfix=20?= =?UTF-8?q?Binary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangzk Change-Id: I25509e923f6ebaeffaec07ee0bdc852b60762ee5 --- AbilityKit/ability_runtime/ability_runtime_common.h | 4 +++- AbilityKit/ability_runtime/application_context.h | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/AbilityKit/ability_runtime/ability_runtime_common.h b/AbilityKit/ability_runtime/ability_runtime_common.h index d6220b080..e4cf556e4 100644 --- a/AbilityKit/ability_runtime/ability_runtime_common.h +++ b/AbilityKit/ability_runtime/ability_runtime_common.h @@ -51,6 +51,8 @@ typedef enum { ABILITY_RUNTIME_ERROR_CODE_NO_ERROR = 0, /** @error Invalid parameters. */ ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID = 401, + /** @error The context does not exist. */ + ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST = 16000011, } AbilityRuntime_ErrorCode; #ifdef __cplusplus @@ -58,4 +60,4 @@ typedef enum { #endif /** @} */ -#endif //ABILITY_RUNTIME_COMMON_H +#endif // ABILITY_RUNTIME_COMMON_H diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index 374a99bd8..1ba53503d 100644 --- a/AbilityKit/ability_runtime/application_context.h +++ b/AbilityKit/ability_runtime/application_context.h @@ -57,6 +57,7 @@ extern "C" { * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. * @since 13 */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetCacheDir( @@ -69,6 +70,7 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetCacheDir( * @return The error code. * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the areaMode is null. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. * @since 13 */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetAreaMode(AbilityRuntime_AreaMode* areaMode); @@ -84,6 +86,7 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetAreaMode(Ability * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. * @since 13 */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetBundleName( -- Gitee From 1a48032a8878793739c8cc307890895a9f8bb0d1 Mon Sep 17 00:00:00 2001 From: HYH Date: Mon, 9 Sep 2024 09:03:50 +0000 Subject: [PATCH 259/620] update multimodalinput/kits/c/input/oh_input_manager.h. dadad Signed-off-by: HYH --- multimodalinput/kits/c/input/oh_input_manager.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 2dd62840e..0a2b5b471 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -253,9 +253,15 @@ typedef enum Input_Result { INPUT_SERVICE_EXCEPTION = 3800001, /** @error Interceptor repeatedly created for an application */ INPUT_REPEAT_INTERCEPTOR = 4200001, - /** @error Already occupied by the system */ + /** + * @error Already occupied by the system + * @since 13 + */ INPUT_OCCUPIED_BY_SYSTEM = 4200002, - /** @error Already occupied by the other */ + /** + * @error Already occupied by the other + * @since 13 + */ INPUT_OCCUPIED_BY_OTHER = 4200003, } Input_Result; -- Gitee From c4cf172c5e62d8248a1d624671c584fbbce1172c Mon Sep 17 00:00:00 2001 From: PengKejie Date: Tue, 10 Sep 2024 12:03:32 +0800 Subject: [PATCH 260/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: PengKejie --- graphic/graphic_2d/native_drawing/drawing_text_typography.h | 2 +- graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 66254efd5..e4546ed6c 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1040,7 +1040,7 @@ double OH_Drawing_TypographyGetLongestLine(OH_Drawing_Typography*); * @param OH_Drawing_Typography Pointer to an OH_Drawing_Typography object, which is obtained by * {@link OH_Drawing_CreateTypography}. * @return Returns the width of the longest line with indent. - * @since 12 + * @since 13 * @version 1.1 */ double OH_Drawing_TypographyGetLongestLineWithIndent(OH_Drawing_Typography*); diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 492754ecc..ad9a1739c 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -700,7 +700,7 @@ { "name": "OH_Drawing_TypographyGetHeight" }, { "name": "OH_Drawing_TypographyGetLongestLine" }, { - "first_introduced": "12", + "first_introduced": "13", "name": "OH_Drawing_TypographyGetLongestLineWithIndent" }, { "name": "OH_Drawing_TypographyGetMinIntrinsicWidth" }, -- Gitee From 413009a19d242465b686395afd249dc0b292e234 Mon Sep 17 00:00:00 2001 From: huchang Date: Tue, 10 Sep 2024 12:22:09 +0800 Subject: [PATCH 261/620] add mic unblocked callback Signed-off-by: huchang Change-Id: Ib3d438faf355ad06e8bf6032b5cc46599694660d --- .../native_audio_routing_manager.h | 20 ++++++++++------- .../common/native_audio_device_base.h | 22 +++++++++++++++++++ multimedia/audio_framework/ohaudio.ndk.json | 2 +- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h index 2e19d9f26..2f44c5b11 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h @@ -239,25 +239,29 @@ OH_AudioCommon_Result OH_AudioRoutingManager_ReleaseDevices( OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray); /** - * @brief This function pointer will point to the callback function that is used to return the microphones that - * are blocked. + * @brief This type defines the callback function that is used to receive the audio devices' block status. + * * @param audioDeviceDescriptorArray The {@link OH_AudioDeviceDescriptorArray} * pointer variable which will be set the audio device descriptors value. * Do not release the audioDeviceDescriptorArray pointer separately instead of calling * {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array when it is no use anymore. + * @param status The {@link OH_AudioDevice_BlockStatus} is the block status. * @param userData User data which is passed by user. * @since 13 */ -typedef void (*OH_AudioRoutingManager_OnMicrophoneBlockedCallback)( +typedef void (*OH_AudioRoutingManager_OnDeviceBlockStatusCallback)( OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray, + OH_AudioDevice_BlockStatus status, void *userData); /** - * @brief Set the micophone blocked callback. + * @brief Set the microphone block status callback. The caller will receive the callback only when it is recording + * and the used microphones' block status have changed. Currently, block detecting is only support for microphones + * located on the local device. + * * @param audioRoutingManager The {@link OH_AudioRoutingManager} handle returned by * {@link OH_AudioManager_GetAudioRoutingManager}. - * @param callback The function pointer will point to the callback function that is used to return the microphones that - * are blocked. + * @param callback The function pointer will point to the callback function that is used to receive the block status. * @param userData User data which is passed by user. * @return Function result code: * {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful. @@ -266,9 +270,9 @@ typedef void (*OH_AudioRoutingManager_OnMicrophoneBlockedCallback)( * 2.The param of callback is nullptr. * @since 13 */ -OH_AudioCommon_Result OH_AudioRoutingManager_SetMicrophoneBlockedCallback( +OH_AudioCommon_Result OH_AudioRoutingManager_SetMicrophoneBlockStatusCallback( OH_AudioRoutingManager *audioRoutingManager, - OH_AudioRoutingManager_OnMicrophoneBlockedCallback callback, + OH_AudioRoutingManager_OnDeviceBlockStatusCallback callback, void *userData); #ifdef __cplusplus } diff --git a/multimedia/audio_framework/common/native_audio_device_base.h b/multimedia/audio_framework/common/native_audio_device_base.h index 436fc6683..573e07fed 100644 --- a/multimedia/audio_framework/common/native_audio_device_base.h +++ b/multimedia/audio_framework/common/native_audio_device_base.h @@ -250,6 +250,28 @@ typedef struct OH_AudioDeviceDescriptorArray { OH_AudioDeviceDescriptor **descriptors; } OH_AudioDeviceDescriptorArray; +/** + * @brief Declaring the audio device blocked status. By default, the audio device is considered as unbloked. + * + * @since 13 + */ +typedef enum { + /** + * @brief Audio device is unblocked. + * + * @since 13 + */ + AUDIO_DEVICE_UNBLOCKED = 0, + + /** + * @brief Audio Device is blocked. + * + * @since 13 + */ + AUDIO_DEVICE_BLOCKED = 1, +} OH_AudioDevice_BlockStatus; + + /** * @brief Query the device role of the target audio device descriptor. * diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 6b1328f5a..d4f849c54 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -373,6 +373,6 @@ }, { "first_introduced": "13", - "name": "OH_AudioRoutingManager_SetMicrophoneBlockedCallback" + "name": "OH_AudioRoutingManager_SetMicrophoneBlockStatusCallback" } ] -- Gitee From c35ce38163a1794fd9b150fbbedc74388b700af3 Mon Sep 17 00:00:00 2001 From: zwtmichael Date: Tue, 10 Sep 2024 12:15:07 +0800 Subject: [PATCH 262/620] modify interface param Signed-off-by: zwtmichael --- distributeddatamgr/preferences/include/oh_preferences.h | 8 ++++---- .../preferences/include/oh_preferences_option.h | 4 ++-- distributeddatamgr/preferences/libpreferences.ndk.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/distributeddatamgr/preferences/include/oh_preferences.h b/distributeddatamgr/preferences/include/oh_preferences.h index f7531f81c..c3a56fd95 100644 --- a/distributeddatamgr/preferences/include/oh_preferences.h +++ b/distributeddatamgr/preferences/include/oh_preferences.h @@ -230,7 +230,7 @@ int OH_Preferences_Delete(OH_Preferences *preference, const char *key); * * @param preference Pointer to the target {@Link OH_Preferences} instance. * @param context Pointer to the context of the data observer. - * @param observer Pointer to the {@Link OH_PreferencesDataObserver} to register. + * @param observer the {@Link OH_PreferencesDataObserver} to register. * @param keys Pointer to the keys to observe. * @param keyCount Number of keys to observe. * @return Returns the status code of the execution. @@ -243,14 +243,14 @@ int OH_Preferences_Delete(OH_Preferences *preference, const char *key); * @since 13 */ int OH_Preferences_RegisterDataObserver(OH_Preferences *preference, void *context, - const OH_PreferencesDataObserver *observer, const char *keys[], uint32_t keyCount); + OH_PreferencesDataObserver observer, const char *keys[], uint32_t keyCount); /** * @brief Unregisters a data observer for a Preferences object. * * @param preference Pointer to the target {@Link OH_Preferences} instance. * @param context Pointer to the context of the data observer. - * @param observer Pointer to the {@Link OH_PreferencesDataObserver} to unregister. + * @param observer the {@Link OH_PreferencesDataObserver} to unregister. * @param keys Pointer to the keys observed. If this parameter is null, this API unregisters the listening for all keys. * @param keyCount Number of the keys. * @return Returns the status code of the execution. @@ -262,7 +262,7 @@ int OH_Preferences_RegisterDataObserver(OH_Preferences *preference, void *contex * @since 13 */ int OH_Preferences_UnregisterDataObserver(OH_Preferences *preference, void *context, - const OH_PreferencesDataObserver *observer, const char *keys[], uint32_t keyCount); + OH_PreferencesDataObserver observer, const char *keys[], uint32_t keyCount); #ifdef __cplusplus }; diff --git a/distributeddatamgr/preferences/include/oh_preferences_option.h b/distributeddatamgr/preferences/include/oh_preferences_option.h index 2c616d055..a8a25af9f 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_option.h +++ b/distributeddatamgr/preferences/include/oh_preferences_option.h @@ -66,14 +66,14 @@ OH_PreferencesOption *OH_PreferencesOption_Create(void); * @brief Sets the file path in an {@Link OH_PreferencesOption} instance. * * @param option Pointer to the target {@Link OH_PreferencesOption} instance. - * @param filePath Pointer to the file path to set. + * @param fileName Pointer to the file name to set. * @return Returns the status code of the execution. * {@link PREFERENCES_OK} success. * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. * @see OH_PreferencesOption. * @since 13 */ -int OH_PreferencesOption_SetFilePath(OH_PreferencesOption *option, const char *filePath); +int OH_PreferencesOption_SetFileName(OH_PreferencesOption *option, const char *fileName); /** * @brief Sets the bundle name in an {@Link OH_PreferencesOption} instance. diff --git a/distributeddatamgr/preferences/libpreferences.ndk.json b/distributeddatamgr/preferences/libpreferences.ndk.json index fa4a164ed..9c41566f5 100644 --- a/distributeddatamgr/preferences/libpreferences.ndk.json +++ b/distributeddatamgr/preferences/libpreferences.ndk.json @@ -53,7 +53,7 @@ }, { "first_introduced": "13", - "name": "OH_PreferencesOption_SetFilePath" + "name": "OH_PreferencesOption_SetFileName" }, { "first_introduced": "13", -- Gitee From c5a0ca382a9fb9054b30466fb1858c5177e0d739 Mon Sep 17 00:00:00 2001 From: huchang Date: Tue, 10 Sep 2024 22:35:09 +0800 Subject: [PATCH 263/620] add camcorder Signed-off-by: huchang Change-Id: Ida9d396228dfa7614b4d63254295fceb12380c6e --- .../audio_framework/common/native_audiostream_base.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/multimedia/audio_framework/common/native_audiostream_base.h b/multimedia/audio_framework/common/native_audiostream_base.h index 84015d364..44dacf0d0 100644 --- a/multimedia/audio_framework/common/native_audiostream_base.h +++ b/multimedia/audio_framework/common/native_audiostream_base.h @@ -439,7 +439,13 @@ typedef enum { * * @since 12 */ - AUDIOSTREAM_SOURCE_TYPE_VOICE_MESSAGE = 10 + AUDIOSTREAM_SOURCE_TYPE_VOICE_MESSAGE = 10, + /** + * Camcorder source type. + * + * @since 13 + */ + AUDIOSTREAM_SOURCE_TYPE_CAMCORDER = 13 } OH_AudioStream_SourceType; /** -- Gitee From 0948262a2583b3016221decf6b85830e31b6aa71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=9E=E8=B6=85=E9=BA=92?= Date: Wed, 11 Sep 2024 11:51:30 +0800 Subject: [PATCH 264/620] add colorSpaceManagerNDK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 俞超麒 --- .../native_color_space_manager/BUILD.gn | 29 +++ .../libnative_color_space_manager.ndk.json | 26 ++ .../native_color_space_manager.h | 230 ++++++++++++++++++ 3 files changed, 285 insertions(+) create mode 100644 graphic/graphic_2d/native_color_space_manager/BUILD.gn create mode 100644 graphic/graphic_2d/native_color_space_manager/libnative_color_space_manager.ndk.json create mode 100644 graphic/graphic_2d/native_color_space_manager/native_color_space_manager.h diff --git a/graphic/graphic_2d/native_color_space_manager/BUILD.gn b/graphic/graphic_2d/native_color_space_manager/BUILD.gn new file mode 100644 index 000000000..9c88300e6 --- /dev/null +++ b/graphic/graphic_2d/native_color_space_manager/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_headers("native_color_space_manager_header") { + dest_dir = "$ndk_headers_out_dir/native_color_space_manager" + sources = [ "./native_color_space_manager.h" ] +} + +ohos_ndk_library("libnative_color_space_manager_ndk") { + output_name = "native_color_space_manager" + output_extension = "so" + ndk_description_file = "./libnative_color_space_manager.ndk.json" + system_capability = "SystemCapability.Graphic.Graphic2D.ColorManager.Core" + system_capability_headers = + [ "native_color_space_manager/native_color_space_manager.h" ] +} diff --git a/graphic/graphic_2d/native_color_space_manager/libnative_color_space_manager.ndk.json b/graphic/graphic_2d/native_color_space_manager/libnative_color_space_manager.ndk.json new file mode 100644 index 000000000..2dc8c4372 --- /dev/null +++ b/graphic/graphic_2d/native_color_space_manager/libnative_color_space_manager.ndk.json @@ -0,0 +1,26 @@ +[ + { + "first_introduced": "13", + "name": "OH_NativeColorSpaceManager_CreateFromName" + }, + { + "first_introduced": "13", + "name": "OH_NativeColorSpaceManager_CreateFromPrimariesAndGamma" + }, + { + "first_introduced": "13", + "name": "OH_NativeColorSpaceManager_Destroy" + }, + { + "first_introduced": "13", + "name": "OH_NativeColorSpaceManager_GetColorSpaceName" + }, + { + "first_introduced": "13", + "name": "OH_NativeColorSpaceManager_GetWhitePoint" + }, + { + "first_introduced": "13", + "name": "OH_NativeColorSpaceManager_GetGamma" + } +] \ No newline at end of file diff --git a/graphic/graphic_2d/native_color_space_manager/native_color_space_manager.h b/graphic/graphic_2d/native_color_space_manager/native_color_space_manager.h new file mode 100644 index 000000000..e4634b474 --- /dev/null +++ b/graphic/graphic_2d/native_color_space_manager/native_color_space_manager.h @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup NativeColorSpaceManager + * @{ + * + * @brief Provides the native colorSpaceManager capability. + * + * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core + * @since 13 + * @version 1.0 + */ + +/** + * @file native_color_space_manager.h + * + * @brief Defines the functions for obtaining and using a native colorSpaceManager. + * + * @library libnative_color_space_manager.so + * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core + * @since 13 + * @version 1.0 + */ +#ifndef C_INCLUDE_NATIVE_COLOR_SPACE_MANAGER_H_ +#define C_INCLUDE_NATIVE_COLOR_SPACE_MANAGER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Defines a colorspace manager. + * @since 13 + */ +typedef struct OH_NativeColorSpaceManager OH_NativeColorSpaceManager; + +/** + * @brief Enumerates color space types. + * @since 13 + */ +typedef enum { + /** Indicates an unknown color space. */ + NONE = 0, + /** Indicates the color space based on Adobe RGB. */ + ADOBE_RGB = 1, + /** Indicates the color space based on SMPTE RP 431-2-2007 and IEC 61966-2.1:1999. */ + DCI_P3 = 2, + /** Indicates the color space based on SMPTE RP 431-2-2007 and IEC 61966-2.1:1999. */ + DISPLAY_P3 = 3, + /** Indicates the standard red green blue (SRGB) color space based on IEC 61966-2.1:1999. */ + SRGB = 4, + /** Indicates the color space based on ITU-R BT.709. */ + BT709 = 6, + /** Indicates the color space based on ITU-R BT.601. */ + BT601_EBU = 7, + /** Indicates the color space based on ITU-R BT.601. */ + BT601_SMPTE_C = 8, + /** Indicates the color space based on ITU-R BT.2020. */ + BT2020_HLG = 9, + /** Indicates the color space based on ITU-R BT.2020. */ + BT2020_PQ = 10, + /** PRIMARIES_P3_D65 | TRANSFUNC_HLG | RANGE_FULL */ + P3_HLG = 11, + /** PRIMARIES_P3_D65 | TRANSFUNC_PQ | RANGE_FULL */ + P3_PQ = 12, + /** PRIMARIES_ADOBE_RGB | TRANSFUNC_ADOBE_RGB | RANGE_LIMIT */ + ADOBE_RGB_LIMIT = 13, + /** PRIMARIES_P3_D65 | TRANSFUNC_SRGB | RANGE_LIMIT */ + DISPLAY_P3_LIMIT = 14, + /** PRIMARIES_SRGB | TRANSFUNC_SRGB | RANGE_LIMIT */ + SRGB_LIMIT = 15, + /** PRIMARIES_BT709 | TRANSFUNC_BT709 | RANGE_LIMIT */ + BT709_LIMIT = 16, + /** PRIMARIES_BT601_P | TRANSFUNC_BT709 | RANGE_LIMIT */ + BT601_EBU_LIMIT = 17, + /** PRIMARIES_BT601_N | TRANSFUNC_BT709 | RANGE_LIMIT */ + BT601_SMPTE_C_LIMIT = 18, + /** PRIMARIES_BT2020 | TRANSFUNC_HLG | RANGE_LIMIT */ + BT2020_HLG_LIMIT = 19, + /** PRIMARIES_BT2020 | TRANSFUNC_PQ | RANGE_LIMIT */ + BT2020_PQ_LIMIT = 20, + /** PRIMARIES_P3_D65 | TRANSFUNC_HLG | RANGE_LIMIT */ + P3_HLG_LIMIT = 21, + /** PRIMARIES_P3_D65 | TRANSFUNC_PQ | RANGE_LIMIT */ + P3_PQ_LIMIT = 22, + /** PRIMARIES_P3_D65 | TRANSFUNC_LINEAR */ + LINEAR_P3 = 23, + /** PRIMARIES_SRGB | TRANSFUNC_LINEAR */ + LINEAR_SRGB = 24, + /** PRIMARIES_BT709 | TRANSFUNC_LINEAR */ + LINEAR_BT709 = LINEAR_SRGB, + /** PRIMARIES_BT2020 | TRANSFUNC_LINEAR */ + LINEAR_BT2020 = 25, + /** PRIMARIES_SRGB | TRANSFUNC_SRGB | RANGE_FULL */ + DISPLAY_SRGB = SRGB, + /** PRIMARIES_P3_D65 | TRANSFUNC_SRGB | RANGE_FULL */ + DISPLAY_P3_SRGB = DISPLAY_P3, + /** PRIMARIES_P3_D65 | TRANSFUNC_HLG | RANGE_FULL */ + DISPLAY_P3_HLG = P3_HLG, + /** PRIMARIES_DISPLAY_P3 | TRANSFUNC_PQ | RANGE_FULL */ + DISPLAY_P3_PQ = P3_PQ, + /** Indicates a customized color space. */ + CUSTOM = 5, +} ColorSpaceName; + +/** + * @brief Describes the primary colors red, green, blue and white point coordinated as (x, y) + * in color space, in terms of real world chromaticities. + * @since 13 + */ +typedef struct { + /** Coordinate value x of red color */ + float rX; + /** Coordinate value y of red color */ + float rY; + /** Coordinate value x of green color */ + float gX; + /** Coordinate value y of green color */ + float gY; + /** Coordinate value x of blue color */ + float bX; + /** Coordinate value y of blue color */ + float bY; + /** Coordinate value x of white point */ + float wX; + /** Coordinate value y of white point */ + float wY; +} ColorSpacePrimaries; + +/** + * @brief Indicates white point coordinated as (x, y) return array. + * @since 13 + */ +typedef struct { + /** Indicates white point return array */ + float arr[2]; +} WhitePointArray; + +/** + * @brief Creates a NativeColorSpaceManager instance by colorSpaceName. + * A new NativeColorSpaceManager instance is created each time this function is called. + * + * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core + * @param colorSpaceName Indicates the NativeColorSpace connection name. + * @return Returns the pointer to the NativeColorSpaceManager instance created. + * Creation failed, cause memory shortage. + * @since 13 + * @version 1.0 + */ +OH_NativeColorSpaceManager* OH_NativeColorSpaceManager_CreateFromName(ColorSpaceName colorSpaceName); + +/** + * @brief Creates a NativeColorSpaceManager instance by primaries and gamma. + * A new NativeColorSpaceManager instance is created each time this function is called. + * + * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core + * @param primaries Indicates the NativeColorSpace connection primaries. + * @param gamma Indicates the NativeColorSpace connection gamma. + * @return Returns the pointer to the NativeColorSpaceManager instance created. + * Creation failed, cause memory shortage. + * @since 13 + * @version 1.0 + */ +OH_NativeColorSpaceManager* OH_NativeColorSpaceManager_CreateFromPrimariesAndGamma( + ColorSpacePrimaries primaries, float gamma); + +/** + * @brief Delete the NativeColorSpaceManager instance. + * + * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core + * @param nativeColorSpaceManager Indicates the pointer to a NativeColorSpaceManager instance. + * @since 13 + * @version 1.0 + */ +void OH_NativeColorSpaceManager_Destroy(OH_NativeColorSpaceManager* nativeColorSpaceManager); + +/** + * @brief Get colorSpace name. + * + * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core + * @param nativeColorSpaceManager Indicates the pointer to a NativeColorSpaceManager instance. + * @return Returns value, return value > 0 && value <= 25, success, return value == 0 , failed. + * @since 13 + * @version 1.0 + */ +int OH_NativeColorSpaceManager_GetColorSpaceName( + OH_NativeColorSpaceManager* nativeColorSpaceManager); + +/** + * @brief Get white point. + * + * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core + * @param nativeColorSpaceManager Indicates the pointer to a NativeColorSpaceManager instance. + * @return Returns float array, return array = <0.f, 0.f>, failed, otherwise, true. + * @since 13 + * @version 1.0 + */ +WhitePointArray OH_NativeColorSpaceManager_GetWhitePoint( + OH_NativeColorSpaceManager* nativeColorSpaceManager); + +/** + * @brief Get gamma. + * + * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core + * @param nativeColorSpaceManager Indicates the pointer to a NativeColorSpaceManager instance. + * @return Returns float, return value == 0.f, failed, otherwise, true. + * @since 13 + * @version 1.0 + */ +float OH_NativeColorSpaceManager_GetGamma(OH_NativeColorSpaceManager* nativeColorSpaceManager); + +#ifdef __cplusplus +} +#endif + +/** @} */ +#endif \ No newline at end of file -- Gitee From 167668f5aae2cd58fcf1ba1eb82560e41c5b0bd1 Mon Sep 17 00:00:00 2001 From: ustc-tianyu Date: Wed, 4 Sep 2024 10:10:38 +0800 Subject: [PATCH 265/620] add fontVariation C API Signed-off-by: ustc-tianyu --- .../native_drawing/drawing_typeface.h | 84 ++++++++++++++++++- .../graphic_2d/native_drawing/drawing_types.h | 8 ++ .../native_drawing/libnative_drawing.ndk.json | 20 +++++ 3 files changed, 110 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_typeface.h b/graphic/graphic_2d/native_drawing/drawing_typeface.h index 0208f5ff9..fa3d016e9 100644 --- a/graphic/graphic_2d/native_drawing/drawing_typeface.h +++ b/graphic/graphic_2d/native_drawing/drawing_typeface.h @@ -40,6 +40,7 @@ * @version 1.0 */ +#include "drawing_error_code.h" #include "drawing_types.h" #ifdef __cplusplus @@ -57,7 +58,7 @@ extern "C" { OH_Drawing_Typeface* OH_Drawing_TypefaceCreateDefault(void); /** - * @brief Creates a OH_Drawing_Typeface object by file. + * @brief Creates an OH_Drawing_Typeface object by file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param path file path. @@ -69,7 +70,44 @@ OH_Drawing_Typeface* OH_Drawing_TypefaceCreateDefault(void); OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromFile(const char* path, int index); /** - * @brief Creates a OH_Drawing_Typeface object by given a stream. If the stream is not a valid + * @brief Creates an OH_Drawing_Typeface object with the specified font arguments from a file. + * If the OH_Drawing_Typeface object does not support the variations described in fontArguments, + * this function creates an OH_Drawing_Typeface object without font arguments. + * In this case, this function provides the same capability as {@link OH_Drawing_TypefaceCreateFromFile}. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param path Indicates the file path. + * @param fontArguments Indicates the pointer to an OH_Drawing_FontArguments object. + * @return Returns the pointer to the OH_Drawing_Typeface object created. + * If nullptr is returned, the creation fails. + * The possible cause of the failure is that the available memory is empty, + * or either path or fontArguments is nullptr, or the path is invalid. + * @since 13 + * @version 1.0 + */ +OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromFileWithArguments(const char* path, + const OH_Drawing_FontArguments* fontArguments); + +/** + * @brief Creates an OH_Drawing_Typeface object with the specified font arguments from + * an existing OH_Drawing_Typeface object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param current Indicates the existing OH_Drawing_Typeface object. + * @param fontArguments Indicates the pointer to an OH_Drawing_FontArguments object. + * @return Returns the pointer to the OH_Drawing_Typeface object created. + * If nullptr is returned, the creation fails. + * The possible cause of the failure is that the available memory is empty, + * or either current or fontArguments is nullptr, + * or current does not support the variations described in fontArguments. + * @since 13 + * @version 1.0 + */ +OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromCurrent(const OH_Drawing_Typeface* current, + const OH_Drawing_FontArguments* fontArguments); + +/** + * @brief Creates an OH_Drawing_Typeface object by given a stream. If the stream is not a valid * font file, returns nullptr. Ownership of the stream is transferred, so the caller must not reference * it or free it again. * @@ -92,6 +130,48 @@ OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromStream(OH_Drawing_MemoryStream */ void OH_Drawing_TypefaceDestroy(OH_Drawing_Typeface*); +/** + * @brief Creates an OH_Drawing_FontArguments object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @return Returns the pointer to the OH_Drawing_FontArguments object created. + * If nullptr is returned, the creation fails. + * The possible cause of the failure is that the available memory is empty. + * @since 13 + * @version 1.0 + */ +OH_Drawing_FontArguments* OH_Drawing_FontArgumentsCreate(void); + +/** + * @brief Adds a font variation axis for an OH_Drawing_FontArguments object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param fontArguments Indicates the pointer to an OH_Drawing_FontArguments object. + * @param axis Indicates the axis tag, which must contain four ASCII characters. + * @param value Indicates the value of the axis field. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if either fontArguments or axis is nullptr, + * or the length of axis is not 4. + * @since 13 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_FontArgumentsAddVariation(OH_Drawing_FontArguments* fontArguments, + const char* axis, float value); + +/** + * @brief Destroys an OH_Drawing_FontArguments object and reclaims the memory occupied by the object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param fontArguments Indicates the pointer to an OH_Drawing_FontArguments object. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if fontArguments is nullptr. + * @since 13 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_FontArgumentsDestroy(OH_Drawing_FontArguments* fontArguments); + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h index e040acdfc..a505833ac 100644 --- a/graphic/graphic_2d/native_drawing/drawing_types.h +++ b/graphic/graphic_2d/native_drawing/drawing_types.h @@ -240,6 +240,14 @@ typedef struct OH_Drawing_Font OH_Drawing_Font; */ typedef struct OH_Drawing_MemoryStream OH_Drawing_MemoryStream; +/** + * @brief Defines fontArguments, which is used to describe the arguments for a font. + * + * @since 13 + * @version 1.0 + */ +typedef struct OH_Drawing_FontArguments OH_Drawing_FontArguments; + /** * @brief Defines a typeface, which is used to describe the typeface. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 9c5b0d269..81d6f7021 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -176,6 +176,18 @@ }, { "name": "OH_Drawing_FilterSetMaskFilter" }, { "name": "OH_Drawing_FilterDestroy" }, + { + "first_introduced": "13", + "name": "OH_Drawing_FontArgumentsAddVariation" + }, + { + "first_introduced": "13", + "name": "OH_Drawing_FontArgumentsCreate" + }, + { + "first_introduced": "13", + "name": "OH_Drawing_FontArgumentsDestroy" + }, { "name": "OH_Drawing_FontCreate" }, { "name": "OH_Drawing_FontDestroy" }, { @@ -680,7 +692,15 @@ { "name": "OH_Drawing_MemoryStreamCreate" }, { "name": "OH_Drawing_MemoryStreamDestroy" }, { "name": "OH_Drawing_TypefaceCreateDefault" }, + { + "first_introduced": "13", + "name": "OH_Drawing_TypefaceCreateFromCurrent" + }, { "name": "OH_Drawing_TypefaceCreateFromFile" }, + { + "first_introduced": "13", + "name": "OH_Drawing_TypefaceCreateFromFileWithArguments" + }, { "name": "OH_Drawing_TypefaceCreateFromStream" }, { "name": "OH_Drawing_TypefaceDestroy" }, { "name": "OH_Drawing_CreateTypographyHandler" }, -- Gitee From a481d10b11cc7c856832c9e7b4970f0258118e54 Mon Sep 17 00:00:00 2001 From: bluhuang Date: Wed, 11 Sep 2024 22:38:01 +0800 Subject: [PATCH 266/620] change enum type name Change-Id: I4097658a6c43b38ee1a8f2826663752582398c10 Signed-off-by: bluhuang --- .../preferences/include/oh_preferences_value.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/distributeddatamgr/preferences/include/oh_preferences_value.h b/distributeddatamgr/preferences/include/oh_preferences_value.h index c1a0e3579..945e28fc6 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_value.h +++ b/distributeddatamgr/preferences/include/oh_preferences_value.h @@ -55,23 +55,23 @@ typedef enum Preference_ValueType { /** * @brief Null. */ - TYPE_NULL = 0, + PREFERENCE_TYPE_NULL = 0, /** * @brief Int. */ - TYPE_INT, + PREFERENCE_TYPE_INT, /** * @brief boolean. */ - TYPE_BOOL, + PREFERENCE_TYPE_BOOL, /** * @brief String. */ - TYPE_STRING, + PREFERENCE_TYPE_STRING, /** * @brief end butt. */ - TYPE_BUTT + PREFERENCE_TYPE_BUTT } Preference_ValueType; /** @@ -117,7 +117,7 @@ const OH_PreferencesValue *OH_PreferencesPair_GetPreferencesValue(const OH_Prefe * * @param object Pointer to the target {@Link OH_PreferencesValue} instance. * @return Returns the value type obtained. - * {@link TYPE_NULL} indicates invalid args are passed in. + * {@link PREFERENCE_TYPE_NULL} indicates invalid args are passed in. * @see OH_PreferencesValue. * @since 13 */ -- Gitee From faabb0fc5c73cad25a3a5c66b2e289c5473b99c9 Mon Sep 17 00:00:00 2001 From: huchang Date: Thu, 12 Sep 2024 11:07:43 +0800 Subject: [PATCH 267/620] add block detection query function Signed-off-by: huchang Change-Id: I3f7a7c7b61941fc88e0f7e8db22fd2ec6807e117 --- .../native_audio_routing_manager.h | 20 ++++++++++++++++++- multimedia/audio_framework/ohaudio.ndk.json | 4 ++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h index 2f44c5b11..e79aa1d24 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h @@ -255,7 +255,25 @@ typedef void (*OH_AudioRoutingManager_OnDeviceBlockStatusCallback)( void *userData); /** - * @brief Set the microphone block status callback. The caller will receive the callback only when it is recording + * @brief Query whether microphone block detection is supported on current device. + * + * @param audioRoutingManager the {@link OH_AudioRoutingManager} handle returned by + * {@link OH_AudioManager_GetAudioRoutingManager}. + * @param supported query result. + * @return Function result code: + * {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful. + * {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}: + * 1.The param of audioRoutingManager is nullptr; + * 2.The param of supported is nullptr. + * @since 13 + */ +OH_AudioCommon_Result OH_AudioRoutingManager_IsMicrophoneBlockDetectionSupported( + OH_AudioRoutingManager *audioRoutingManager, + bool *supported); + +/** + * @brief Set the microphone block status callback. Before using this function, users should query whether block + * detection is supported on current device. The caller will receive the callback only when it is recording * and the used microphones' block status have changed. Currently, block detecting is only support for microphones * located on the local device. * diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index d4f849c54..256f72c69 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -371,6 +371,10 @@ "first_introduced": "12", "name":"OH_AudioRenderer_SetDefaultOutputDevice" }, + { + "first_introduced": "13", + "name": "OH_AudioRoutingManager_IsMicrophoneBlockDetectionSupported" + }, { "first_introduced": "13", "name": "OH_AudioRoutingManager_SetMicrophoneBlockStatusCallback" -- Gitee From c628dd556bc41a4b21a9b2bd7010e0b5450218b5 Mon Sep 17 00:00:00 2001 From: huchang Date: Thu, 12 Sep 2024 11:35:52 +0800 Subject: [PATCH 268/620] abbr mic Signed-off-by: huchang Change-Id: I0c3ce24032686b76929171d7dfc60682e371e502 --- .../audio_manager/native_audio_routing_manager.h | 4 ++-- multimedia/audio_framework/ohaudio.ndk.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h index e79aa1d24..b5f363ac7 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h @@ -267,7 +267,7 @@ typedef void (*OH_AudioRoutingManager_OnDeviceBlockStatusCallback)( * 2.The param of supported is nullptr. * @since 13 */ -OH_AudioCommon_Result OH_AudioRoutingManager_IsMicrophoneBlockDetectionSupported( +OH_AudioCommon_Result OH_AudioRoutingManager_IsMicBlockDetectionSupported( OH_AudioRoutingManager *audioRoutingManager, bool *supported); @@ -288,7 +288,7 @@ OH_AudioCommon_Result OH_AudioRoutingManager_IsMicrophoneBlockDetectionSupported * 2.The param of callback is nullptr. * @since 13 */ -OH_AudioCommon_Result OH_AudioRoutingManager_SetMicrophoneBlockStatusCallback( +OH_AudioCommon_Result OH_AudioRoutingManager_SetMicBlockStatusCallback( OH_AudioRoutingManager *audioRoutingManager, OH_AudioRoutingManager_OnDeviceBlockStatusCallback callback, void *userData); diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 256f72c69..961c75dae 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -373,10 +373,10 @@ }, { "first_introduced": "13", - "name": "OH_AudioRoutingManager_IsMicrophoneBlockDetectionSupported" + "name": "OH_AudioRoutingManager_IsMicBlockDetectionSupported" }, { "first_introduced": "13", - "name": "OH_AudioRoutingManager_SetMicrophoneBlockStatusCallback" + "name": "OH_AudioRoutingManager_SetMicBlockStatusCallback" } ] -- Gitee From 08b8693cfd1eaf42919ede2a28b395455faea823 Mon Sep 17 00:00:00 2001 From: zhangwuf Date: Thu, 12 Sep 2024 16:26:15 +0800 Subject: [PATCH 269/620] =?UTF-8?q?=E4=B8=8D=E5=86=8D=E5=AF=B9NDK=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E5=90=8E=E7=9A=84=E7=89=B9=E5=AE=9A=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangwuf --- .../src/coreImpl/diff/diff_file.py | 23 +++++----- .../src/coreImpl/parser/parse_include.py | 44 +++++++++---------- 2 files changed, 33 insertions(+), 34 deletions(-) diff --git a/build-tools/capi_parser/src/coreImpl/diff/diff_file.py b/build-tools/capi_parser/src/coreImpl/diff/diff_file.py index 202841f38..e8f7d3d9c 100644 --- a/build-tools/capi_parser/src/coreImpl/diff/diff_file.py +++ b/build-tools/capi_parser/src/coreImpl/diff/diff_file.py @@ -292,7 +292,7 @@ def diff_list(old_file_list, new_file_list, old_dir, new_dir): def add_new_file(diff_file_path): if os.path.isdir(diff_file_path): add_file(diff_file_path) - elif filter_ignore_file(diff_file_path): + else: result_map = parse_file_result(diff_parser_include_ast(global_new_dir, [diff_file_path], flag=1)) for new_info in result_map.values(): diff_info_list.extend(judgment_entrance(None, new_info)) @@ -301,7 +301,7 @@ def add_new_file(diff_file_path): def del_old_file(diff_file_path): if os.path.isdir(diff_file_path): del_file(diff_file_path) - elif filter_ignore_file(diff_file_path): + else: result_map = parse_file_result(diff_parser_include_ast(global_old_dir, [diff_file_path], flag=0)) for old_info in result_map.values(): diff_info_list.extend(judgment_entrance(old_info, None)) @@ -324,14 +324,13 @@ def get_same_file_diff(target_file, old_file_list, new_file_list, old_dir, new_d def get_file_result_diff(old_target_file, new_target_file): - if filter_ignore_file(old_target_file): - old_file_result_map = parse_file_result(diff_parser_include_ast(global_old_dir, [old_target_file], flag=0)) - new_file_result_map = parse_file_result(diff_parser_include_ast(global_new_dir, [new_target_file], flag=1)) - if old_file_result_map and new_file_result_map: - merged_dict = OrderedDict(list(old_file_result_map.items()) + list(new_file_result_map.items())) - all_key_list = merged_dict.keys() - for key in all_key_list: - diff_info_list.extend(judgment_entrance(old_file_result_map.get(key), new_file_result_map.get(key))) + old_file_result_map = parse_file_result(diff_parser_include_ast(global_old_dir, [old_target_file], flag=0)) + new_file_result_map = parse_file_result(diff_parser_include_ast(global_new_dir, [new_target_file], flag=1)) + if old_file_result_map and new_file_result_map: + merged_dict = OrderedDict(list(old_file_result_map.items()) + list(new_file_result_map.items())) + all_key_list = merged_dict.keys() + for key in all_key_list: + diff_info_list.extend(judgment_entrance(old_file_result_map.get(key), new_file_result_map.get(key))) def del_file(dir_path): @@ -342,7 +341,7 @@ def del_file(dir_path): file_path = os.path.join(dir_path, i) if os.path.isdir(file_path): del_file(file_path) - if get_file_ext(i) == '.h' and filter_ignore_file(file_path): + if get_file_ext(i) == '.h': result_map = parse_file_result(diff_parser_include_ast(global_old_dir, [file_path], flag=0)) for old_info in result_map.values(): diff_info_list.extend(judgment_entrance(old_info, None)) @@ -356,7 +355,7 @@ def add_file(dir_path): file_path = os.path.join(dir_path, i) if os.path.isdir(file_path): add_file(file_path) - if get_file_ext(i) == '.h' and filter_ignore_file(file_path): + if get_file_ext(i) == '.h': result_map = parse_file_result(diff_parser_include_ast(global_new_dir, [file_path], flag=1)) for new_info in result_map.values(): diff_info_list.extend(judgment_entrance(None, new_info)) diff --git a/build-tools/capi_parser/src/coreImpl/parser/parse_include.py b/build-tools/capi_parser/src/coreImpl/parser/parse_include.py index 841af8f82..c27ef98f7 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/parse_include.py +++ b/build-tools/capi_parser/src/coreImpl/parser/parse_include.py @@ -260,7 +260,7 @@ def get_node_class_name(data): return class_name -def processing_special_node(cursor, data, key, gn_path): # 处理需要特殊处理的节点 +def processing_special_node(cursor, data, key, directory_path): # 处理需要特殊处理的节点 if key == 0: location_path = cursor.spelling kind_name = CursorKind.TRANSLATION_UNIT.name @@ -273,15 +273,15 @@ def processing_special_node(cursor, data, key, gn_path): # 处理需要特殊 "location_line": cursor.location.line, "location_column": cursor.location.column } - if gn_path: - relative_path = os.path.relpath(location_path, gn_path) # 获取头文件相对路 + if directory_path: + relative_path = os.path.relpath(location_path, directory_path) # 获取头文件相对路 loc["location_path"] = relative_path data["location"] = loc data["class_name"] = get_node_class_name(data) data["unique_id"] = get_api_unique_id(cursor, loc, data) if key == 0: data["unique_id"] = data["name"] - syntax_error_message = diagnostic_callback(cursor.translation_unit.diagnostics, gn_path) + syntax_error_message = diagnostic_callback(cursor.translation_unit.diagnostics, directory_path) data["syntax_error"] = syntax_error_message if kind_name in special_node_process.keys(): node_process = special_node_process[kind_name] @@ -321,12 +321,12 @@ def define_comment(cursor, current_file, data): data['comment'] = matches.group() -def get_default_node_data(cursor, gn_path): +def get_default_node_data(cursor, directory_path): data = { "name": cursor.spelling, "kind": '', "type": cursor.type.spelling, - "gn_path": gn_path, + "gn_path": directory_path, "node_content": {}, "comment": '', "syscap": '', @@ -374,15 +374,15 @@ def diagnostic_callback(diagnostic, dir_path): return syntax_error_message -def parser_data_assignment(cursor, current_file, gn_path, comment=None, key=0): - data = get_default_node_data(cursor, gn_path) +def parser_data_assignment(cursor, current_file, directory_path, comment=None, key=0): + data = get_default_node_data(cursor, directory_path) get_comment(cursor, data) if key == 0: data["kind"] = CursorKind.TRANSLATION_UNIT.name if comment: data["comment"] = comment - if gn_path: - relative_path = os.path.relpath(cursor.spelling, gn_path) + if directory_path: + relative_path = os.path.relpath(cursor.spelling, directory_path) data["name"] = relative_path else: content = node_extent(cursor, current_file) @@ -396,15 +396,15 @@ def parser_data_assignment(cursor, current_file, gn_path, comment=None, key=0): get_permission_value(data) get_module_name_value(data) get_deprecate_since_value(data) - processing_special_node(cursor, data, key, gn_path) # 节点处理 + processing_special_node(cursor, data, key, directory_path) # 节点处理 get_file_kit_or_system(data) return data -def ast_to_dict(cursor, current_file, last_data, gn_path, comment=None, key=0): # 解析数据的整理 +def ast_to_dict(cursor, current_file, last_data, directory_path, comment=None, key=0): # 解析数据的整理 # 通用赋值 - data = parser_data_assignment(cursor, current_file, gn_path, comment, key) + data = parser_data_assignment(cursor, current_file, directory_path, comment, key) if last_data: data['module_name'] = last_data['module_name'] data['kit_name'] = last_data['kit_name'] @@ -430,7 +430,7 @@ def ast_to_dict(cursor, current_file, last_data, gn_path, comment=None, key=0): and child.kind.name != CursorKind.MACRO_INSTANTIATION.name \ and child.kind.name != CursorKind.INCLUSION_DIRECTIVE.name \ and (child.location.file.name == current_file): - processing_ast_node(child, current_file, data, name, gn_path) + processing_ast_node(child, current_file, data, name, directory_path) else: if cursor.kind == CursorKind.FUNCTION_DECL: # 防止clang默认处理(对于头文件没有的情况)出现没有该键值对 data["parm"] = [] @@ -552,17 +552,17 @@ def get_comment(cursor, data: dict): data["comment"] = 'none_comment' -def processing_ast_node(child, current_file, data, name, gn_path): - child_data = ast_to_dict(child, current_file, data, gn_path, key=1) +def processing_ast_node(child, current_file, data, name, directory_path): + child_data = ast_to_dict(child, current_file, data, directory_path, key=1) if child.kind == CursorKind.TYPE_REF: data["type_ref"] = child_data else: data[name].append(child_data) -def preorder_travers_ast(cursor, comment, current_file, gn_path): # 获取属性 +def preorder_travers_ast(cursor, comment, current_file, directory_path): # 获取属性 previous_data = {} - ast_dict = ast_to_dict(cursor, current_file, previous_data, gn_path, comment) # 获取节点属性 + ast_dict = ast_to_dict(cursor, current_file, previous_data, directory_path, comment) # 获取节点属性 return ast_dict @@ -617,7 +617,7 @@ def get_start_comments(include_path): # 获取每个头文件的最开始注释 return content -def api_entrance(share_lib, include_path, gn_path, link_path): # 统计入口 +def api_entrance(share_lib, include_path, directory_path, link_path): # 统计入口 # clang.cindex需要用到libclang.dll共享库 所以配置共享库 if not Config.loaded: Config.set_library_file(share_lib) @@ -636,7 +636,7 @@ def api_entrance(share_lib, include_path, gn_path, link_path): # 统计入口 ast_root_node = tu.cursor # 获取根节点 matches = get_start_comments(item) # 接收文件最开始的注释 # 前序遍历AST - file_result_data = preorder_travers_ast(ast_root_node, matches, item, gn_path) # 调用处理函数 + file_result_data = preorder_travers_ast(ast_root_node, matches, item, directory_path) # 调用处理函数 data_total.append(file_result_data) iter_line_dist = iter(line_dist) first = next(iter_line_dist) @@ -648,12 +648,12 @@ def api_entrance(share_lib, include_path, gn_path, link_path): # 统计入口 return data_total -def get_include_file(include_file_path, link_path, gn_path): # 库路径、.h文件路径、链接头文件路径 +def get_include_file(include_file_path, link_path, directory_path): # 库路径、.h文件路径、链接头文件路径 # libclang.dll库路径 libclang_path = StringConstant.LIB_CLG_PATH.value # c头文件的路径 file_path = include_file_path # 头文件链接路径 link_include_path = link_path # 可以通过列表传入 - data = api_entrance(libclang_path, file_path, gn_path, link_include_path) # 调用接口 + data = api_entrance(libclang_path, file_path, directory_path, link_include_path) # 调用接口 return data -- Gitee From 2b6f1dcc3e3906749ef667aa66ac84e16c61eb1b Mon Sep 17 00:00:00 2001 From: lsh <450972247@qq.com> Date: Fri, 13 Sep 2024 12:42:01 +0800 Subject: [PATCH 270/620] =?UTF-8?q?lsh=20native=5Fnode.h=20=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lsh <450972247@qq.com> Change-Id: I0689a2297ad1f95d60813e7e669ec1c771d6fee1 --- arkui/ace_engine/native/native_node.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index b5e8f080d..ca9b8cb20 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -7500,7 +7500,7 @@ typedef struct ArkUI_NodeContentEvent ArkUI_NodeContentEvent; typedef void (*ArkUI_NodeContentCallback)(ArkUI_NodeContentEvent* event); /** - * @brief register a callback functoin to a node content. + * @brief register a callback function to a node content. * * @param content Indicates the pointer to the node content instance. * @param callback Indicates the callback function. @@ -7567,7 +7567,7 @@ int32_t OH_ArkUI_NodeContent_AddNode(ArkUI_NodeContentHandle content, ArkUI_Node * * @param content Indicates the pointer to the node content instance. * @param node Indicates the pointer to the node - * @return Returns the error code. + * @return Returns the error code. * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. * @since 12 -- Gitee From 4e0027d18055dded98386d0a1b449886a24d4d8f Mon Sep 17 00:00:00 2001 From: yaozhupeng Date: Fri, 13 Sep 2024 15:12:06 +0800 Subject: [PATCH 271/620] add pixelmap interface Signed-off-by: yaozhupeng --- .../image_framework/include/image/image_common.h | 4 ++++ .../include/image/pixelmap_native.h | 14 ++++++++++++++ multimedia/image_framework/libpixelmap.ndk.json | 4 ++++ 3 files changed, 22 insertions(+) diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index b9173661c..b6cf5943d 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -165,6 +165,10 @@ typedef enum { IMAGE_UNSUPPORTED_CONVERSION = 7600203, /** invalid region */ IMAGE_INVALID_REGION = 7600204, + /** @error unsupported memory format + * @since 13 + */ + IMAGE_UNSUPPORTED_MEMORY_FORMAT = 7600205, /** failed to allocate memory */ IMAGE_ALLOC_FAILED = 7600301, /** memory copy failed */ diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 0e5956cfe..dfadc930b 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -834,6 +834,20 @@ Image_ErrorCode OH_PixelmapNative_SetMetadata(OH_PixelmapNative *pixelmap, OH_Pi */ Image_ErrorCode OH_PixelmapNative_GetNativeBuffer(OH_PixelmapNative *pixelmap, OH_NativeBuffer **nativeBuffer); +/** + * @brief Set pixelmap memory name. + * + * @param pixelmap The Pixelmap pointer to be operated. + * @param name The pointer of name that needs to be set. + * @param size The size of name size that needs to be set. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the operation is successful. + * {@link IMAGE_BAD_PARAMETER} If invalid parameter, name and size are incorrect. + * {@link IMAGE_UNSUPPORTED_MEMORY_FORMAT} If memory format is unsupported. + * @see OH_PixelmapNative + * @since 13 + */ +Image_ErrorCode OH_PixelmapNative_SetMemoryName(OH_PixelmapNative *pixelmap, char *name, size_t *size); #ifdef __cplusplus }; #endif diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index 78c1a0235..add12ebb4 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -166,5 +166,9 @@ { "first_introduced": "12", "name": "OH_PixelmapNative_ConvertPixelmapNativeFromNapi" + }, + { + "first_introduced": "13", + "name": "OH_PixelmapNative_SetMemoryName" } ] \ No newline at end of file -- Gitee From 8d653652893ffefe65a5599c378f4feef8963746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Fri, 13 Sep 2024 18:05:36 +0800 Subject: [PATCH 272/620] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=B0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../include/image/pixelmap_native.h | 14 ++++++++++++++ multimedia/image_framework/libpixelmap.ndk.json | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 0e5956cfe..eeaf48c9f 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -643,6 +643,20 @@ Image_ErrorCode OH_PixelmapNative_ConvertPixelmapNativeFromNapi(napi_env env, na */ Image_ErrorCode OH_PixelmapNative_ReadPixels(OH_PixelmapNative *pixelmap, uint8_t *destination, size_t *bufferSize); +/** + * @brief Reads the pixel data of a PixelMap into a buffer. The data read is in ARGB_8888 format. + * + * @param pixelmap The PixelMap pointer to be operated. + * @param destination Buffer to which the image PixelMap data will be written. + * @param bufferSize Buffer size to which the image PixelMap data will be written. + * @return Returns {@link Image_ErrorCode} IMAGE_RESULT_SUCCESS - if the operation is successful. + * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if invalid parameter, pixelmap, destination, or bufferSize is + * null. + * @see OH_PixelmapNative + * @since 13 + */ +Image_ErrorCode OH_PixelmapNative_ReadARGBPixels(OH_PixelmapNative *pixelmap, uint8_t *destination, size_t *bufferSize); + /** * @brief Reads image data in an Buffer and writes the data to a Pixelmap object. * diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index 78c1a0235..cc03f82ba 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -95,6 +95,10 @@ "first_introduced": "12", "name": "OH_PixelmapNative_ReadPixels" }, + { + "first_introduced": "13", + "name": "OH_PixelmapNative_ReadARGBPixels" + }, { "first_introduced": "12", "name": "OH_PixelmapNative_WritePixels" -- Gitee From 346354d3ad2b552eab164eaa2d888d8d0d4d7fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Fri, 13 Sep 2024 18:13:49 +0800 Subject: [PATCH 273/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../include/image/pixelmap_native.h | 31 ++++++++++--------- .../image_framework/libpixelmap.ndk.json | 8 ++--- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index eeaf48c9f..f3c5f66bc 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -643,20 +643,6 @@ Image_ErrorCode OH_PixelmapNative_ConvertPixelmapNativeFromNapi(napi_env env, na */ Image_ErrorCode OH_PixelmapNative_ReadPixels(OH_PixelmapNative *pixelmap, uint8_t *destination, size_t *bufferSize); -/** - * @brief Reads the pixel data of a PixelMap into a buffer. The data read is in ARGB_8888 format. - * - * @param pixelmap The PixelMap pointer to be operated. - * @param destination Buffer to which the image PixelMap data will be written. - * @param bufferSize Buffer size to which the image PixelMap data will be written. - * @return Returns {@link Image_ErrorCode} IMAGE_RESULT_SUCCESS - if the operation is successful. - * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if invalid parameter, pixelmap, destination, or bufferSize is - * null. - * @see OH_PixelmapNative - * @since 13 - */ -Image_ErrorCode OH_PixelmapNative_ReadARGBPixels(OH_PixelmapNative *pixelmap, uint8_t *destination, size_t *bufferSize); - /** * @brief Reads image data in an Buffer and writes the data to a Pixelmap object. * @@ -668,6 +654,23 @@ Image_ErrorCode OH_PixelmapNative_ReadARGBPixels(OH_PixelmapNative *pixelmap, ui */ Image_ErrorCode OH_PixelmapNative_WritePixels(OH_PixelmapNative *pixelmap, uint8_t *source, size_t bufferSize); +/** + * @brief Get argb pixel buffer from pixelmap. + * + * @param pixelmap The Pixelmap pointer to be operated. + * @param destination Buffer to which the image pixel map data will be written. + * @param bufferSize Buffer size to which the image pixel map data will be written. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the operation is successful. + * {@link IMAGE_BAD_PARAMETER} If invalid parameter, destination and bufferSize are incorrect. + * {@link IMAGE_UNSUPPORTED_CONVERSION} If format does not support conversion to argb or conversion failed. + * {@link IMAGE_ALLOC_FAILED} If device has no memory. + * {@link IMAGE_COPY_FAILED} If memory copy failed. + * @see OH_PixelmapNative + * @since 13 + */ +Image_ErrorCode OH_PixelmapNative_GetArgbPixels(OH_PixelmapNative *pixelmap, uint8_t *destination, size_t *bufferSize); + /** * @brief Convert {@link OH_PixelmapNative} to standard dynamic range. * diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index cc03f82ba..fe644851c 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -95,14 +95,14 @@ "first_introduced": "12", "name": "OH_PixelmapNative_ReadPixels" }, - { - "first_introduced": "13", - "name": "OH_PixelmapNative_ReadARGBPixels" - }, { "first_introduced": "12", "name": "OH_PixelmapNative_WritePixels" }, + { + "first_introduced": "13", + "name": "OH_PixelmapNative_GetArgbPixels" + }, { "first_introduced": "12", "name": "OH_PixelmapNative_ToSdr" -- Gitee From d807e93c9a88f8917fc2e8c2fd191bee3cac94da Mon Sep 17 00:00:00 2001 From: wanjining Date: Sat, 14 Sep 2024 17:27:04 +0800 Subject: [PATCH 274/620] =?UTF-8?q?=E3=80=90CAPI=E3=80=91imageSpan?= =?UTF-8?q?=E6=96=B0=E5=A2=9Ebaseline=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanjining --- arkui/ace_engine/native/native_node.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index ca9b8cb20..d6e4b89e1 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -2286,6 +2286,21 @@ typedef enum { * */ NODE_IMAGE_SPAN_ALT, + /** + * @brief Defines the baseline offset attribute of the ImageSpan component. + * This attribute can be set, reset, and obtained as required through APIs. + * A positive value means an upward offset, while a negative value means a downward offset. + * The default value is 0, and the unit is fp. \n + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: baseline offset, in fp.\n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: baseline offset, in fp. \n + * + * @since 13 + */ + NODE_IMAGE_SPAN_BASELINE_OFFSET = 3003, /** * @brief Defines the image source of the component. * This attribute can be set, reset, and obtained as required through APIs. -- Gitee From ea0f4cc777667162ef9f2a46e969034d96151eb9 Mon Sep 17 00:00:00 2001 From: liushang Date: Sat, 14 Sep 2024 20:22:13 +0800 Subject: [PATCH 275/620] colorspace name Signed-off-by: liushang --- multimedia/video_processing_engine/image_processing_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index f05531332..d42f56586 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -150,7 +150,7 @@ extern const char* IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL; typedef struct ImageProcessing_ColorSpaceInfo { /** define metadata type, {@link enum OH_Pixelmap_HdrMetadataKey} */ int32_t metadataType; - /** define color space */ + /** define color space, {@link enum ColorSpaceName} */ int32_t colorSpace; /** define pixel format, {@link enum PIXEL_FORMAT} */ int32_t pixelFormat; -- Gitee From 3a7f02254ec7ac72997127ff6434b0317d4b63c4 Mon Sep 17 00:00:00 2001 From: z30049243 Date: Sun, 15 Sep 2024 16:04:43 +0800 Subject: [PATCH 276/620] =?UTF-8?q?=E6=97=8B=E8=BD=ACndk=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?js=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: z30049243 --- multimedia/camera_framework/camera.ndk.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index 50cc20db4..e5faf336c 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -487,6 +487,10 @@ "first_introduced": "12", "name": "OH_PhotoOutput_EnableMovingPhoto" }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_GetPhotoRotation" + }, { "first_introduced": "11", "name": "OH_PreviewOutput_RegisterCallback" @@ -531,6 +535,14 @@ "first_introduced": "12", "name": "OH_PreviewOutput_GetActiveFrameRate" }, + { + "first_introduced": "12", + "name": "OH_PreviewOutput_GetPreviewRotation" + }, + { + "first_introduced": "12", + "name": "OH_PreviewOutput_SetPreviewRotation" + }, { "first_introduced": "11", "name": "OH_VideoOutput_RegisterCallback" @@ -575,6 +587,10 @@ "first_introduced": "12", "name": "OH_VideoOutput_GetActiveFrameRate" }, + { + "first_introduced": "12", + "name": "OH_VideoOutput_GetVideoRotation" + }, { "first_introduced": "12", "name": "OH_CameraDevice_GetCameraOrientation" -- Gitee From c1481408d871e0ade2c500e95b2e2895ddc24c31 Mon Sep 17 00:00:00 2001 From: lihui Date: Wed, 11 Sep 2024 17:34:58 +0800 Subject: [PATCH 277/620] =?UTF-8?q?=E6=96=B0=E5=A2=9Enative=20window?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lihui --- .../graphic_2d/native_buffer/native_buffer.h | 26 +++---- .../graphic_2d/native_image/native_image.h | 34 ++++----- .../native_window/external_window.h | 75 ++++++++++--------- 3 files changed, 71 insertions(+), 64 deletions(-) diff --git a/graphic/graphic_2d/native_buffer/native_buffer.h b/graphic/graphic_2d/native_buffer/native_buffer.h index aee47ec3f..154df76d3 100644 --- a/graphic/graphic_2d/native_buffer/native_buffer.h +++ b/graphic/graphic_2d/native_buffer/native_buffer.h @@ -290,7 +290,7 @@ typedef struct { * A new OH_NativeBuffer instance is created each time this function is called.\n * This interface needs to be used in conjunction with OH_NativeBuffer_Unreference<\b>, * otherwise memory leaks will occur.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param config Indicates the pointer to a BufferRequestConfig instance. @@ -305,7 +305,7 @@ OH_NativeBuffer* OH_NativeBuffer_Alloc(const OH_NativeBuffer_Config* config); * @brief Adds the reference count of a OH_NativeBuffer.\n * This interface needs to be used in conjunction with OH_NativeBuffer_Unreference<\b>, * otherwise memory leaks will occur.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -318,7 +318,7 @@ int32_t OH_NativeBuffer_Reference(OH_NativeBuffer *buffer); /** * @brief Decreases the reference count of a OH_NativeBuffer and, when the reference count reaches 0, * destroys this OH_NativeBuffer.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -330,7 +330,7 @@ int32_t OH_NativeBuffer_Unreference(OH_NativeBuffer *buffer); /** * @brief Return a config of the OH_NativeBuffer in the passed OHNativeBufferConfig struct.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -344,7 +344,7 @@ void OH_NativeBuffer_GetConfig(OH_NativeBuffer *buffer, OH_NativeBuffer_Config* /** * @brief Provide direct cpu access to the OH_NativeBuffer in the process's address space.\n * This interface needs to be used in conjunction with OH_NativeBuffer_Unmap<\b>.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -358,7 +358,7 @@ int32_t OH_NativeBuffer_Map(OH_NativeBuffer *buffer, void **virAddr); /** * @brief Remove direct cpu access ability of the OH_NativeBuffer in the process's address space.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -370,7 +370,7 @@ int32_t OH_NativeBuffer_Unmap(OH_NativeBuffer *buffer); /** * @brief Get the systen wide unique sequence number of the OH_NativeBuffer.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -382,7 +382,7 @@ uint32_t OH_NativeBuffer_GetSeqNum(OH_NativeBuffer *buffer); /** * @brief Provide direct cpu access to the potentially multi-plannar OH_NativeBuffer in the process's address space.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -396,7 +396,7 @@ int32_t OH_NativeBuffer_MapPlanes(OH_NativeBuffer *buffer, void **virAddr, OH_Na /** * @brief Converts an OHNativeWindowBuffer instance to an OH_NativeBuffer.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param nativeWindowBuffer Indicates the pointer to a OHNativeWindowBuffer instance. @@ -409,7 +409,7 @@ int32_t OH_NativeBuffer_FromNativeWindowBuffer(OHNativeWindowBuffer *nativeWindo /** * @brief Set the color space of the OH_NativeBuffer.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -422,7 +422,7 @@ int32_t OH_NativeBuffer_SetColorSpace(OH_NativeBuffer *buffer, OH_NativeBuffer_C /** * @brief Get the color space of the OH_NativeBuffer.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -437,7 +437,7 @@ int32_t OH_NativeBuffer_GetColorSpace(OH_NativeBuffer *buffer, OH_NativeBuffer_C /** * @brief Set the metadata type of the OH_NativeBuffer.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. @@ -456,7 +456,7 @@ int32_t OH_NativeBuffer_SetMetadataValue(OH_NativeBuffer *buffer, OH_NativeBuffe /** * @brief Set the metadata type of the OH_NativeBuffer.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer * @param buffer Indicates the pointer to a OH_NativeBuffer instance. diff --git a/graphic/graphic_2d/native_image/native_image.h b/graphic/graphic_2d/native_image/native_image.h index eca8af106..cc8653a64 100644 --- a/graphic/graphic_2d/native_image/native_image.h +++ b/graphic/graphic_2d/native_image/native_image.h @@ -81,7 +81,7 @@ typedef struct OH_OnFrameAvailableListener { * @brief Create a OH_NativeImage related to an Opengl ES texture and target. \n * This interface needs to be used in conjunction with OH_NativeImage_Destroy<\b>, * otherwise memory leaks will occur.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param textureId Indicates the id of the Opengl ES texture which the native image attached to. @@ -95,7 +95,7 @@ OH_NativeImage* OH_NativeImage_Create(uint32_t textureId, uint32_t textureTarget /** * @brief Acquire the OHNativeWindow for the OH_NativeImage.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -108,7 +108,7 @@ OHNativeWindow* OH_NativeImage_AcquireNativeWindow(OH_NativeImage* image); /** * @brief Attach the OH_NativeImage to Opengl ES context, and the Opengl ES texture is bound to the \n * GL_TEXTURE_EXTERNAL_OES, which will update by the OH_NativeImage.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -121,7 +121,7 @@ int32_t OH_NativeImage_AttachContext(OH_NativeImage* image, uint32_t textureId); /** * @brief Detach the OH_NativeImage from the Opengl ES context.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -136,7 +136,7 @@ int32_t OH_NativeImage_DetachContext(OH_NativeImage* image); * @brief Update the related Opengl ES texture with the OH_NativeImage acquired buffer.\n * This interface needs to be called in the Opengl ES context thread.\n * This interface needs to be called after receiving the OH_OnFrameAvailableListener<\b> callback.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -148,7 +148,7 @@ int32_t OH_NativeImage_UpdateSurfaceImage(OH_NativeImage* image); /** * @brief Get the timestamp of the texture image set by the most recent call to OH_NativeImage_UpdateSurfaceImage.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -175,7 +175,7 @@ int32_t OH_NativeImage_GetTransformMatrix(OH_NativeImage* image, float matrix[16 /** * @brief Return the native image's surface id.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -189,7 +189,7 @@ int32_t OH_NativeImage_GetSurfaceId(OH_NativeImage* image, uint64_t* surfaceId); /** * @brief Set the frame available callback.\n * Not allow calling other interfaces in the callback function.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -202,7 +202,7 @@ int32_t OH_NativeImage_SetOnFrameAvailableListener(OH_NativeImage* image, OH_OnF /** * @brief Unset the frame available callback.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -215,7 +215,7 @@ int32_t OH_NativeImage_UnsetOnFrameAvailableListener(OH_NativeImage* image); /** * @brief Destroy the OH_NativeImage created by OH_NativeImage_Create, and the pointer to * OH_NativeImage will be null after this operation.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage pointer. @@ -227,7 +227,7 @@ void OH_NativeImage_Destroy(OH_NativeImage** image); /** * @brief Obtains the transform matrix of the texture image by producer transform type.\n * The matrix will not be update until OH_NativeImage_UpdateSurfaceImage<\b> is called.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -250,7 +250,7 @@ int32_t OH_NativeImage_GetTransformMatrixV2(OH_NativeImage* image, float matrix[ * This interface needs to be used in conjunction with OH_NativeImage_ReleaseNativeWindowBuffer<\b>, * otherwise memory leaks will occur.\n * When the fenceFd is used up, you need to close it.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -269,7 +269,7 @@ int32_t OH_NativeImage_AcquireNativeWindowBuffer(OH_NativeImage* image, * @brief Release the OHNativeWindowBuffer to the buffer queue through an * OH_NativeImage instance for reuse.\n * The fenceFd will be close by system.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -290,7 +290,7 @@ int32_t OH_NativeImage_ReleaseNativeWindowBuffer(OH_NativeImage* image, * This method can not be used at the same time with OH_NativeImage_UpdateSurfaceImage.\n * This interface needs to be used in conjunction with OH_NativeImage_Destroy<\b>, * otherwise memory leaks will occur.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @return Returns the pointer to the OH_NativeImage instance created if the operation is successful, \n @@ -298,11 +298,11 @@ int32_t OH_NativeImage_ReleaseNativeWindowBuffer(OH_NativeImage* image, * @since 12 * @version 1.0 */ -OH_NativeImage* OH_ConsumerSurface_Create(); +OH_NativeImage* OH_ConsumerSurface_Create(void); /** * @brief Set the default usage of the OH_NativeImage.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. @@ -316,7 +316,7 @@ int32_t OH_ConsumerSurface_SetDefaultUsage(OH_NativeImage* image, uint64_t usage /** * @brief Set the default size of the OH_NativeImage.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage * @param image Indicates the pointer to a OH_NativeImage instance. diff --git a/graphic/graphic_2d/native_window/external_window.h b/graphic/graphic_2d/native_window/external_window.h index b8717daf2..ef2144879 100644 --- a/graphic/graphic_2d/native_window/external_window.h +++ b/graphic/graphic_2d/native_window/external_window.h @@ -117,25 +117,25 @@ typedef enum NativeWindowOperation { /** * get native window buffer format, * variable parameter in function is - * [out] int32_t *format + * [out] int32_t *format, the enumeration value refers to {@link OH_NativeBuffer_Format}. */ GET_FORMAT, /** * set native window buffer format, * variable parameter in function is - * [in] int32_t format + * [in] int32_t format, the enumeration value refers to {@link OH_NativeBuffer_Format}. */ SET_FORMAT, /** * get native window buffer usage, * variable parameter in function is - * [out] uint64_t *usage. + * [out] uint64_t *usage, the enumeration value refers to {@link OH_NativeBuffer_Usage}. */ GET_USAGE, /** * set native window buffer usage, * variable parameter in function is - * [in] uint64_t usage. + * [in] uint64_t usage, the enumeration value refers to {@link OH_NativeBuffer_Usage}. */ SET_USAGE, /** @@ -177,25 +177,25 @@ typedef enum NativeWindowOperation { /** * set native window buffer colorGamut, * variable parameter in function is - * [in] int32_t colorGamut. + * [in] int32_t colorGamut, the enumeration value refers to {@link OH_NativeBuffer_ColorGamut}. */ SET_COLOR_GAMUT, /** * get native window buffer colorGamut, * variable parameter in function is - * [out int32_t *colorGamut]. + * [out int32_t *colorGamut], the enumeration value refers to {@link OH_NativeBuffer_ColorGamut}. */ GET_COLOR_GAMUT, /** * set native window buffer transform, * variable parameter in function is - * [in] int32_t transform. + * [in] int32_t transform, the enumeration value refers to {@link OH_NativeBuffer_TransformType}. */ SET_TRANSFORM, /** * get native window buffer transform, * variable parameter in function is - * [out] int32_t *transform. + * [out] int32_t *transform, the enumeration value refers to {@link OH_NativeBuffer_TransformType}. */ GET_TRANSFORM, /** @@ -214,14 +214,14 @@ typedef enum NativeWindowOperation { /** * set surface source type, * variable parameter in function is - * [in] int32_t sourceType. + * [in] int32_t sourceType, the enumeration value refers to {@link OHSurfaceSource}. * @since 12 */ SET_SOURCE_TYPE, /** * get surface source type, * variable parameter in function is - * [out] int32_t *sourceType. + * [out] int32_t *sourceType, the enumeration value refers to {@link OHSurfaceSource}. * @since 12 */ GET_SOURCE_TYPE, @@ -253,6 +253,13 @@ typedef enum NativeWindowOperation { * @since 12 */ SET_SDR_WHITE_POINT_BRIGHTNESS, + /** + * set native window buffer desiredPresentTimestamp, + * variable parameter in function is + * [in] int64_t desiredPresentTimestamp. + * @since 13 + */ + SET_DESIRED_PRESENT_TIMESTAMP = 24, } NativeWindowOperation; /** @@ -401,7 +408,7 @@ OHNativeWindow* OH_NativeWindow_CreateNativeWindow(void* pSurface); /** * @brief Decreases the reference count of a OHNativeWindow instance by 1, * and when the reference count reaches 0, destroys the instance.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -428,7 +435,7 @@ OHNativeWindowBuffer* OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer( * A new OHNativeWindowBuffer instance is created each time this function is called.\n * This interface needs to be used in conjunction with OH_NativeWindow_DestroyNativeWindowBuffer<\b>, * otherwise memory leaks will occur.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param nativeBuffer Indicates the pointer to a native buffer. The type is OH_NativeBuffer*. @@ -441,7 +448,7 @@ OHNativeWindowBuffer* OH_NativeWindow_CreateNativeWindowBufferFromNativeBuffer(O /** * @brief Decreases the reference count of a OHNativeWindowBuffer instance by 1 and, * when the reference count reaches 0, destroys the instance.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. @@ -457,7 +464,7 @@ void OH_NativeWindow_DestroyNativeWindowBuffer(OHNativeWindowBuffer* buffer); * This interface needs to be used in conjunction with OH_NativeWindow_NativeWindowFlushBuffer<\b>, * otherwise buffer will be exhausted.\n * When the fenceFd is used up, you need to close it.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -474,7 +481,7 @@ int32_t OH_NativeWindow_NativeWindowRequestBuffer(OHNativeWindow *window, * @brief Flushes the OHNativeWindowBuffer filled with the content to the buffer queue * through a OHNativeWindow instance for content consumption.\n * The fenceFd will be close by system.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -508,7 +515,7 @@ int32_t OH_NativeWindow_GetLastFlushedBuffer(OHNativeWindow *window, OHNativeWin /** * @brief Returns the OHNativeWindowBuffer to the buffer queue through a OHNativeWindow instance, * without filling in any content. The OHNativeWindowBuffer can be used for another request.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -521,7 +528,7 @@ int32_t OH_NativeWindow_NativeWindowAbortBuffer(OHNativeWindow *window, OHNative /** * @brief Sets or obtains the attributes of a native window, including the width, height, and content format.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -535,7 +542,7 @@ int32_t OH_NativeWindow_NativeWindowHandleOpt(OHNativeWindow *window, int code, /** * @brief Obtains the pointer to a BufferHandle of a OHNativeWindowBuffer instance.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. @@ -549,7 +556,7 @@ BufferHandle *OH_NativeWindow_GetBufferHandleFromNative(OHNativeWindowBuffer *bu * @brief Adds the reference count of a native object.\n * This interface needs to be used in conjunction with OH_NativeWindow_NativeObjectUnreference<\b>, * otherwise memory leaks will occur.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. @@ -562,7 +569,7 @@ int32_t OH_NativeWindow_NativeObjectReference(void *obj); /** * @brief Decreases the reference count of a native object and, * when the reference count reaches 0, destroys this object.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. @@ -574,7 +581,7 @@ int32_t OH_NativeWindow_NativeObjectUnreference(void *obj); /** * @brief Obtains the magic ID of a native object.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. @@ -649,7 +656,7 @@ int32_t OH_NativeWindow_NativeWindowSetTunnelHandle(OHNativeWindow *window, cons * @brief Attach a buffer to an OHNativeWindow instance.\n * This interface needs to be used in conjunction with OH_NativeWindow_NativeWindowDetachBuffer<\b>, * otherwise buffer management will be chaotic.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to an OHNativeWindow instance. @@ -662,7 +669,7 @@ int32_t OH_NativeWindow_NativeWindowAttachBuffer(OHNativeWindow *window, OHNativ /** * @brief Detach a buffer from an OHNativeWindow instance.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to an OHNativeWindow instance. @@ -675,7 +682,7 @@ int32_t OH_NativeWindow_NativeWindowDetachBuffer(OHNativeWindow *window, OHNativ /** * @brief Get surfaceId from native window.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to an OHNativeWindow instance. @@ -695,7 +702,7 @@ int32_t OH_NativeWindow_GetSurfaceId(OHNativeWindow *window, uint64_t *surfaceId * OH_NativeWindow_NativeObjectUnreference<\b>.\n * If the surface obtained through surfaceId is created in this process, the surface cannot be obtained * across processes.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param surfaceId Indicates the surfaceId to a surface. @@ -708,7 +715,7 @@ int32_t OH_NativeWindow_CreateNativeWindowFromSurfaceId(uint64_t surfaceId, OHNa /** * @brief Sets scalingMode of a native window.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window indicates the pointer to an OHNativeWindow instance. @@ -721,7 +728,7 @@ int32_t OH_NativeWindow_NativeWindowSetScalingModeV2(OHNativeWindow *window, OHS /** * @brief Set native window buffer hold.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to an OHNativeWindow instance. @@ -732,7 +739,7 @@ void OH_NativeWindow_SetBufferHold(OHNativeWindow *window); /** * @brief Write an OHNativeWindow to an OHIPCParcel.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to an OHNativeWindow instance. @@ -746,7 +753,7 @@ int32_t OH_NativeWindow_WriteToParcel(OHNativeWindow *window, OHIPCParcel *parce /** * @brief Read an OHNativeWindow from an OHIPCParcel.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param parcel Indicates the pointer to an OHIPCParcel instance. @@ -763,7 +770,7 @@ int32_t OH_NativeWindow_ReadFromParcel(OHIPCParcel *parcel, OHNativeWindow **win * When the fenceFd is used up, you need to close it.\n * This interface needs to be used in conjunction with OH_NativeWindow_NativeObjectUnreference<\b>, * otherwise memory leaks will occur.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to an OHNativeWindow instance. @@ -781,7 +788,7 @@ int32_t OH_NativeWindow_GetLastFlushedBufferV2(OHNativeWindow *window, OHNativeW int *fenceFd, float matrix[16]); /** * @brief Set the color space of the native window.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -796,7 +803,7 @@ int32_t OH_NativeWindow_SetColorSpace(OHNativeWindow *window, OH_NativeBuffer_Co /** * @brief Get the color space of the native window.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -811,7 +818,7 @@ int32_t OH_NativeWindow_GetColorSpace(OHNativeWindow *window, OH_NativeBuffer_Co /** * @brief Set the metadata type of the native window.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. @@ -830,7 +837,7 @@ int32_t OH_NativeWindow_SetMetadataValue(OHNativeWindow *window, OH_NativeBuffer /** * @brief Set the metadata type of the native window.\n - * This interface dose not support concurrency.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to a OHNativeWindow instance. -- Gitee From 969293ed3ccf4f30241ad9c469e1d028133c014d Mon Sep 17 00:00:00 2001 From: changleipeng Date: Mon, 29 Jul 2024 10:30:06 +0800 Subject: [PATCH 278/620] update NDK interface Signed-off-by: changleipeng Change-Id: I2f4c65d8b45afdfdc037822c435e8d7280562a6e --- .../kit_sub_system/c_file_kit_sub_system.json | 15 + graphic/graphic_2d/native_drawing/BUILD.gn | 8 + .../graphic_2d/native_drawing/drawing_font.h | 55 ++++ .../graphic_2d/native_drawing/drawing_rect.h | 59 ++++ .../native_drawing/drawing_text_declaration.h | 32 ++ .../drawing_text_font_descriptor.h | 190 ++++++++++++ .../native_drawing/drawing_text_line.h | 283 ++++++++++++++++++ .../drawing_text_lineTypography.h | 103 +++++++ .../native_drawing/drawing_text_run.h | 225 ++++++++++++++ .../native_drawing/drawing_text_typography.h | 123 ++++++-- .../graphic_2d/native_drawing/drawing_types.h | 21 ++ .../native_drawing/libnative_drawing.ndk.json | 232 ++++++++++++++ 12 files changed, 1317 insertions(+), 29 deletions(-) create mode 100644 graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h create mode 100644 graphic/graphic_2d/native_drawing/drawing_text_line.h create mode 100644 graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h create mode 100644 graphic/graphic_2d/native_drawing/drawing_text_run.h diff --git a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json index 668e349de..44c8cffcf 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json +++ b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json @@ -269,6 +269,21 @@ "kitName": "ArkGraphicsD", "subSystem": "图形图像" }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_text_line.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_text_run.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, { "filePath": "graphic/graphic_2d/native_drawing/drawing_text_typography.h", "kitName": "ArkGraphicsD", diff --git a/graphic/graphic_2d/native_drawing/BUILD.gn b/graphic/graphic_2d/native_drawing/BUILD.gn index aea6e1dc4..88c0459bc 100644 --- a/graphic/graphic_2d/native_drawing/BUILD.gn +++ b/graphic/graphic_2d/native_drawing/BUILD.gn @@ -50,6 +50,10 @@ ohos_ndk_headers("native_drawing_header") { "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_surface.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_blob.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_declaration.h", + "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h", + "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_line.h", + "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h", + "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_run.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_typography.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_typeface.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_types.h", @@ -95,6 +99,10 @@ ohos_ndk_library("libnative_drawing_ndk") { "native_drawing/drawing_surface.h", "native_drawing/drawing_text_blob.h", "native_drawing/drawing_text_declaration.h", + "native_drawing/drawing_text_font_descriptor.h", + "native_drawing/drawing_text_line.h", + "native_drawing/drawing_text_lineTypography.h", + "native_drawing/drawing_text_run.h", "native_drawing/drawing_text_typography.h", "native_drawing/drawing_typeface.h", "native_drawing/drawing_types.h", diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index 38ea644f3..0f0428395 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -497,6 +497,61 @@ typedef struct OH_Drawing_Font_Metrics { */ float OH_Drawing_FontGetMetrics(OH_Drawing_Font*, OH_Drawing_Font_Metrics*); +/** + * @brief Retrieves the bound rect for each glyph in glyph array. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param font Indicates the pointer to an OH_Drawing_Font object. + * @param glyphs Indicates the array of glyph indices to be measured. + * @param count Indicates the number of glyphs. + * @param bounds The bound rect array for each glyph, returned to the caller. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font, glyphs + * and bounds is nullptr or count is 0. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_FontGetBounds(const OH_Drawing_Font* font, const uint16_t* glyphs, uint32_t count, + OH_Drawing_Array* bounds); + +/** + * @brief Retrieves the path for specified Glyph. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param font Indicates the pointer to an OH_Drawing_Font object. + * @param glyph glyph index to be obtained. + * @param path The path object, returned to the caller. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font, path + * is nullptr or glyph not exist. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_FontGetPathForGlyph(const OH_Drawing_Font* font, uint16_t glyph, + OH_Drawing_Path* path); + +/** + * @brief Get the text outline path. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param font Indicates the pointer to an OH_Drawing_Font object. + * @param text Indicates the character storage encoded with text encoding. + * @param byteLength Indicates the text length in bytes. + * @param encoding Indicates the text encoding. + * @param x Indicates x coordinates of the text. + * @param y Indicates y coordinates of the text. + * @param path The path object, returned to the caller. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font, text or path is nullptr. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_FontGetTextPath(const OH_Drawing_Font* font, const void* text, size_t byteLength, + OH_Drawing_TextEncoding encoding, float x, float y, OH_Drawing_Path* path); + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_rect.h b/graphic/graphic_2d/native_drawing/drawing_rect.h index e07abff68..02c134f2b 100644 --- a/graphic/graphic_2d/native_drawing/drawing_rect.h +++ b/graphic/graphic_2d/native_drawing/drawing_rect.h @@ -214,6 +214,65 @@ void OH_Drawing_RectCopy(OH_Drawing_Rect* src, OH_Drawing_Rect* dst); */ void OH_Drawing_RectDestroy(OH_Drawing_Rect*); +/** + * @brief Creates an OH_Drawing_Array object, which is used to store multiple OH_Drawing_Rect object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param size Indicates the size of the array object. + * @return Returns the pointer to the OH_Drawing_Array object created. + * If nullptr is returned, the creation fails. + * The possible cause of the failure is that the available memory is empty, + * or size is invalid. + * @since 14 + * @version 1.0 + */ +OH_Drawing_Array* OH_Drawing_RectCreateArray(size_t size); + +/** + * @brief Gets the size of an OH_Drawing_Array object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param rectArray Indicates the array object. + * @param pSize Indicates the size pointer. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if rectArray or pSize is nullptr. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_RectGetArraySize(OH_Drawing_Array* rectArray, size_t* pSize); + +/** + * @brief Gets the specified OH_Drawing_Rect object from OH_Drawing_Array object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param rectArray Indicates the array object. + * @param index Indicates the index of array, caller must make sure the index is valid. + * @param rect Pointers to Pointer of OH_Drawing_Rect object, returned to the caller. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if rectArray or pprect is nullptr, + * or index is valid. + * @since 14 + * @version 1.0 + * @note Return nullptr if OH_Drawing_Array or index invalid. + */ +OH_Drawing_ErrorCode OH_Drawing_RectGetArrayElement(OH_Drawing_Array* rectArray, size_t index, + OH_Drawing_Rect** rect); + +/** + * @brief Destroys an array OH_Drawing_Rect object and reclaims the memory occupied by the object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param rectArray Indicates the pointer to an OH_Drawing_Array object. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if rectArray is nullptr. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_RectDestroyArray(OH_Drawing_Array* rectArray); + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h index 9a324c807..24ec0b365 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h @@ -60,6 +60,14 @@ typedef struct OH_Drawing_FontCollection OH_Drawing_FontCollection; */ typedef struct OH_Drawing_Typography OH_Drawing_Typography; +/** + * @brief Defines an OH_Drawing_LineTypography, which is used to perform line layout. + * + * @since 14 + * @version 1.0 + */ +typedef struct OH_Drawing_LineTypography OH_Drawing_LineTypography; + /** * @brief Defines an OH_Drawing_TextStyle, which is used to manage text colors and decorations. * @@ -125,6 +133,30 @@ typedef struct OH_Drawing_FontParser OH_Drawing_FontParser; */ typedef struct OH_Drawing_TextShadow OH_Drawing_TextShadow; +/** + * @brief Defines an OH_Drawing_TextTab, which is used to to store the tab alignment type and position. + * + * @since 14 + * @version 1.0 + */ +typedef struct OH_Drawing_TextTab OH_Drawing_TextTab; + +/** + * @brief Defines an OH_Drawing_TextLine, which is used to manage text line. + * + * @since 14 + * @version 1.0 + */ +typedef struct OH_Drawing_TextLine OH_Drawing_TextLine; + +/** + * @brief Defines an OH_Drawing_Run, which is used to manage run. + * + * @since 14 + * @version 1.0 + */ +typedef struct OH_Drawing_Run OH_Drawing_Run; + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h new file mode 100644 index 000000000..270e7c602 --- /dev/null +++ b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef C_INCLUDE_DRAWING_TEXT_FONT_DESCRIPTOR_H +#define C_INCLUDE_DRAWING_TEXT_FONT_DESCRIPTOR_H + +/** + * @addtogroup Drawing + * @{ + * + * @brief Provides the font descriptor capability. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * + * @since 8 + * @version 1.0 + */ + +/** + * @file drawing_text_font_descriptor.h + * + * @brief Provide the ability to provide OH_Drawing_FontDescriptor. + * + * @kit ArkGraphics2D + * @library libnative_drawing.so + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @since 8 + * @version 1.0 + */ + +#include "drawing_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Type style flag. + * + * @since 14 + * @version 1.0 + */ +typedef enum { + /** Italic font */ + ITALIC = 1 << 0, + /** Bold font */ + BOLD = 1 << 1, +} OH_Drawing_FontTypeStyle; + +/** + * @brief An enumeration of system font types. + * + * @since 14 + * @version 1.0 + */ +typedef enum { + /** All font types */ + ALL = 1 << 0, + /** System generic font type */ + GENERIC = 1 << 1, + /** Stylish font type */ + STYLISH = 1 << 2, + /** Installed font types */ + INSTALLED = 1 << 3, +} OH_Drawing_SystemFontType; + +/** + * @brief Describes the font information. + * + * @since 12 + * @version 1.0 + */ +typedef struct OH_Drawing_FontDescriptor { + /** The file path of System font */ + char* path; + /** A name that uniquely identifies the font */ + char* postScriptName; + /** The name of System font */ + char* fullName; + /** The family of System font */ + char* fontFamily; + /** The subfont family of the system font */ + char* fontSubfamily; + /** The weight of System font */ + int weight; + /** The width of System font */ + int width; + /** Whether the system font is tilted */ + int italic; + /** Whether the system font is compact */ + bool monoSpace; + /** whether symbolic fonts are supported */ + bool symbolic; + /** Font size */ + size_t size; + /** Font style flag, from OH_Drawing_FontTypeStyle */ + int typeStyle; +} OH_Drawing_FontDescriptor; + +/** + * @brief Obtain all system font descriptive symbols that match the specified font descriptor. Where the 'path' and + * 'size' fields are not considered as valid matching values, It takes effect when the remaining fields are not + * default values, If all the fields of the parameters OH_Drawing_FontDescriptor are default, obtain all system + * font descriptors. If the match fails, return nullptr. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_FontDescriptor The pointer to the OH_Drawing_FontDescriptor object. It is recommended to + * use OH_Drawing_CreateFontDescriptor to obtain a valid OH_Drawing_FontDescriptor instance. If you create your own + * OH_Drawing_FontDescriptor object, ensure that fields not intended for matching are set to their default values. + * @param size_t Indicates the count of obtained OH_Drawing_FontDescriptor. + * @return Returns an array of OH_Drawing_FontDescriptor. + * @since 14 + * @version 1.0 + */ +OH_Drawing_FontDescriptor* OH_Drawing_MatchFontDescriptors(OH_Drawing_FontDescriptor*, size_t*); + +/** + * @brief Releases the OH_Drawing_FontDescriptor array. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_FontDescriptor Pointer to OH_Drawing_FontDescriptor array. + * @param size_t Represents the number of members of the OH_Drawing_FontDescriptor array. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_DestroyFontDescriptors(OH_Drawing_FontDescriptor*, size_t); + +/** + * @brief Get the OH_Drawing_FontDescriptor object by the full name of the font, supporting generic fonts, + * stylish fonts, and installed fonts. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_String* Indicates the full name object OH_Drawing_String. + * @return Returns the pointer to a font descriptor object OH_Drawing_FontDescriptor. + * @since 14 + * @version 1.0 + */ +OH_Drawing_FontDescriptor* OH_Drawing_GetFontDescriptorByFullName(const OH_Drawing_String*); + +/** + * @brief Obtain the corresponding font full name list by the font type. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_SystemFontType Indicates enumerates of system font type. + * @return Returns the pointer to full name array object OH_Drawing_Array. + * @since 14 + * @version 1.0 + */ +OH_Drawing_Array* OH_Drawing_GetSystemFontFullNamesByType(OH_Drawing_SystemFontType); + +/** + * @brief Get the specified full name object OH_Drawing_String by index from the + * OH_Drawing_Array object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Array Indicates an array of full name object OH_Drawing_Array. + * @param size_t The index of full name. + * @return Returns a full name object OH_Drawing_String. + * @since 14 + * @version 1.0 + */ +const OH_Drawing_String* OH_Drawing_GetSystemFontFullNamesElement(OH_Drawing_Array*, size_t); + +/** + * @brief Releases the memory occupied by a list of system font names. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Array Indicates an array of full name. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_DestroySystemFontFullNames(OH_Drawing_Array*); + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif \ No newline at end of file diff --git a/graphic/graphic_2d/native_drawing/drawing_text_line.h b/graphic/graphic_2d/native_drawing/drawing_text_line.h new file mode 100644 index 000000000..e83eead09 --- /dev/null +++ b/graphic/graphic_2d/native_drawing/drawing_text_line.h @@ -0,0 +1,283 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef C_INCLUDE_DRAWING_TEXT_LINE_H +#define C_INCLUDE_DRAWING_TEXT_LINE_H + +/** + * @addtogroup Drawing + * @{ + * + * @brief Provides the 2D drawing capability. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * + * @since 14 + * @version 1.0 + */ + +/** + * @file drawing_text_line.h + * + * @brief Declares functions related to textLine in the drawing module. + * + * @since 14 + * @version 1.0 + */ + +#include "drawing_text_declaration.h" +#include "drawing_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Get text line information. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. + * @return Indicates the pointer to a text line array object OH_Drawing_Array. + * @since 14 + * @version 1.0 + */ +OH_Drawing_Array* OH_Drawing_TypographyGetTextLines(OH_Drawing_Typography* typography); + +/** + * @brief Releases the memory occupied by the text line array object OH_Drawing_Array. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param lines Indicates the pointer to the text line array object OH_Drawing_Array. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_DestroyTextLines(OH_Drawing_Array* lines); + +/** + * @brief Releases the memory occupied by the text line object OH_Drawing_TextLine. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param line Indicates the pointer to the text line object OH_Drawing_TextLine. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_DestroyTextLine(OH_Drawing_TextLine* line); + +/** + * @brief Get the text line object by index. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param lines Indicates the pointer to the text line array object OH_Drawing_Array. + * @param index text line object index. + * @return Indicates the pointer to a text line object OH_Drawing_TextLine. + * @since 14 + * @version 1.0 + */ +OH_Drawing_TextLine* OH_Drawing_GetTextLinesIndex(OH_Drawing_Array* lines, size_t index); + +/** + * @brief Get the count of glyphs. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param line Indicates the pointer to an OH_Drawing_TextLine object. + * @return Returns the count of glyphs. + * @since 14 + * @version 1.0 + */ +double OH_Drawing_TextLineGetGlyphCount(OH_Drawing_TextLine* line); + +/** + * @brief Get the range of text line. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param line Indicates the pointer to an OH_Drawing_TextLine object. + * @param start Indicates the pointer to text line start position. + * @param end Indicates the pointer to text line end position. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_TextLineGetTextRange(OH_Drawing_TextLine* line, size_t* start, size_t* end); + +/** + * @brief Get the glyph runs array of text line. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param line Indicates the pointer to an OH_Drawing_TextLine object. + * @return Indicates the pointer to a glyph runs array object of text line OH_Drawing_Array. + * @since 14 + * @version 1.0 + */ +OH_Drawing_Array* OH_Drawing_TextLineGetGlyphRuns(OH_Drawing_TextLine* line); + +/** + * @brief Releases the memory occupied by the run array object OH_Drawing_Array. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param runs Indicates the pointer to the run array object OH_Drawing_Array. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_DestroyRuns(OH_Drawing_Array* runs); + +/** + * @brief Get the run object by index. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param runs Indicates the pointer to the run array object OH_Drawing_Array. + * @param index run object index. + * @return Indicates the pointer to a run object OH_Drawing_Run. + * @since 14 + * @version 1.0 + */ +OH_Drawing_Run* OH_Drawing_GetRunsIndex(OH_Drawing_Array* runs, size_t index); + +/** + * @brief Paint the range of text line. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param line Indicates the pointer to an OH_Drawing_TextLine object. + * @param canvas Draw the text line on the canvas. + * @param x Represents the X-axis position on the canvas. + * @param y Represents the Y-axis position on the canvas. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_TextLinePaint(OH_Drawing_TextLine* line, OH_Drawing_Canvas* canvas, double x, double y); + +/** + * @brief Creates a truncated text line object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param line Indicates the pointer to an OH_Drawing_TextLine object. + * @param width Indicates the text line width to set. + * @param mode Indicates the ellipsis model to set, EllipsisMode:MIDDLE is not supported. + * For details, see the enum OH_Drawing_EllipsisModal. + * @param ellipsis Indicates the ellipsis string to set. + * @return Returns the pointer to the OH_Drawing_TextLine object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_TextLine* OH_Drawing_TextLineCreateTruncatedLine(OH_Drawing_TextLine* line, double width, int mode, + const char* ellipsis); + +/** + * @brief Gets the text line typographic bounds. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param line Indicates the pointer to an OH_Drawing_TextLine object. + * @param ascent Indicates the distance that the pointer points to remain above the baseline. + * @param descent Indicates the pointer to the distance that remains below the baseline. + * @param leading Indicates the pointer to the line Spacing. + * @return Returns The total width of the typesetting border. + * @since 14 + * @version 1.0 + */ +double OH_Drawing_TextLineGetTypographicBounds(OH_Drawing_TextLine* line, double* ascent, double* descent, + double* leading); + +/** + * @brief Gets the text line image bounds. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param line Indicates the pointer to an OH_Drawing_TextLine object. + * @return Returns the pointer to the OH_Drawing_Rect struct created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_Rect* OH_Drawing_TextLineGetImageBounds(OH_Drawing_TextLine* line); + +/** + * @brief Gets the tail space width. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param line Indicates the pointer to an OH_Drawing_TextLine object. + * @return Returns the tail space width. + * @since 14 + * @version 1.0 + */ +double OH_Drawing_TextLineGetTrailingSpaceWidth(OH_Drawing_TextLine* line); + +/** + * @brief Gets the string index of the given position. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param line Indicates the pointer to an OH_Drawing_TextLine object. + * @param point The given position. + * @return Returns the string index for a given position. + * @since 14 + * @version 1.0 + */ +int32_t OH_Drawing_TextLineGetStringIndexForPosition(OH_Drawing_TextLine* line, OH_Drawing_Point* point); + +/** + * @brief Gets the offset of the given string index. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param line Indicates the pointer to an OH_Drawing_TextLine object. + * @param index The given string index. + * @param secondOffset Indicates the pointer to the offset of compound character, not supported. + * @return Returns the offset info for a given string index. + * @since 14 + * @version 1.0 + */ +double OH_Drawing_TextLineGetOffsetForStringIndex(OH_Drawing_TextLine* line, int32_t index, double* secondOffset); + +/** + * @brief User-defined callback functions for using offsets and indexes. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param offset Character offset is traversed as an argument to the callback function. + * @param index Character index is traversed as an argument to the callback function. + * @param leadingEdge Whether the current offset is at the character front, as an argument to the callback function. + * @return The return value of the user-defined callback function. + * If false is returned, the traversal continues. + * If true is returned, the traversal stops. + * @since 14 + * @version 1.0 + */ +typedef bool (*CustomCallback)(double offset, int32_t index, bool leadingEdge); + +/** + * @brief Enumerate caret offset and index in text lines. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param line Indicates the pointer to an OH_Drawing_TextLine object. + * @param callback User-defined callback functions, see CustomCallback. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_TextLineEnumerateCaretOffsets(OH_Drawing_TextLine* line, CustomCallback callback); + +/** + * @brief Gets the text offset based on the given alignment factor and alignment width. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param line Indicates the pointer to an OH_Drawing_TextLine object. + * @param alignmentFactor The coefficients that text needs to be aligned. + * Less than or equal to 0 is left justified, 0.5 is center justified, + * and greater than or equal to 1 is right justified. + * @param alignmentWidth The width of the text to be aligned. + * Returns 0 if it is less than the actual width of the text. + * @return Returns the offset of the aligned text. + * @since 14 + * @version 1.0 + */ +double OH_Drawing_TextLineGetAlignmentOffset(OH_Drawing_TextLine* line, double alignmentFactor, double alignmentWidth); + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif // C_INCLUDE_DRAWING_TEXT_LINE_H \ No newline at end of file diff --git a/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h b/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h new file mode 100644 index 000000000..f480cd643 --- /dev/null +++ b/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd.. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef C_INCLUDE_DRAWING_TEXT_LINETYPOGRAPHY_H +#define C_INCLUDE_DRAWING_TEXT_LINETYPOGRAPHY_H + +/** + * @addtogroup Drawing + * @{ + * + * @brief Provides the 2D drawing capability. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * + * @since 14 + * @version 1.0 + */ + +/** + * @file drawing_text_linetypography.h + * + * @brief Declares functions related to lineTypography in the drawing module. + * + * @kit ArkGraphics2D + * @library libnative_drawing.so + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @since 14 + * @version 1.0 + */ + +#include "cstddef" +#include "drawing_text_declaration.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Creates an OH_Drawing_LineTypography object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyCreate Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @return Returns the pointer to the OH_Drawing_LineTypography object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_LineTypography* OH_Drawing_CreateLineTypography(OH_Drawing_TypographyCreate* handler); + +/** + * @brief Releases the memory occupied by an OH_Drawing_LineTypography object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_LineTypography Indicates the pointer to an OH_Drawing_LineTypography object. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_DestroyLineTypography(OH_Drawing_LineTypography* lineTypography); + +/** + * @brief Calculate the line breakpoint based on the width provided. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyCreate Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @param startIndex Indicates the starting point for the line-break calculations. + * @param width Indicates the requested line-break width. + * @return Returns the count of the characters from startIndex that would cause the line break. + * @since 14 + * @version 1.0 + */ +size_t OH_Drawing_LineTypographyGetLineBreak(OH_Drawing_LineTypography* lineTypography, + size_t startIndex, double width); + +/** + * @brief Creates a text line object based on the text range provided. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_LineTypography Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @param startIndex Indicates the starting index of the text range. + * @param count Indicates the characters count of the text range. + * @return Returns the pointer to the OH_Drawing_TextLine object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_TextLine* OH_Drawing_LineTypographyCreateLine(OH_Drawing_LineTypography* lineTypography, + size_t startIndex, size_t count); + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif diff --git a/graphic/graphic_2d/native_drawing/drawing_text_run.h b/graphic/graphic_2d/native_drawing/drawing_text_run.h new file mode 100644 index 000000000..28949dc42 --- /dev/null +++ b/graphic/graphic_2d/native_drawing/drawing_text_run.h @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef C_INCLUDE_DRAWING_TEXT_RUN_H +#define C_INCLUDE_DRAWING_TEXT_RUN_H + +/** + * @addtogroup Drawing + * @{ + * + * @brief Provides the text run capability. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * + * @since 14 + * @version 1.0 + */ + +/** + * @file drawing_text_run.h + * + * @brief Declares functions related to run in the drawing module. + * + * @since 14 + * @version 1.0 + */ + +#include "drawing_text_declaration.h" +#include "drawing_types.h" + +#ifdef __cplusplus +extern "C" { +#endif +/** + * @brief Gets the run glyph indices ,the offset of the index relative to the entire paragraph. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @param start The run of start index. + * @param length The run of length, if start and length are set to 0, then get all of the current run. + * @return Run of glyph indices array. + * @since 14 + * @version 1.0 + */ +OH_Drawing_Array* OH_Drawing_GetRunStringIndices(OH_Drawing_Run* run, int64_t start, int64_t length); + +/** + * @brief Gets the run glyph indices by index. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Array the run glyph indices array. + * @param index The run of glyph index. + * @return Run of glyph indices element. + * @since 14 + * @version 1.0 + */ +uint64_t OH_Drawing_GetRunStringIndicesElement(OH_Drawing_Array* stringIndices, size_t index); + +/** + * @brief Releases the memory run glyph indices array. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param stringIndices glyph indices the pointer. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_DestroyRunStringIndices(OH_Drawing_Array* stringIndices); + +/** + * @brief Gets the range run glyph location and length. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @param location The run of glyph location. + * @param length The run of glyph length. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_GetRunStringRange(OH_Drawing_Run* run, uint64_t* location, uint64_t* length); + +/** + * @brief Gets the run typographic bound. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @param ascent The run of ascent. + * @param descent The run of descent. + * @param leading The run of leading. + * @return run typographic width. + * @since 14 + * @version 1.0 + */ +float OH_Drawing_GetRunTypographicBounds(OH_Drawing_Run* run, float* ascent, float* descent, float* leading); + +/** + * @brief Paints text on the canvas. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @param x Indicates the x coordinate. + * @param y Indicates the y coordinate. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_RunPaint(OH_Drawing_Canvas* canvas, OH_Drawing_Run* run, double x, double y); + +/** + * @brief Gets the run image bound. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @return OH_Drawing_Rect The run image bounds. + * @since 14 + * @version 1.0 + */ +OH_Drawing_Rect* OH_Drawing_GetRunImageBounds(OH_Drawing_Run* run); + + /** + * @brief Releases the memory run image bounds pointer. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Rect Run image bounds pointer. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_DestroyRunImageBounds(OH_Drawing_Rect* rect); + +/** + * @brief Gets the range glyph identifier for each character. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @param start The run of start index. + * @param length The run of length, if start and length are set to 0, then get all of the current run. + * @return Run of glyph array. + * @since 14 + * @version 1.0 + */ +OH_Drawing_Array* OH_Drawing_GetRunGlyphs(OH_Drawing_Run* run, int64_t start, int64_t length); + +/** + * @brief Gets the glyph identifier by index. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param glyphs The run of glyph array. + * @param index The run of glyph index. + * @return Run of glyph element. + * @since 14 + * @version 1.0 + */ +uint16_t OH_Drawing_GetRunGlyphsElement(OH_Drawing_Array* glyphs, size_t index); + +/** + * @brief Releases the memory run glyph array. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param glyphs The run of glyph array. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_DestroyRunGlyphs(OH_Drawing_Array* glyphs); + +/** + * @brief Gets the range glyph position array. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @param start The run of start index. + * @param length The run of length, if start and length are set to 0, then get all of the current run. + * @return Run of position array. + * @since 14 + * @version 1.0 + */ +OH_Drawing_Array* OH_Drawing_GetRunPositions(OH_Drawing_Run* run, int64_t start, int64_t length); + +/** + * @brief Gets the glyph position by index. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Array The run of position array. + * @param index The run of glyph index. + * @return Run of glyph position pointer. + * @since 14 + * @version 1.0 + */ +OH_Drawing_Point* OH_Drawing_GetRunPositionsElement(OH_Drawing_Array* positions, size_t index); + +/** + * @brief Releases the memory run of position array. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param positions The run of position array. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_DestroyRunPositions(OH_Drawing_Array* positions); + +/** + * @brief Gets the number of glyph. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @return The number of glyph. + * @since 14 + * @version 1.0 + */ +uint32_t OH_Drawing_GetRunGlyphCount(OH_Drawing_Run* run); +#ifdef __cplusplus +} +#endif +/** @} */ +#endif // C_INCLUDE_DRAWING_TEXT_RUN_H diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index d821c3855..977062e81 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -45,6 +45,7 @@ #include "drawing_color.h" #include "drawing_font.h" #include "drawing_text_declaration.h" +#include "drawing_text_font_descriptor.h" #include "drawing_types.h" #include "stdint.h" @@ -412,35 +413,6 @@ typedef struct OH_Drawing_FontConfigInfo { OH_Drawing_FontFallbackGroup* fallbackGroupSet; } OH_Drawing_FontConfigInfo; -/** - * @brief Describes the font information. - * - * @since 12 - * @version 1.0 - */ -typedef struct OH_Drawing_FontDescriptor { - /** The file path of System font */ - char* path; - /** A name that uniquely identifies the font */ - char* postScriptName; - /** The name of System font */ - char* fullName; - /** The family of System font */ - char* fontFamily; - /** The subfont family of the system font */ - char* fontSubfamily; - /** The weight of System font */ - int weight; - /** The width of System font */ - int width; - /** Whether the system font is tilted */ - int italic; - /** Whether the system font is compact */ - bool monoSpace; - /** whether symbolic fonts are supported */ - bool symbolic; -} OH_Drawing_FontDescriptor; - /** * @brief The metrics of line. * @@ -734,6 +706,29 @@ void OH_Drawing_SetTextStyleBaseLine(OH_Drawing_TextStyle*, int /* OH_Drawing_Te */ void OH_Drawing_SetTextStyleDecoration(OH_Drawing_TextStyle*, int /* OH_Drawing_TextDecoration */); +/** + * @brief Add the text decoration. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param int Indicates the text decoration to add. For details, see the enum OH_Drawing_TextDecoration. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_AddTextStyleDecoration(OH_Drawing_TextStyle*, int /* OH_Drawing_TextDecoration */); + +/** + * @brief Remove the text decoration. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param int Indicates the text decoration to remove, shoud be match existing text decorations. + * For details, see the enum OH_Drawing_TextDecoration. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_RemoveTextStyleDecoration(OH_Drawing_TextStyle*, int /* OH_Drawing_TextDecoration */); + /** * @brief Sets the color for the text decoration. * @@ -2753,6 +2748,76 @@ void OH_Drawing_TypographyDestroyTextBox(OH_Drawing_TextBox*); void OH_Drawing_SetTextShadow(OH_Drawing_TextShadow* shadow, uint32_t color, OH_Drawing_Point* offset, double blurRadius); +/** + * @brief Creates an OH_Drawing_TextTab object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextAlign Indicates enumerates text tab alignment modes. TAB alignment, Support left alignment + * right alignment center alignment, other enumeration values are left alignment effect. + * @param float Indicates location if text tab. + * @return Returns the pointer to the OH_Drawing_TextTab object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_TextTab* OH_Drawing_CreateTextTab(OH_Drawing_TextAlign alignment, float location); + +/** + * @brief Releases the memory occupied by an OH_Drawing_TextTab object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextTab Indicates the pointer to an OH_Drawing_TextTab object. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_DestroyTextTab(OH_Drawing_TextTab*); + +/** + * @brief Get align of an OH_Drawing_TextTab object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextTab Indicates the pointer to an OH_Drawing_TextTab object. + * @return Returns align of an OH_Drawing_TextTab object. + * @since 14 + * @version 1.0 + */ +OH_Drawing_TextAlign OH_Drawing_GetTextTabAlign(OH_Drawing_TextTab*); + +/** + * @brief Get location of an OH_Drawing_TextTab object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextTab Indicates the pointer to an OH_Drawing_TextTab object. + * @return Returns location of an OH_Drawing_TextTab object. + * @since 14 + * @version 1.0 + */ +float OH_Drawing_GetTextTabLocation(OH_Drawing_TextTab*); + +/** + * @brief Sets the text tab of OH_Drawing_TypographyStyle object. + * TAB alignment does not take effect when text alignment is also set. Or when the TAB's location property + * is less than or equal to 0. When the TAB is not set, it is the default space effect, and all tabs in the paragraph + * after the setting are aligned according to this tab effect. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TextTab Indicates the pointer to an OH_Drawing_TextTab object. + * @since 14 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextTab(OH_Drawing_TypographyStyle*, OH_Drawing_TextTab* TextTab); + +/** + * @brief Get DrawingArray size. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param drawingArray Indicates the pointer to the array object OH_Drawing_Array. + * @return Size of array. + * @since 14 + * @version 1.0 + */ +size_t OH_Drawing_GetDrawingArraySize(OH_Drawing_Array* drawingArray); + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h index e040acdfc..22f860ebb 100644 --- a/graphic/graphic_2d/native_drawing/drawing_types.h +++ b/graphic/graphic_2d/native_drawing/drawing_types.h @@ -471,6 +471,19 @@ typedef struct { double leftBottomRadius; } OH_Drawing_RectStyle_Info; +/** + * @brief Defines the string information struct. + * + * @since 14 + * @version 1.0 + */ +typedef struct { + /** A pointer to a byte string containing UTF-16BE(Big Endian) encoded entities */ + uint8_t* strData; + /** The length of `strData` in bytes */ + uint32_t strLen; +} OH_Drawing_String; + /** * @brief Enumerates text encoding types. * @since 12 @@ -518,6 +531,14 @@ typedef struct OH_Drawing_RecordCmdUtils OH_Drawing_RecordCmdUtils; * @version 1.0 */ typedef struct OH_Drawing_RecordCmd OH_Drawing_RecordCmd; + +/** + * @brief Defines an array object, which is used to store multiple NDK object. + * + * @since 14 + * @version 1.0 + */ +typedef struct OH_Drawing_Array OH_Drawing_Array; #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 9c5b0d269..264d710ff 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -615,6 +615,14 @@ { "name": "OH_Drawing_SetTextStyleFontWeight" }, { "name": "OH_Drawing_SetTextStyleBaseLine" }, { "name": "OH_Drawing_SetTextStyleDecoration" }, + { + "first_introduced": "14", + "name": "OH_Drawing_AddTextStyleDecoration" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_RemoveTextStyleDecoration" + }, { "name": "OH_Drawing_SetTextStyleDecorationColor" }, { "name": "OH_Drawing_SetTextStyleFontHeight" }, { "name": "OH_Drawing_SetTextStyleFontFamilies" }, @@ -902,6 +910,14 @@ "first_introduced": "12", "name": "OH_Drawing_DestroyFontDescriptor" }, + { + "first_introduced": "14", + "name": "OH_Drawing_MatchFontDescriptors" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_DestroyFontDescriptors" + }, { "first_introduced": "12", "name": "OH_Drawing_CreateFontParser" @@ -910,6 +926,22 @@ "first_introduced": "12", "name": "OH_Drawing_DestroyFontParser" }, + { + "first_introduced": "14", + "name": "OH_Drawing_GetFontDescriptorByFullName" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_GetSystemFontFullNamesByType" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_GetSystemFontFullNamesElement" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_DestroySystemFontFullNames" + }, { "first_introduced": "12", "name": "OH_Drawing_FontParserGetSystemFontList" @@ -1465,5 +1497,205 @@ { "first_introduced": "13", "name":"OH_Drawing_RecordCmdDestroy" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_CreateLineTypography" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_DestroyLineTypography" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_LineTypographyGetLineBreak" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_LineTypographyCreateLine" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_FontGetBounds" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_FontGetPathForGlyph" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_RectCreateArray" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_RectGetArraySize" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_RectGetArrayElement" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_RectDestroyArray" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_CreateTextTab" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_DestroyTextTab" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetTextTabAlign" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetTextTabLocation" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_SetTypographyTextTab" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_FontGetTextPath" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetDrawingArraySize" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_TypographyGetTextLines" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_DestroyTextLines" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_DestroyTextLine" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetTextLinesIndex" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_TextLineGetGlyphCount" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_TextLineGetTextRange" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_TextLineGetGlyphRuns" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_DestroyRuns" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetRunsIndex" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_TextLinePaint" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_TextLineCreateTruncatedLine" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_TextLineGetTypographicBounds" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_TextLineGetImageBounds" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_TextLineGetTrailingSpaceWidth" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_TextLineGetStringIndexForPosition" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_TextLineGetOffsetForStringIndex" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_TextLineEnumerateCaretOffsets" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_TextLineGetAlignmentOffset" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetRunStringIndices" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetRunStringIndicesElement" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_DestroyRunStringIndices" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetRunStringRange" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetRunTypographicBounds" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_RunPaint" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetRunImageBounds" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_DestroyRunImageBounds" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetRunGlyphs" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetRunGlyphsElement" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_DestroyRunGlyphs" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetRunPositions" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetRunPositionsElement" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_DestroyRunPositions" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetRunGlyphCount" } ] \ No newline at end of file -- Gitee From f8ed65b489c95256a97d924ea79f898a68e469a3 Mon Sep 17 00:00:00 2001 From: lihui Date: Thu, 19 Sep 2024 11:03:42 +0800 Subject: [PATCH 279/620] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lihui --- graphic/graphic_2d/native_window/external_window.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_window/external_window.h b/graphic/graphic_2d/native_window/external_window.h index ef2144879..23d98d207 100644 --- a/graphic/graphic_2d/native_window/external_window.h +++ b/graphic/graphic_2d/native_window/external_window.h @@ -254,8 +254,15 @@ typedef enum NativeWindowOperation { */ SET_SDR_WHITE_POINT_BRIGHTNESS, /** - * set native window buffer desiredPresentTimestamp, - * variable parameter in function is + * Set native window buffer desiredPresentTimestamp, indicates the desired time to present the buffer.\n + * Which should be generated by std::chrono::steady_clock in nanoseconds.\n + * It is only effective when RenderService is the consumer.\n + * The buffer will wait until desiredPresentTimestamp is reached before being consumed and displayed.\n + * If multiple buffers reach desiredPresentTimestamp, the earlier buffer will be dropped.\n + * This Operation should be called before calling OH_NativeWindow_NativeWindowFlushBuffer.\n + * If desiredPresentTimestamp is greater than 1 second of the consumer-provided timestamp, + * the desiredPresentTimestamp will be ignored.\n + * Variable parameter in function is * [in] int64_t desiredPresentTimestamp. * @since 13 */ -- Gitee From 0fd1243fe202db385ec8123211577314dc59fe30 Mon Sep 17 00:00:00 2001 From: wangmengyao111 Date: Thu, 19 Sep 2024 12:35:05 +0800 Subject: [PATCH 280/620] =?UTF-8?q?TicketNo:DTS2024091316370=20Description?= =?UTF-8?q?:=E6=B7=BB=E5=8A=A0size=5Ft=E5=A4=B4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Team:PDU_PTL Feature or Bugfix:Bugfix Binary Source:No PrivateCode(Yes/No):No Signed-off-by: wangmengyao111 --- network/netssl/include/net_ssl_c_type.h | 1 + 1 file changed, 1 insertion(+) diff --git a/network/netssl/include/net_ssl_c_type.h b/network/netssl/include/net_ssl_c_type.h index fcc9b6fd5..c7096a558 100644 --- a/network/netssl/include/net_ssl_c_type.h +++ b/network/netssl/include/net_ssl_c_type.h @@ -38,6 +38,7 @@ */ #include +#include #ifdef __cplusplus extern "C" { -- Gitee From 5e59225818e425ff9d7264b1d091588dc1b8b0a8 Mon Sep 17 00:00:00 2001 From: xuzhangchi Date: Thu, 19 Sep 2024 14:53:31 +0800 Subject: [PATCH 281/620] =?UTF-8?q?=E5=8F=AF=E5=8F=98=E5=B8=A7=E7=8E=87?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9E=9A=E4=B8=BE=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuzhangchi --- multimedia/av_codec/native_avcodec_base.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index a3d3fb9a2..1bec2e144 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -953,6 +953,14 @@ extern const char *OH_MD_KEY_TRACK_START_TIME; * @since 12 */ extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE; +/** + * @brief Key for describing if enable VRR or not, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise. + * This is an optional key that applies only to video decoder. It is used in configure. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 13 + */ +extern const char *OH_MD_KEY_VIDEO_DECODER_ENABLE_VRR; /** * @brief Media type. -- Gitee From c08e0c8d5b4200bcea2555b4d3d211a6951be7bf Mon Sep 17 00:00:00 2001 From: caochuan Date: Mon, 23 Sep 2024 11:30:27 +0800 Subject: [PATCH 282/620] modify @file problem Signed-off-by: caochuan --- multimedia/media_library/media_asset_base_capi.h | 4 ++-- multimedia/media_library/media_asset_manager_capi.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/multimedia/media_library/media_asset_base_capi.h b/multimedia/media_library/media_asset_base_capi.h index 57391fb1e..53380d6de 100644 --- a/multimedia/media_library/media_asset_base_capi.h +++ b/multimedia/media_library/media_asset_base_capi.h @@ -26,7 +26,7 @@ */ /** - * @file media_asset_manager.h + * @file media_asset_base_capi.h * * @brief Defines the structure and enumeration for Media Asset Manager. * @@ -321,4 +321,4 @@ typedef void (*OH_MediaLibrary_OnMovingPhotoDataPrepared)(MediaLibrary_ErrorCode #endif #endif // MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ASSET_BASE_H -/** @} */ \ No newline at end of file +/** @} */ diff --git a/multimedia/media_library/media_asset_manager_capi.h b/multimedia/media_library/media_asset_manager_capi.h index 67b5d4b79..2d480e428 100644 --- a/multimedia/media_library/media_asset_manager_capi.h +++ b/multimedia/media_library/media_asset_manager_capi.h @@ -23,7 +23,7 @@ */ /** - * @file media_asset_manager.h + * @file media_asset_manager_capi.h * * @brief Defines the media asset manager APIs. * @@ -162,4 +162,4 @@ MediaLibrary_ErrorCode OH_MediaAssetManager_Release(OH_MediaAssetManager* manage #endif #endif // MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MEDIA_ASSET_MANAGER_H -/** @} */ \ No newline at end of file +/** @} */ -- Gitee From 8b1e972b001a48e10d3a75d121f5d40f3b1ec0fc Mon Sep 17 00:00:00 2001 From: zhangqiang Date: Mon, 23 Sep 2024 11:39:18 +0800 Subject: [PATCH 283/620] =?UTF-8?q?20240923=20=20ScreenCapture=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E8=AE=BE=E7=BD=AE=E5=BD=95=E5=B1=8F=E6=9C=80=E5=A4=A7?= =?UTF-8?q?=E5=B8=A7=E7=8E=87=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangqiang --- .../libnative_avscreen_capture.ndk.json | 4 ++++ .../player_framework/native_avscreen_capture.h | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json b/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json index 1e53ae7d7..8464ce4fd 100644 --- a/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json +++ b/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json @@ -98,5 +98,9 @@ { "first_introduced": "12", "name": "OH_AVScreenCapture_SkipPrivacyMode" + }, + { + "first_introduced": "14", + "name": "OH_AVScreenCapture_SetMaxVideoFrameRate" } ] \ No newline at end of file diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index c260023c6..48af8569d 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -416,6 +416,21 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ResizeCanvas(struct OH_AVScreenCa */ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SkipPrivacyMode(struct OH_AVScreenCapture *capture, int32_t *windowIDs, int32_t windowCount); + +/** + * @brief set up the max number of video frame per second + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @param capture Pointer to an OH_AVScreenCapture instance + * @param max frame rate of video + * @return Function result code. + * {@link AV_SCREEN_CAPTURE_ERR_OK} if the execution is successful. + * {@link AV_SCREEN_CAPTURE_ERR_INVALID_VAL} input capture is nullptr or frameRate is not support. + * {@link AV_SCREEN_CAPTURE_ERR_OPERATE_NOT_PERMIT} opertation not be permitted. + * @since 14 + * @version 1.0 + */ +OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetMaxVideoFrameRate(struct OH_AVScreenCapture *capture, + int32_t frameRate); #ifdef __cplusplus } #endif -- Gitee From d601799fc5a77e05bc27d3cd899a9bccf9a737d2 Mon Sep 17 00:00:00 2001 From: "wy524668781@icloud.com" Date: Thu, 5 Sep 2024 14:29:40 +0800 Subject: [PATCH 284/620] add vector field for rdb Signed-off-by: wy524668781@icloud.com --- .../include/relational_store.h | 252 +++++++++++++++++- .../relational_store/libnative_rdb.ndk.json | 68 +++++ 2 files changed, 318 insertions(+), 2 deletions(-) diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index a48ed22ee..50ff91164 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -104,7 +104,6 @@ typedef enum Rdb_SecurityArea { /** * @brief Manages relational database configurations. - * * @since 10 */ #pragma pack(1) @@ -158,6 +157,166 @@ typedef struct { int64_t id; } OH_Rdb_Store; +/** + * @brief Define OH_Rdb_ConfigV2 type. + * + * @since 13 + */ +typedef struct OH_Rdb_ConfigV2 OH_Rdb_ConfigV2; + +/** + * @brief Define Rdb_DBType type. + * + * @since 13 + */ +typedef enum Rdb_DBType { + /** + * @brief Means using SQLITE as the db kernal + */ + RDB_SQLITE = 1, + /** + * @brief Means using CARLEY_DB as the db kernal + */ + RDB_CAYLEY = 2, + /** + * @brief Means largest value for Rdb_DBType + */ + DBTYPE_BUTT = 64, +} Rdb_DBType; + +/** + * @brief Create OH_Rdb_ConfigV2 which is used to open store + * + * @return Returns the newly created OH_Rdb_ConfigV2 object. If NULL is returned, the creation fails. + * The possible cause is that the address space of the application is full, As a result, the space + * cannot be allocated. + * @see OH_Rdb_ConfigV2 + * @since 13 + */ +OH_Rdb_ConfigV2 *OH_Rdb_CreateConfig(); + +/** + * @brief Destroy OH_Rdb_ConfigV2 which is created by OH_Rdb_CreateConfig + * + * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. + * Indicates the configuration of the database related to this RDB store. + * @return Returns the status code of the execution. Successful execution returns RDB_OK, + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * @since 13 + */ +int OH_Rdb_DestroyConfig(OH_Rdb_ConfigV2 *config); + +/** + * @brief Set property databaseDir into config + * + * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. + * Indicates the configuration of the database related to this RDB store. + * @param dataBaseDir Indicates the directory of the database. + * @return Returns the status code of the execution. Successful execution returns RDB_OK, + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * @since 13 + */ +int OH_Rdb_SetDatabaseDir(OH_Rdb_ConfigV2 *config, const char *databaseDir); + +/** + * @brief Set property storeName into config + * + * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. + * Indicates the configuration of the database related to this RDB store. + * @param storeName Indicates the name of the database. + * @return Returns the status code of the execution. Successful execution returns RDB_OK, + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * @since 13 + */ +int OH_Rdb_SetStoreName(OH_Rdb_ConfigV2 *config, const char *storeName); + +/** + * @brief Set property bundleName into config + * + * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. + * Indicates the configuration of the database related to this RDB store. + * @param bundleName Indicates the bundle name of the application + * @return Returns the status code of the execution. Successful execution returns RDB_OK, + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * @since 13 + */ +int OH_Rdb_SetBundleName(OH_Rdb_ConfigV2 *config, const char *bundleName); + +/** + * @brief Set property moduleName into config + * + * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. + * Indicates the configuration of the database related to this RDB store. + * @param moduleName Indicates the module name of the application. + * @return Returns the status code of the execution. Successful execution returns RDB_OK, + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * @since 13 + */ +int OH_Rdb_SetModuleName(OH_Rdb_ConfigV2 *config, const char *moduleName); + +/** + * @brief Set property isEncrypted into config + * + * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. + * Indicates the configuration of the database related to this RDB store. + * @param isEncrypt Indicates whether the database is encrypted. + * @return Returns the status code of the execution. Successful execution returns RDB_OK, + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * @since 13 + */ +int OH_Rdb_SetEncrypted(OH_Rdb_ConfigV2 *config, bool isEncrypted); + +/** + * @brief Set property securityLevel into config + * + * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. + * Indicates the configuration of the database related to this RDB store. + * @param securityLevel Indicates the security level {@link OH_Rdb_SecurityLevel} of the database. + * @return Returns the status code of the execution. Successful execution returns RDB_OK, + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * @since 13 + */ +int OH_Rdb_SetSecurityLevel(OH_Rdb_ConfigV2 *config, int securityLevel); + +/** + * @brief Set property area into config + * + * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. + * Indicates the configuration of the database related to this RDB store + * @return Returns the status code of the execution. Successful execution returns RDB_OK, + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * @since 13 + */ +int OH_Rdb_SetArea(OH_Rdb_ConfigV2 *config, int area); + +/** + * @brief Set property dbType into config + * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. + * @param dbType Indicates the dbType {@link Rdb_DBType} of the database + * @return Returns the status code of the execution. Successful execution returns RDB_OK, + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * {@link RDB_E_NOT_SUPPORTED} - The error code for not support db types. + * @since 13 + */ +int OH_Rdb_SetDbType(OH_Rdb_ConfigV2 *config, int dbType); + +/** + * @brief Get support db type list + * @param numType The output parameter, which is used to recieve the length of the support db type array. + * @return Return Rdb_DBType array contains supported db type, array length is number of support type + * @since 13 + */ +const int *OH_Rdb_GetSupportedDbType(int *typeCount); + /** * @brief Creates an {@link OH_VObject} instance. * @@ -207,6 +366,24 @@ OH_Predicates *OH_Rdb_CreatePredicates(const char *table); */ OH_Rdb_Store *OH_Rdb_GetOrOpen(const OH_Rdb_Config *config, int *errCode); +/** + * @brief Obtains an RDB store with OH_Rdb_ConfigV2. + * + * You can set parameters of the RDB store as required. In general, + * this method is recommended to obtain a rdb store. + * + * @param config Represents a pointer to an {@link OH_Rdb_ConfigV2} instance. + * Indicates the configuration of the database related to this RDB store. + * @param errCode This parameter is the output parameter, + * and the execution status of a function is written to this variable. + * @return If the creation is successful, a pointer to the instance of the @link OH_Rdb_Store} structure is returned. + * If the Config is empty, config.size does not match, or errCode is empty. + * Get database path failed.Get RDB Store fail. Nullptr is returned. + * @see OH_Rdb_ConfigV2, OH_Rdb_Store. + * @since 13 + */ +OH_Rdb_Store *OH_Rdb_CreateOrOpen(const OH_Rdb_ConfigV2 *config, int *errCode); + /** * @brief Close the {@link OH_Rdb_Store} object and reclaim the memory occupied by the object. * @@ -234,6 +411,20 @@ int OH_Rdb_CloseStore(OH_Rdb_Store *store); */ int OH_Rdb_DeleteStore(const OH_Rdb_Config *config); +/** + * @brief Deletes the database with a specified path. + * + * @param config Represents a pointer to an {@link OH_Rdb_ConfigV2} instance. + * Indicates the configuration of the database related to this RDB store. + * @return Returns the status code of the execution. Successful execution returns RDB_OK, + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * while failure returns a specific error code. Specific error codes can be referenced {@link OH_Rdb_ErrCode}. + * @see OH_Rdb_ErrCode. + * @since 13 + */ +int OH_Rdb_DeleteStoreV2(const OH_Rdb_ConfigV2 *config); + /** * @brief Inserts a row of data into the target table. * @@ -308,6 +499,21 @@ OH_Cursor *OH_Rdb_Query(OH_Rdb_Store *store, OH_Predicates *predicates, const ch */ int OH_Rdb_Execute(OH_Rdb_Store *store, const char *sql); +/** + * @brief Write operations are performed using the specified transaction represented by the transaction ID + * + * @param store Represents a pointer to an {@link OH_Rdb_Store} instance. + * @param sql Indicates the SQL statement to execute. + * @param trxId The transaction ID of the specified transaction, must be greater than 0 + * @return Returns the status code of the execution. + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * {@link RDB_E_NOT_SUPPORTED} - The error code for not supprt. + * @see OH_Rdb_Store. + * @since 13 + */ +int OH_Rdb_ExecuteByTrxId(OH_Rdb_Store *store, int64_t trxId, const char *sql); + /** * @brief Queries data in the database based on an SQL statement. * @@ -356,6 +562,48 @@ int OH_Rdb_RollBack(OH_Rdb_Store *store); */ int OH_Rdb_Commit(OH_Rdb_Store *store); +/** + * @brief Begin a transaction and the transaction ID corresponding to the transaction. + * + * @param store Represents a pointer to an {@link OH_Rdb_Store} instance. + * @param trxId The output parameter, which is used to receive the transaction ID corresponding to the transaction + * @return Returns the status code of the execution. + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * {@link RDB_E_NOT_SUPPORTED} - The error code for not supprt. + * @see OH_Rdb_Store. + * @since 13 + */ +int OH_Rdb_BeginTransWithTrxId(OH_Rdb_Store *store, int64_t *trxId); + +/** + * @brief Roll back a transaction that is represented by a specified transaction ID + * + * @param store Represents a pointer to an {@link OH_Rdb_Store} instance. + * @param trxId The transaction ID of the specified transaction, must be greater than 0 + * @return Returns the status code of the execution. + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * {@link RDB_E_NOT_SUPPORTED} - The error code for not supprt. + * @see OH_Rdb_Store. + * @since 13 + */ +int OH_Rdb_RollBackByTrxId(OH_Rdb_Store *store, int64_t trxId); + +/** + * @brief Commit a transaction that is represented by a specified transaction ID + * + * @param store Represents a pointer to an {@link OH_Rdb_Store} instance. + * @param trxId The transaction ID of the specified transaction, must be greater than 0 + * @return Returns the status code of the execution. + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * {@link RDB_E_NOT_SUPPORTED} - The error code for not supprt. + * @see OH_Rdb_Store. + * @since 13 + */ +int OH_Rdb_CommitByTrxId(OH_Rdb_Store *store, int64_t trxId); + /** * @brief Backs up a database on specified path. * @@ -863,7 +1111,7 @@ typedef struct Rdb_ProgressDetails { * @param progress Represents a pointer to an {@link Rdb_ProgressDetails} instance. * @param version Indicates the version of current {@link Rdb_ProgressDetails}. * @return If the operation is successful, a pointer to the instance of the {@link Rdb_TableDetails} - * structure is returned.If get details is failed,nullptr is returned. + * structure is returned.If get details is failed, nullptr is returned. * @see Rdb_ProgressDetails * @see Rdb_TableDetails * @since 11 diff --git a/distributeddatamgr/relational_store/libnative_rdb.ndk.json b/distributeddatamgr/relational_store/libnative_rdb.ndk.json index 68882bc8a..4d72ebe84 100644 --- a/distributeddatamgr/relational_store/libnative_rdb.ndk.json +++ b/distributeddatamgr/relational_store/libnative_rdb.ndk.json @@ -2,18 +2,86 @@ {"name":"OH_Rdb_CreatePredicates" }, {"name":"OH_Rdb_CreateValueObject" }, {"name":"OH_Rdb_CreateValuesBucket" }, + { + "first_introduced":"13", + "name":"OH_Rdb_CreateConfig" + }, + { + "first_introduced": "13", + "name":"OH_Rdb_SetDatabaseDir" + }, + { + "first_introduced": "13", + "name":"OH_Rdb_SetStoreName" + }, + { + "first_introduced": "13", + "name":"OH_Rdb_SetBundleName" + }, + { + "first_introduced": "13", + "name":"OH_Rdb_SetModuleName" + }, + { + "first_introduced": "13", + "name":"OH_Rdb_SetEncrypted" + }, + { + "first_introduced": "13", + "name":"OH_Rdb_SetSecurityLevel" + }, + { + "first_introduced": "13", + "name":"OH_Rdb_SetArea" + }, + { + "first_introduced": "13", + "name":"OH_Rdb_SetDbType" + }, + { + "first_introduced": "13", + "name":"OH_Rdb_GetSupportedDbType" + }, + { + "first_introduced": "13", + "name":"OH_Rdb_DestroyConfig" + }, {"name":"OH_Rdb_GetOrOpen" }, + { + "first_introduced": "13", + "name":"OH_Rdb_CreateOrOpen" + }, {"name":"OH_Rdb_CloseStore" }, {"name":"OH_Rdb_DeleteStore" }, + { + "first_introduced": "13", + "name":"OH_Rdb_DeleteStoreV2" + }, {"name":"OH_Rdb_Insert" }, {"name":"OH_Rdb_Update" }, {"name":"OH_Rdb_Delete" }, {"name":"OH_Rdb_Query" }, {"name":"OH_Rdb_Execute" }, + { + "first_introduced": "13", + "name":"OH_Rdb_ExecuteByTrxId" + }, {"name":"OH_Rdb_ExecuteQuery" }, {"name":"OH_Rdb_BeginTransaction" }, {"name":"OH_Rdb_RollBack" }, {"name":"OH_Rdb_Commit" }, + { + "first_introduced": "13", + "name":"OH_Rdb_BeginTransWithTrxId" + }, + { + "first_introduced": "13", + "name":"OH_Rdb_RollBackByTrxId" + }, + { + "first_introduced": "13", + "name":"OH_Rdb_CommitByTrxId" + }, {"name":"OH_Rdb_Backup" }, {"name":"OH_Rdb_Restore"}, {"name":"OH_Rdb_GetVersion"}, -- Gitee From 663035626d231e18a9edeab775f8592b3297bb17 Mon Sep 17 00:00:00 2001 From: zoulinken Date: Sat, 14 Sep 2024 15:28:47 +0800 Subject: [PATCH 285/620] =?UTF-8?q?C-API=20=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E9=9C=80=E6=B1=82=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zoulinken --- arkui/ace_engine/native/libace.ndk.json | 8 ++++++++ arkui/ace_engine/native/native_node.h | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index c6daa0bf7..3da27da07 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -1295,6 +1295,14 @@ "first_introduced": "12", "name": "OH_ArkUI_NodeUtils_GetPositionWithTranslateInScreen" }, + { + "first_introduced": "14", + "name": "OH_ArkUI_NodeUtils_AddCustomProperty" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_NodeUtils_RemoveCustomProperty" + }, { "first_introduced": "12", "name": "OH_ArkUI_ListChildrenMainSizeOption_Create" diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index ca9b8cb20..d7328246c 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -7665,6 +7665,25 @@ int32_t OH_ArkUI_NodeUtils_GetPositionWithTranslateInWindow(ArkUI_NodeHandle nod */ int32_t OH_ArkUI_NodeUtils_GetPositionWithTranslateInScreen(ArkUI_NodeHandle node, ArkUI_IntOffset* translateOffset); +/** + * @brief Add the custom property of the component. + * + * @param node ArkUI_NodeHandle pointer. + * @param key The key of the custom property. + * @param key The value of the custom property. + * @since 14 + */ +void OH_ArkUI_NodeUtils_AddCustomProperty(ArkUI_NodeHandle node, const char* key, const char* value); + +/** + * @brief Remove the custom property of the component. + * + * @param node ArkUI_NodeHandle pointer. + * @param key The key of the custom property. + * @since 14 + */ +void OH_ArkUI_NodeUtils_RemoveCustomProperty(ArkUI_NodeHandle node, const char* key); + /** * @brief Collapse the ListItem in its expanded state. * -- Gitee From c280ba17fe8e08af92b7476c4baa705e37155bf0 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 20 Sep 2024 17:30:52 +0800 Subject: [PATCH 286/620] add bluetooth capi Signed-off-by: lee --- ConnectivityKit/bluetooth/BUILD.gn | 29 ++++++ .../bluetooth/libbluetooth.ndk.json | 5 + ConnectivityKit/bluetooth/oh_bluetooth.h | 95 +++++++++++++++++++ 3 files changed, 129 insertions(+) create mode 100644 ConnectivityKit/bluetooth/BUILD.gn create mode 100644 ConnectivityKit/bluetooth/libbluetooth.ndk.json create mode 100644 ConnectivityKit/bluetooth/oh_bluetooth.h diff --git a/ConnectivityKit/bluetooth/BUILD.gn b/ConnectivityKit/bluetooth/BUILD.gn new file mode 100644 index 000000000..869366f31 --- /dev/null +++ b/ConnectivityKit/bluetooth/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright (C) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_headers("bluetooth_ndk_header") { + dest_dir = "$ndk_headers_out_dir/ConnectivityKit/bluetooth" + sources = [ "./oh_bluetooth.h" ] +} + +ohos_ndk_library("libbluetooth_ndk") { + ndk_description_file = "./libbluetooth.ndk.json" + output_name = "bluetooth_ndk" + output_extension = "so" + min_compact_version = "13" + system_capability = "SystemCapability.Communication.Bluetooth.Core" + system_capability_headers = [ "./oh_bluetooth.h" ] +} diff --git a/ConnectivityKit/bluetooth/libbluetooth.ndk.json b/ConnectivityKit/bluetooth/libbluetooth.ndk.json new file mode 100644 index 000000000..d8b21f30c --- /dev/null +++ b/ConnectivityKit/bluetooth/libbluetooth.ndk.json @@ -0,0 +1,5 @@ +[ + { + "name": "OH_Bluetooth_GetBluetoothSwitchState" + } +] \ No newline at end of file diff --git a/ConnectivityKit/bluetooth/oh_bluetooth.h b/ConnectivityKit/bluetooth/oh_bluetooth.h new file mode 100644 index 000000000..cbe820916 --- /dev/null +++ b/ConnectivityKit/bluetooth/oh_bluetooth.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup Bluetooth + * @{ + * + * @brief Provide functions for querying the status of bluetooth switch. + * @since 13 + */ +/** + * @file oh_bluetooth.h + * @kit ConnectivityKit + * @brief Define interfaces for querying bluetooth switch status. + * @library libbluetooth.so + * @syscap SystemCapability.Communication.Bluetooth.Core + * @since 13 + */ + +#ifndef OH_BLUETOOTH_H +#define OH_BLUETOOTH_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumeration state of bluetooth switch. + * + * @since 13 + */ +typedef enum Bluetooth_SwitchState { + /** Indicates the local bluetooth is off. */ + BLUETOOTH_STATE_OFF = 0, + /** Indicates the local bluetooth is turning on. */ + BLUETOOTH_STATE_TURNING_ON = 1, + /** Indicates the local bluetooth is on, and ready for use. */ + BLUETOOTH_STATE_ON = 2, + /** Indicates the local bluetooth is turning off. */ + BLUETOOTH_STATE_TURNING_OFF = 3, + /** Indicates the local bluetooth is turning LE mode on. */ + BLUETOOTH_STATE_BLE_TURNING_ON = 4, + /** Indicates the local bluetooth is in LE only mode. */ + BLUETOOTH_STATE_BLE_ON = 5, + /** Indicates the local bluetooth is turning off LE only mode. */ + BLUETOOTH_STATE_BLE_TURNING_OFF = 6 +} Bluetooth_SwitchState; + +/** + * @brief Enumeration the bluetooth result codes. + * + * @since 13 + */ +typedef enum Bluetooth_ResultCode { + /** + * @error The operation is successful. + */ + BLUETOOTH_SUCCESS = 0, + /** + * @error Parameter error. Possible reasons: 1. The input parameter is a null pointer; + * 2. Parameter values exceed the defined range. + */ + BLUETOOTH_INVALID_PARAM = 401, +} Bluetooth_ResultCode; + +/** + * @brief Get the bluetooth switch state. + * + * @param state - It is a pointer used to receive bluetooth switch status values. + * The caller needs to pass in a non empty boolean pointer, otherwise an error will be returned. + * For a detailed definition, please refer to {@link Bluetooth_SwitchState}. + * @return Bluetooth functions result code. + * For a detailed definition, please refer to {@link Bluetooth_ResultCode}. + * {@link BLUETOOTH_SUCCESS} Successfully obtained the bluetooth switch status. + * {@link BLUETOOTH_INVALID_PARAM} The input parameter enabled is a null pointer. + * @since 13 + */ +Bluetooth_ResultCode OH_Bluetooth_GetBluetoothSwitchState(Bluetooth_SwitchState *state); +#ifdef __cplusplus +} +#endif +/** @} */ +#endif // OH_BLUETOOTH_H \ No newline at end of file -- Gitee From c17b4fc3709d617f706dd1c248466529c15504e7 Mon Sep 17 00:00:00 2001 From: SubmarinePhantom Date: Wed, 5 Jun 2024 10:06:42 +0800 Subject: [PATCH 287/620] =?UTF-8?q?NDK=20OHOS=E6=8E=A5=E5=8F=A3=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SubmarinePhantom --- network/netmanager/include/net_connection.h | 34 ++++++++++++++++++- network/netmanager/libnet_connection.ndk.json | 8 +++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/network/netmanager/include/net_connection.h b/network/netmanager/include/net_connection.h index 76d12d406..6c5c4c2f2 100644 --- a/network/netmanager/include/net_connection.h +++ b/network/netmanager/include/net_connection.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -186,6 +186,8 @@ int32_t OH_NetConn_GetAllNets(NetConn_NetHandleList *netHandleList); * 2100003 - Internal error. * @permission ohos.permission.INTERNET * @syscap SystemCapability.Communication.NetManager.Core + * @deprecated since 13 + * @useinstead OH_NetConn_RegisterDnsResolver * @since 11 * @version 1.0 */ @@ -199,11 +201,41 @@ int32_t OHOS_NetConn_RegisterDnsResolver(OH_NetConn_CustomDnsResolver resolver); * 2100003 - Internal error. * @permission ohos.permission.INTERNET * @syscap SystemCapability.Communication.NetManager.Core + * @deprecated since 13 + * @useinstead OH_NetConn_UnregisterDnsResolver * @since 11 * @version 1.0 */ int32_t OHOS_NetConn_UnregisterDnsResolver(void); +/** + * @brief Registers a custom DNS resolver. + * + * @param resolver Pointer to the custom DNS resolver. + * @return Returns the result code. + * {@link NETMANAGER_EXT_SUCCESS} if the operation is successful. + * {@link NETMANAGER_ERR_PERMISSION_DENIED} Missing permissions, add permission. + * {@link NETMANAGER_ERR_PARAMETER_ERROR} Parameter error. Please enter a correct parameter. + * @permission ohos.permission.INTERNET + * @syscap SystemCapability.Communication.NetManager.Core + * @since 13 + * @version 1.0 + */ +int32_t OH_NetConn_RegisterDnsResolver(OH_NetConn_CustomDnsResolver resolver); + +/** + * @brief Unregisters a custom DNS resolver. + * + * @return 0 - Success. 201 - Missing permissions. + * 401 - Parameter error. 2100002 - Unable to connect to service. + * 2100003 - Internal error. + * @permission ohos.permission.INTERNET + * @syscap SystemCapability.Communication.NetManager.Core + * @since 13 + * @version 1.0 + */ +int32_t OH_NetConn_UnregisterDnsResolver(void); + /** * @brief Binds a socket to the specific network. * diff --git a/network/netmanager/libnet_connection.ndk.json b/network/netmanager/libnet_connection.ndk.json index 792eff18e..41b98af11 100644 --- a/network/netmanager/libnet_connection.ndk.json +++ b/network/netmanager/libnet_connection.ndk.json @@ -70,5 +70,13 @@ { "first_introduced": "12", "name": "OH_NetConn_UnregisterNetConnCallback" + }, + { + "first_introduced": "13", + "name": "OH_NetConn_RegisterDnsResolver" + }, + { + "first_introduced": "13", + "name": "OH_NetConn_UnregisterDnsResolver" } ] \ No newline at end of file -- Gitee From 00d57adbacaff8049e1175e0b2f9dfe45e97da53 Mon Sep 17 00:00:00 2001 From: ccfriend Date: Wed, 11 Sep 2024 21:05:27 +0800 Subject: [PATCH 288/620] add more error codes Signed-off-by: ccfriend --- multimedia/av_session/native_avmetadata.h | 2 + multimedia/av_session/native_avsession.h | 106 +++++++++++++++++----- 2 files changed, 84 insertions(+), 24 deletions(-) diff --git a/multimedia/av_session/native_avmetadata.h b/multimedia/av_session/native_avmetadata.h index 3e6751d8c..a37816c92 100644 --- a/multimedia/av_session/native_avmetadata.h +++ b/multimedia/av_session/native_avmetadata.h @@ -346,6 +346,7 @@ AVMetadata_Result OH_AVMetadataBuilder_SetDisplayTags(OH_AVMetadataBuilder* buil * @param avMetadata Pointer to a viriable to receive the avMetadata object. * @return Function result code: * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_NO_MEMORY} No memory to allocate a new instance. * {@link AVMETADATA_ERROR_INVALID_PARAM}: * 1.The param of builder is nullptr; * 2.The param of avMetadata is nullptr. @@ -360,6 +361,7 @@ AVMetadata_Result OH_AVMetadataBuilder_GenerateAVMetadata(OH_AVMetadataBuilder* * @param avMetadata Pointer to a viriable to receive the avMetadata object. * @return Function result code: * {@link AVMETADATA_SUCCESS} If the execution is successful. + * {@link AVMETADATA_ERROR_INVALID_PARAM} The param of avMetadata is nullptr. * @since 13 */ AVMetadata_Result OH_AVMetadata_Destroy(OH_AVMetadata* avMetadata); diff --git a/multimedia/av_session/native_avsession.h b/multimedia/av_session/native_avsession.h index caab9f203..50b7e6459 100644 --- a/multimedia/av_session/native_avsession.h +++ b/multimedia/av_session/native_avsession.h @@ -320,7 +320,7 @@ typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnToggleFavorite)(OH_AVS /** * @brief Request to create the avsession. * - * @param avsession The avsession instance pointer + * @param sessionType The session type to set * @param sessionTag The session tag set by the application * @param bundleName The bundle name to set * @param abilityName The abilityName name to set @@ -328,9 +328,11 @@ typedef AVSessionCallback_Result (*OH_AVSessionCallback_OnToggleFavorite)(OH_AVS * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. * {@link AV_SESSION_ERR_INVALID_PARAMETER}: - * 1. The param of avsession is nullptr. - * 2. The param of bundleName is nullptr. - * 3. The param of abilityName is nullptr. + * 1. The param of sessionType is invalid. + * 2. The param of sessionTag is nullptr. + * 3. The param of bundleName is nullptr. + * 4. The param of abilityName is nullptr. + * 5. The param of avsession is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_Create(AVSession_Type sessionType, const char* sessionTag, @@ -353,6 +355,7 @@ AVSession_ErrCode OH_AVSession_Destroy(OH_AVSession* avsession); * @param avsession The avsession instance pointer * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. * @since 13 */ @@ -364,6 +367,7 @@ AVSession_ErrCode OH_AVSession_Activate(OH_AVSession* avsession); * @param avsession The avsession instance pointer * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. * @since 13 */ @@ -376,7 +380,10 @@ AVSession_ErrCode OH_AVSession_Deactivate(OH_AVSession* avsession); * @param sessionType The returned session type * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is invalid. + * 2. The param of sessionType is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_GetSessionType(OH_AVSession* avsession, AVSession_Type* sessionType); @@ -388,7 +395,9 @@ AVSession_ErrCode OH_AVSession_GetSessionType(OH_AVSession* avsession, AVSession * @param sessionId The returned session id * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of sessionId is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_GetSessionId(OH_AVSession* avsession, const char** sessionId); @@ -400,7 +409,10 @@ AVSession_ErrCode OH_AVSession_GetSessionId(OH_AVSession* avsession, const char* * @param avmetadata The metadata to set * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of avmetadata is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_SetAVMetadata(OH_AVSession* avsession, OH_AVMetadata* avmetadata); @@ -412,7 +424,10 @@ AVSession_ErrCode OH_AVSession_SetAVMetadata(OH_AVSession* avsession, OH_AVMetad * @param playbackState The playbackState to set * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of playbackState is invalid. * @since 13 */ AVSession_ErrCode OH_AVSession_SetPlaybackState(OH_AVSession* avsession, @@ -425,7 +440,10 @@ AVSession_ErrCode OH_AVSession_SetPlaybackState(OH_AVSession* avsession, * @param playbackPosition The playbackPosition to set * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of playbackPosition is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_SetPlaybackPosition(OH_AVSession* avsession, @@ -438,6 +456,7 @@ AVSession_ErrCode OH_AVSession_SetPlaybackPosition(OH_AVSession* avsession, * @param favorite true means making the resource to be liked, false means dislike. * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. * @since 13 */ @@ -450,7 +469,10 @@ AVSession_ErrCode OH_AVSession_SetFavorite(OH_AVSession* avsession, bool favorit * @param loopMode The loopmode to be set for playback. * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of loopMode is invalid. * @since 13 */ AVSession_ErrCode OH_AVSession_SetLoopMode(OH_AVSession* avsession, AVSession_LoopMode loopMode); @@ -464,8 +486,11 @@ AVSession_ErrCode OH_AVSession_SetLoopMode(OH_AVSession* avsession, AVSession_Lo * @param userData User data which is passed by user. * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. - * {@link AV_SESSION_ERR_CODE_COMMAND_INVALID} The command is not invalid. + * {@link AV_SESSION_ERR_CODE_COMMAND_INVALID} The command is invalid. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of callback is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_RegisterCommandCallback(OH_AVSession* avsession, @@ -479,8 +504,11 @@ AVSession_ErrCode OH_AVSession_RegisterCommandCallback(OH_AVSession* avsession, * @param callback the {@link OH_AVSessionCallback_OnCommand} to be unregistered. * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. - * {@link AV_SESSION_ERR_CODE_COMMAND_INVALID} The command is not invalid. + * {@link AV_SESSION_ERR_CODE_COMMAND_INVALID} The command is invalid. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of callback is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_UnregisterCommandCallback(OH_AVSession* avsession, @@ -494,7 +522,10 @@ AVSession_ErrCode OH_AVSession_UnregisterCommandCallback(OH_AVSession* avsession * @param userData User data which is passed by user. * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of callback is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_RegisterForwardCallback(OH_AVSession* avsession, @@ -507,7 +538,10 @@ AVSession_ErrCode OH_AVSession_RegisterForwardCallback(OH_AVSession* avsession, * @param callback the {@link OH_AVSessionCallback_OnFastForward} to be unregistered. * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of callback is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_UnregisterForwardCallback(OH_AVSession* avsession, @@ -521,7 +555,10 @@ AVSession_ErrCode OH_AVSession_UnregisterForwardCallback(OH_AVSession* avsession * @param userData User data which is passed by user. * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of callback is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_RegisterRewindCallback(OH_AVSession* avsession, @@ -534,7 +571,10 @@ AVSession_ErrCode OH_AVSession_RegisterRewindCallback(OH_AVSession* avsession, * @param callback the {@link OH_AVSessionCallback_OnRewind} to be unregistered. * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of callback is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_UnregisterRewindCallback(OH_AVSession* avsession, @@ -548,7 +588,10 @@ AVSession_ErrCode OH_AVSession_UnregisterRewindCallback(OH_AVSession* avsession, * @param userData User data which is passed by user. * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of callback is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_RegisterSeekCallback(OH_AVSession* avsession, @@ -561,7 +604,10 @@ AVSession_ErrCode OH_AVSession_RegisterSeekCallback(OH_AVSession* avsession, * @param callback the {@link OH_AVSessionCallback_OnSeek} to be unregistered. * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of callback is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_UnregisterSeekCallback(OH_AVSession* avsession, @@ -575,7 +621,10 @@ AVSession_ErrCode OH_AVSession_UnregisterSeekCallback(OH_AVSession* avsession, * @param userData User data which is passed by user. * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of callback is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_RegisterSetLoopModeCallback(OH_AVSession* avsession, @@ -588,7 +637,10 @@ AVSession_ErrCode OH_AVSession_RegisterSetLoopModeCallback(OH_AVSession* avsessi * @param callback the {@link OH_AVSessionCallback_OnSetLoopMode} to be unregistered. * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of callback is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_UnregisterSetLoopModeCallback(OH_AVSession* avsession, @@ -602,7 +654,10 @@ AVSession_ErrCode OH_AVSession_UnregisterSetLoopModeCallback(OH_AVSession* avses * @param userData User data which is passed by user. * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of callback is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_RegisterToggleFavoriteCallback(OH_AVSession* avsession, @@ -615,7 +670,10 @@ AVSession_ErrCode OH_AVSession_RegisterToggleFavoriteCallback(OH_AVSession* avse * @param callback the {@link OH_AVSessionCallback_OnToggleFavorite} to be unregistered. * @return Function result code: * {@link AV_SESSION_ERR_SUCCESS} If the execution is successful. - * {@link AV_SESSION_ERR_INVALID_PARAMETER} The param of avsession is nullptr. + * {@link AV_SESSION_ERR_SERVICE_EXCEPTION} Internal server error. + * {@link AV_SESSION_ERR_INVALID_PARAMETER} + * 1. The param of avsession is nullptr. + * 2. The param of callback is nullptr. * @since 13 */ AVSession_ErrCode OH_AVSession_UnregisterToggleFavoriteCallback(OH_AVSession* avsession, -- Gitee From 21f061a23e989bbfc127534ae67af1267dc12a42 Mon Sep 17 00:00:00 2001 From: gaosong Date: Mon, 23 Sep 2024 20:58:24 +0800 Subject: [PATCH 289/620] ndk Signed-off-by: gaosong --- ConnectivityKit/wifi/BUILD.gn | 29 +++++++++ ConnectivityKit/wifi/libwifi.ndk.json | 5 ++ ConnectivityKit/wifi/oh_wifi.h | 90 +++++++++++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 ConnectivityKit/wifi/BUILD.gn create mode 100644 ConnectivityKit/wifi/libwifi.ndk.json create mode 100644 ConnectivityKit/wifi/oh_wifi.h diff --git a/ConnectivityKit/wifi/BUILD.gn b/ConnectivityKit/wifi/BUILD.gn new file mode 100644 index 000000000..053434890 --- /dev/null +++ b/ConnectivityKit/wifi/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright (C) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_headers("wifi_ndk_header") { + dest_dir = "$ndk_headers_out_dir/ConnectivityKit/wifi" + sources = [ "./oh_wifi.h" ] +} + +ohos_ndk_library("libwifi_ndk") { + ndk_description_file = "./libwifi.ndk.json" + output_name = "wifi_ndk" + output_extension = "so" + min_compact_version = "13" + system_capability = "SystemCapability.Communication.WiFi.STA" + system_capability_headers = [ "./oh_wifi.h" ] +} \ No newline at end of file diff --git a/ConnectivityKit/wifi/libwifi.ndk.json b/ConnectivityKit/wifi/libwifi.ndk.json new file mode 100644 index 000000000..86a467898 --- /dev/null +++ b/ConnectivityKit/wifi/libwifi.ndk.json @@ -0,0 +1,5 @@ +[ + { + "name": "OH_Wifi_IsWifiEnabled" + } +] \ No newline at end of file diff --git a/ConnectivityKit/wifi/oh_wifi.h b/ConnectivityKit/wifi/oh_wifi.h new file mode 100644 index 000000000..4c84471c7 --- /dev/null +++ b/ConnectivityKit/wifi/oh_wifi.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup Wifi + * @{ + * + * @brief Provide functions for querying the status of wifi switch. + * @since 13 + */ +/** + * @file oh_wifi.h + * @kit ConnectivityKit + * @brief Define interfaces for querying wifi switch status. + * @library libwifi.so + * @syscap SystemCapability.Communication.WiFi.STA + * @since 13 + */ + +#ifndef OH_WIFI_H +#define OH_WIFI_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the wifi result codes. + * + * @since 13 + */ +typedef enum WifiResultCode { + /** + * @error The operation is successful. + */ + WIFI_SUCCESS = 0, + /** + * @error Permission verification failed. The application does not have the + * permission required to call the API. + */ + WIFI_PERMISSION_DENIED = 201, + /** + * @error Parameter error. Possible reasons: 1. The input parameter is a null pointer;\n + * 2. Parameter values exceed the defined range.\n + */ + WIFI_INVALID_PARAM = 401, + /** + * @error Capability not supported. Failed to call function due to limited device capabilities. + */ + WIFI_NOT_SUPPORTED = 801, + /** + * @error Operation failed. + * Possible reasons: Internal execution failed. + */ + WIFI_OPERATION_FAILED = 1000 +} WifiResultCode; + +/** + * @brief Check whether the wifi switch is enabled. + * + * @param enabled - It is a boolean pointer used to receive wifi switch status values.\n + * Equal to true indicates that the wifi switch is turned on, false indicates that\n + * the wifi switch is turned off.\n + * The caller needs to pass in a non empty boolean pointer, otherwise an error will be returned.\n + * @return wifi functions result code.\n + * For a detailed definition, please refer to {@link WifiResultCode}.\n + * {@link WIFI_SUCCESS} Successfully obtained the wifi switch status.\n + * {@link WIFI_INVALID_PARAM} The input parameter enabled is a null pointer.\n + * {@link WIFI_PERMISSION_DENIED} The application does not have the permission required to call the API.\n + * @since 13 + */ +WifiResultCode OH_Wifi_IsWifiEnabled(bool *enabled); + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif // OH_WIFI_H \ No newline at end of file -- Gitee From 2fb9e99e16410d320c4c9415063befe027a3dac0 Mon Sep 17 00:00:00 2001 From: m00472246 Date: Thu, 26 Sep 2024 16:27:26 +0800 Subject: [PATCH 290/620] =?UTF-8?q?=E5=AF=B9native=5Fimage=20=20sdk?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E8=A1=A5=E5=85=85=E8=AF=B4=E6=98=8E=20Signed?= =?UTF-8?q?-off-by:=20m00472246=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m00472246 --- graphic/graphic_2d/native_image/native_image.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/graphic/graphic_2d/native_image/native_image.h b/graphic/graphic_2d/native_image/native_image.h index cc8653a64..25d335441 100644 --- a/graphic/graphic_2d/native_image/native_image.h +++ b/graphic/graphic_2d/native_image/native_image.h @@ -287,7 +287,11 @@ int32_t OH_NativeImage_ReleaseNativeWindowBuffer(OH_NativeImage* image, /** * @brief Create a OH_NativeImage as a consumerSurface. \n + * This interface is only used for memory rotation on the surface consumer, + * the OH_NativeImage will not actively perform memory rendering processing.\n * This method can not be used at the same time with OH_NativeImage_UpdateSurfaceImage.\n + * This interface is used in conjunction with OH_NativeImage_AcquireNativeWindowBuffer<\b> and + * OH_NativeImage_ReleaseNativeWindowBuffer<\b>.\n * This interface needs to be used in conjunction with OH_NativeImage_Destroy<\b>, * otherwise memory leaks will occur.\n * This interface is a non-thread-safe type interface.\n -- Gitee From 65a65b9298b2d00889489c44cbfd11c24988f1c8 Mon Sep 17 00:00:00 2001 From: qano Date: Fri, 27 Sep 2024 10:57:54 +0800 Subject: [PATCH 291/620] api13 add enableMirror Signed-off-by: qano --- multimedia/camera_framework/camera.ndk.json | 4 ++++ multimedia/camera_framework/photo_output.h | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index e5faf336c..aaa30c4e5 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -471,6 +471,10 @@ "first_introduced": "11", "name": "OH_PhotoOutput_IsMirrorSupported" }, + { + "first_introduced": "13", + "name": "OH_PhotoOutput_EnableMirror" + }, { "first_introduced": "12", "name": "OH_PhotoOutput_GetActiveProfile" diff --git a/multimedia/camera_framework/photo_output.h b/multimedia/camera_framework/photo_output.h index 70f909bcf..27e502b69 100644 --- a/multimedia/camera_framework/photo_output.h +++ b/multimedia/camera_framework/photo_output.h @@ -441,6 +441,18 @@ Camera_ErrorCode OH_PhotoOutput_Release(Camera_PhotoOutput* photoOutput); */ Camera_ErrorCode OH_PhotoOutput_IsMirrorSupported(Camera_PhotoOutput* photoOutput, bool* isSupported); +/** + * @brief Enable mirror for photo capture. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance which used to configure mirror. + * @param enabled the flag indicates whether mirror is enabled. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 13 + */ +Camera_ErrorCode OH_PhotoOutput_EnableMirror(Camera_PhotoOutput* photoOutput, bool enabled); + /** * @brief Get active photo output profile. * -- Gitee From 4d19158fdb3b418f381e69f0fb615238841c46f1 Mon Sep 17 00:00:00 2001 From: AOL Date: Fri, 27 Sep 2024 07:12:24 +0000 Subject: [PATCH 292/620] fix typo Signed-off-by: AOL --- .../audio_framework/audio_renderer/native_audiorenderer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index 49c765ff6..90255a7fd 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -485,7 +485,7 @@ OH_AudioStream_Result OH_AudioRenderer_GetSilentModeAndMixWithOthers( * @brief Temporarily changes the current audio device * This function applys on audiorenderers whose StreamUsage are * STREAM_USAGE_VOICE_COMMUNICATIN/STREAM_USAGE_VIDEO_COMMUNICATION/STREAM_USAGE_VOICE_MESSAGE. - * Setting the device will ony takes effect if no other accessory such as headphoes are in use. + * Setting the device will only takes effect if no other accessory such as headphones are in use. * * @param renderer Renderer generated by OH_AudioStreamBuilder_GenerateRenderer() * @param deviceType The target device. The available deviceTypes are: -- Gitee From b8b98fb03bc12a0bd900007ac9476df93540f681 Mon Sep 17 00:00:00 2001 From: wangsen1994 Date: Sat, 28 Sep 2024 09:26:26 +0800 Subject: [PATCH 293/620] =?UTF-8?q?ans=E6=96=B0=E5=A2=9Ecapi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangsen1994 --- NotificationKit/BUILD.gn | 28 +++++++++++ NotificationKit/libohnotification.ndk.json | 6 +++ NotificationKit/notification.h | 58 ++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 NotificationKit/BUILD.gn create mode 100644 NotificationKit/libohnotification.ndk.json create mode 100644 NotificationKit/notification.h diff --git a/NotificationKit/BUILD.gn b/NotificationKit/BUILD.gn new file mode 100644 index 000000000..1e12b6983 --- /dev/null +++ b/NotificationKit/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") +ohos_ndk_headers("ohnotification_header") { + dest_dir = "$ndk_headers_out_dir/NotificationKit/" + sources = [ "./notification.h" ] +} + +ohos_ndk_library("libnotification_ndk") { + output_name = "ohnotification" + output_extension = "so" + ndk_description_file = "./libohnotification.ndk.json" + min_compact_version = "14" + system_capability = "SystemCapability.Notification.Notification" + system_capability_headers = [ "NotificationKit/notification.h" ] +} diff --git a/NotificationKit/libohnotification.ndk.json b/NotificationKit/libohnotification.ndk.json new file mode 100644 index 000000000..4a929d5ce --- /dev/null +++ b/NotificationKit/libohnotification.ndk.json @@ -0,0 +1,6 @@ +[ + { + "first_introduced": "14", + "name": "OH_Notification_IsNotificationEnabled" + } +] diff --git a/NotificationKit/notification.h b/NotificationKit/notification.h new file mode 100644 index 000000000..236608ca5 --- /dev/null +++ b/NotificationKit/notification.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup NOTIFICATION + * @{ + * + * @brief Provides the definition of the C interface for the notification service. + * + * @since 14 + */ +/** + * @file notification.h + * + * @brief Declares the APIs of notification service. + * + * @library libohnotification.so + * @kit NotificationKit + * @syscap SystemCapability.Notification.Notification + * @since 14 + */ + +#ifndef OH_NOTIFICATION_H +#define OH_NOTIFICATION_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Checks whether this application is allowed to publish notifications. + * + * @return true - This application is allowed to publish notifications. + * false - This application is not allowed to publish notifications. + * @since 14 + */ +bool OH_Notification_IsNotificationEnabled(void); + +#ifdef __cplusplus +} +#endif +#endif // OH_NOTIFICATION_H +/** @} */ -- Gitee From da9c47f7f79018fce6b7bd242d1ce8dde2c1cfe9 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Wed, 18 Sep 2024 16:50:57 +0800 Subject: [PATCH 294/620] restore OH_Drawing_FontDescriptor position Signed-off-by: changleipeng --- .../kit_sub_system/c_file_kit_sub_system.json | 15 --- .../graphic_2d/native_drawing/drawing_font.h | 7 +- .../graphic_2d/native_drawing/drawing_rect.h | 1 - .../drawing_text_font_descriptor.h | 102 +++++------------- .../native_drawing/drawing_text_line.h | 56 +++------- .../drawing_text_lineTypography.h | 11 +- .../native_drawing/drawing_text_run.h | 75 ++++++------- .../native_drawing/drawing_text_typography.h | 46 ++++++-- .../native_drawing/libnative_drawing.ndk.json | 18 ++-- 9 files changed, 120 insertions(+), 211 deletions(-) diff --git a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json index 44c8cffcf..668e349de 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json +++ b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json @@ -269,21 +269,6 @@ "kitName": "ArkGraphicsD", "subSystem": "图形图像" }, - { - "filePath": "graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h", - "kitName": "ArkGraphicsD", - "subSystem": "图形图像" - }, - { - "filePath": "graphic/graphic_2d/native_drawing/drawing_text_line.h", - "kitName": "ArkGraphicsD", - "subSystem": "图形图像" - }, - { - "filePath": "graphic/graphic_2d/native_drawing/drawing_text_run.h", - "kitName": "ArkGraphicsD", - "subSystem": "图形图像" - }, { "filePath": "graphic/graphic_2d/native_drawing/drawing_text_typography.h", "kitName": "ArkGraphicsD", diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index 0f0428395..ca4eac990 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -539,15 +539,14 @@ OH_Drawing_ErrorCode OH_Drawing_FontGetPathForGlyph(const OH_Drawing_Font* font, * @param font Indicates the pointer to an OH_Drawing_Font object. * @param text Indicates the character storage encoded with text encoding. * @param byteLength Indicates the text length in bytes. - * @param encoding Indicates the text encoding. - * @param x Indicates x coordinates of the text. + * @param encoding OH_Drawing_TextEncoding Indicates the text encoding. + * @param x Indicates x coordinates of the text. * @param y Indicates y coordinates of the text. - * @param path The path object, returned to the caller. + * @param path OH_Drawing_Path The path object, returned to the caller. * @return Returns the error code. * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font, text or path is nullptr. * @since 14 - * @version 1.0 */ OH_Drawing_ErrorCode OH_Drawing_FontGetTextPath(const OH_Drawing_Font* font, const void* text, size_t byteLength, OH_Drawing_TextEncoding encoding, float x, float y, OH_Drawing_Path* path); diff --git a/graphic/graphic_2d/native_drawing/drawing_rect.h b/graphic/graphic_2d/native_drawing/drawing_rect.h index 02c134f2b..6ea9ca992 100644 --- a/graphic/graphic_2d/native_drawing/drawing_rect.h +++ b/graphic/graphic_2d/native_drawing/drawing_rect.h @@ -255,7 +255,6 @@ OH_Drawing_ErrorCode OH_Drawing_RectGetArraySize(OH_Drawing_Array* rectArray, si * or index is valid. * @since 14 * @version 1.0 - * @note Return nullptr if OH_Drawing_Array or index invalid. */ OH_Drawing_ErrorCode OH_Drawing_RectGetArrayElement(OH_Drawing_Array* rectArray, size_t index, OH_Drawing_Rect** rect); diff --git a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h index 270e7c602..e6c262107 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_TEXT_FONT_DESCRIPTOR_H -#define C_INCLUDE_DRAWING_TEXT_FONT_DESCRIPTOR_H - /** * @addtogroup Drawing * @{ @@ -24,7 +21,7 @@ * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * - * @since 8 + * @since 14 * @version 1.0 */ @@ -36,34 +33,23 @@ * @kit ArkGraphics2D * @library libnative_drawing.so * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @since 8 + * @since 14 * @version 1.0 */ -#include "drawing_types.h" +#ifndef DRAWING_TEXT_FONT_DESCRIPTOR_H +#define DRAWING_TEXT_FONT_DESCRIPTOR_H + +#include "drawing_text_typography.h" #ifdef __cplusplus extern "C" { #endif -/** - * @brief Type style flag. - * - * @since 14 - * @version 1.0 - */ -typedef enum { - /** Italic font */ - ITALIC = 1 << 0, - /** Bold font */ - BOLD = 1 << 1, -} OH_Drawing_FontTypeStyle; - /** * @brief An enumeration of system font types. * * @since 14 - * @version 1.0 */ typedef enum { /** All font types */ @@ -77,52 +63,20 @@ typedef enum { } OH_Drawing_SystemFontType; /** - * @brief Describes the font information. - * - * @since 12 - * @version 1.0 - */ -typedef struct OH_Drawing_FontDescriptor { - /** The file path of System font */ - char* path; - /** A name that uniquely identifies the font */ - char* postScriptName; - /** The name of System font */ - char* fullName; - /** The family of System font */ - char* fontFamily; - /** The subfont family of the system font */ - char* fontSubfamily; - /** The weight of System font */ - int weight; - /** The width of System font */ - int width; - /** Whether the system font is tilted */ - int italic; - /** Whether the system font is compact */ - bool monoSpace; - /** whether symbolic fonts are supported */ - bool symbolic; - /** Font size */ - size_t size; - /** Font style flag, from OH_Drawing_FontTypeStyle */ - int typeStyle; -} OH_Drawing_FontDescriptor; - -/** - * @brief Obtain all system font descriptive symbols that match the specified font descriptor. Where the 'path' and - * 'size' fields are not considered as valid matching values, It takes effect when the remaining fields are not + * @brief Obtain all system font descriptive symbols that match the specified font descriptor. Where the 'path' + * fields are not considered as valid matching values, It takes effect when the remaining fields are not * default values, If all the fields of the parameters OH_Drawing_FontDescriptor are default, obtain all system * font descriptors. If the match fails, return nullptr. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_FontDescriptor The pointer to the OH_Drawing_FontDescriptor object. It is recommended to - * use OH_Drawing_CreateFontDescriptor to obtain a valid OH_Drawing_FontDescriptor instance. If you create your own - * OH_Drawing_FontDescriptor object, ensure that fields not intended for matching are set to their default values. + * use OH_Drawing_CreateFontDescriptor to obtain a valid OH_Drawing_FontDescriptor instance. + * If you create your own OH_Drawing_FontDescriptor object, ensure that fields not intended for matching are + * set to their default values. * @param size_t Indicates the count of obtained OH_Drawing_FontDescriptor. - * @return Returns an array of OH_Drawing_FontDescriptor. + * @return Returns an array of OH_Drawing_FontDescriptor. Released through the + * OH_Drawing_DestroyFontDescriptors interface after use. * @since 14 - * @version 1.0 */ OH_Drawing_FontDescriptor* OH_Drawing_MatchFontDescriptors(OH_Drawing_FontDescriptor*, size_t*); @@ -130,38 +84,36 @@ OH_Drawing_FontDescriptor* OH_Drawing_MatchFontDescriptors(OH_Drawing_FontDescri * @brief Releases the OH_Drawing_FontDescriptor array. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontDescriptor Pointer to OH_Drawing_FontDescriptor array. - * @param size_t Represents the number of members of the OH_Drawing_FontDescriptor array. + * @param OH_Drawing_FontDescriptor OH_Drawing_FontDescriptor object array. + * @param size_t Represents the number of members of the OH_Drawing_FontDescriptor array. * @since 14 - * @version 1.0 */ void OH_Drawing_DestroyFontDescriptors(OH_Drawing_FontDescriptor*, size_t); /** - * @brief Get the OH_Drawing_FontDescriptor object by the full name of the font, supporting generic fonts, - * stylish fonts, and installed fonts. + * @brief Get the OH_Drawing_FontDescriptor object by the font full name and the font type, supporting generic + * fonts, stylish fonts, and installed fonts. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_String* Indicates the full name object OH_Drawing_String. + * @param OH_Drawing_String Indicates the full name object OH_Drawing_String. + * @param OH_Drawing_SystemFontType Indicates enumerates of system font type object OH_Drawing_SystemFontType. * @return Returns the pointer to a font descriptor object OH_Drawing_FontDescriptor. * @since 14 - * @version 1.0 */ -OH_Drawing_FontDescriptor* OH_Drawing_GetFontDescriptorByFullName(const OH_Drawing_String*); +OH_Drawing_FontDescriptor* OH_Drawing_GetFontDescriptorByFullName(const OH_Drawing_String*, OH_Drawing_SystemFontType); /** - * @brief Obtain the corresponding font full name list by the font type. + * @brief Obtain the corresponding font full name array by the font type. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_SystemFontType Indicates enumerates of system font type. + * @param OH_Drawing_SystemFontType Indicates enumerates of system font type object OH_Drawing_SystemFontType. * @return Returns the pointer to full name array object OH_Drawing_Array. * @since 14 - * @version 1.0 */ OH_Drawing_Array* OH_Drawing_GetSystemFontFullNamesByType(OH_Drawing_SystemFontType); /** - * @brief Get the specified full name object OH_Drawing_String by index from the + * @brief Get the specified full name object OH_Drawing_String by index from the * OH_Drawing_Array object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @@ -169,17 +121,15 @@ OH_Drawing_Array* OH_Drawing_GetSystemFontFullNamesByType(OH_Drawing_SystemFontT * @param size_t The index of full name. * @return Returns a full name object OH_Drawing_String. * @since 14 - * @version 1.0 */ -const OH_Drawing_String* OH_Drawing_GetSystemFontFullNamesElement(OH_Drawing_Array*, size_t); +const OH_Drawing_String* OH_Drawing_GetSystemFontFullNameByIndex(OH_Drawing_Array*, size_t); /** - * @brief Releases the memory occupied by a list of system font names. + * @brief Releases the memory occupied by an array of font full names. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Array Indicates an array of full name. + * @param OH_Drawing_Array Indicates an array of full name object OH_Drawing_Array. * @since 14 - * @version 1.0 */ void OH_Drawing_DestroySystemFontFullNames(OH_Drawing_Array*); diff --git a/graphic/graphic_2d/native_drawing/drawing_text_line.h b/graphic/graphic_2d/native_drawing/drawing_text_line.h index e83eead09..196907ed5 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_line.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_line.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_TEXT_LINE_H -#define C_INCLUDE_DRAWING_TEXT_LINE_H - /** * @addtogroup Drawing * @{ @@ -37,6 +34,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_TEXT_LINE_H +#define C_INCLUDE_DRAWING_TEXT_LINE_H + #include "drawing_text_declaration.h" #include "drawing_types.h" @@ -48,10 +48,9 @@ extern "C" { * @brief Get text line information. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. + * @param typography Indicates the pointer to a typography object OH_Drawing_Typography. * @return Indicates the pointer to a text line array object OH_Drawing_Array. * @since 14 - * @version 1.0 */ OH_Drawing_Array* OH_Drawing_TypographyGetTextLines(OH_Drawing_Typography* typography); @@ -80,12 +79,11 @@ void OH_Drawing_DestroyTextLine(OH_Drawing_TextLine* line); * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param lines Indicates the pointer to the text line array object OH_Drawing_Array. - * @param index text line object index. + * @param index The text line object index. * @return Indicates the pointer to a text line object OH_Drawing_TextLine. * @since 14 - * @version 1.0 */ -OH_Drawing_TextLine* OH_Drawing_GetTextLinesIndex(OH_Drawing_Array* lines, size_t index); +OH_Drawing_TextLine* OH_Drawing_GetTextLineByIndex(OH_Drawing_Array* lines, size_t index); /** * @brief Get the count of glyphs. @@ -136,19 +134,18 @@ void OH_Drawing_DestroyRuns(OH_Drawing_Array* runs); * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param runs Indicates the pointer to the run array object OH_Drawing_Array. - * @param index run object index. + * @param index The run object index. * @return Indicates the pointer to a run object OH_Drawing_Run. * @since 14 - * @version 1.0 */ -OH_Drawing_Run* OH_Drawing_GetRunsIndex(OH_Drawing_Array* runs, size_t index); +OH_Drawing_Run* OH_Drawing_GetRunByIndex(OH_Drawing_Array* runs, size_t index); /** * @brief Paint the range of text line. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param line Indicates the pointer to an OH_Drawing_TextLine object. - * @param canvas Draw the text line on the canvas. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @param x Represents the X-axis position on the canvas. * @param y Represents the Y-axis position on the canvas. * @since 14 @@ -214,10 +211,9 @@ double OH_Drawing_TextLineGetTrailingSpaceWidth(OH_Drawing_TextLine* line); * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param line Indicates the pointer to an OH_Drawing_TextLine object. - * @param point The given position. + * @param point Indicates the pointer to an OH_Drawing_Point object. * @return Returns the string index for a given position. * @since 14 - * @version 1.0 */ int32_t OH_Drawing_TextLineGetStringIndexForPosition(OH_Drawing_TextLine* line, OH_Drawing_Point* point); @@ -227,38 +223,10 @@ int32_t OH_Drawing_TextLineGetStringIndexForPosition(OH_Drawing_TextLine* line, * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param line Indicates the pointer to an OH_Drawing_TextLine object. * @param index The given string index. - * @param secondOffset Indicates the pointer to the offset of compound character, not supported. - * @return Returns the offset info for a given string index. - * @since 14 - * @version 1.0 - */ -double OH_Drawing_TextLineGetOffsetForStringIndex(OH_Drawing_TextLine* line, int32_t index, double* secondOffset); - -/** - * @brief User-defined callback functions for using offsets and indexes. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param offset Character offset is traversed as an argument to the callback function. - * @param index Character index is traversed as an argument to the callback function. - * @param leadingEdge Whether the current offset is at the character front, as an argument to the callback function. - * @return The return value of the user-defined callback function. - * If false is returned, the traversal continues. - * If true is returned, the traversal stops. + * @return Returns the offset for a given string index. * @since 14 - * @version 1.0 - */ -typedef bool (*CustomCallback)(double offset, int32_t index, bool leadingEdge); - -/** - * @brief Enumerate caret offset and index in text lines. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param line Indicates the pointer to an OH_Drawing_TextLine object. - * @param callback User-defined callback functions, see CustomCallback. - * @since 14 - * @version 1.0 */ -void OH_Drawing_TextLineEnumerateCaretOffsets(OH_Drawing_TextLine* line, CustomCallback callback); +double OH_Drawing_TextLineGetOffsetForStringIndex(OH_Drawing_TextLine* line, int32_t index); /** * @brief Gets the text offset based on the given alignment factor and alignment width. diff --git a/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h b/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h index f480cd643..6d20d529b 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_TEXT_LINETYPOGRAPHY_H -#define C_INCLUDE_DRAWING_TEXT_LINETYPOGRAPHY_H - /** * @addtogroup Drawing * @{ @@ -40,7 +37,9 @@ * @version 1.0 */ -#include "cstddef" +#ifndef DRAWING_TEXT_LINETYPOGRAPHY_H +#define DRAWING_TEXT_LINETYPOGRAPHY_H + #include "drawing_text_declaration.h" #ifdef __cplusplus @@ -54,7 +53,6 @@ extern "C" { * @param OH_Drawing_TypographyCreate Indicates the pointer to an OH_Drawing_TypographyCreate object. * @return Returns the pointer to the OH_Drawing_LineTypography object created. * @since 14 - * @version 1.0 */ OH_Drawing_LineTypography* OH_Drawing_CreateLineTypography(OH_Drawing_TypographyCreate* handler); @@ -64,7 +62,6 @@ OH_Drawing_LineTypography* OH_Drawing_CreateLineTypography(OH_Drawing_Typography * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_LineTypography Indicates the pointer to an OH_Drawing_LineTypography object. * @since 14 - * @version 1.0 */ void OH_Drawing_DestroyLineTypography(OH_Drawing_LineTypography* lineTypography); @@ -77,7 +74,6 @@ void OH_Drawing_DestroyLineTypography(OH_Drawing_LineTypography* lineTypography) * @param width Indicates the requested line-break width. * @return Returns the count of the characters from startIndex that would cause the line break. * @since 14 - * @version 1.0 */ size_t OH_Drawing_LineTypographyGetLineBreak(OH_Drawing_LineTypography* lineTypography, size_t startIndex, double width); @@ -91,7 +87,6 @@ size_t OH_Drawing_LineTypographyGetLineBreak(OH_Drawing_LineTypography* lineTypo * @param count Indicates the characters count of the text range. * @return Returns the pointer to the OH_Drawing_TextLine object created. * @since 14 - * @version 1.0 */ OH_Drawing_TextLine* OH_Drawing_LineTypographyCreateLine(OH_Drawing_LineTypography* lineTypography, size_t startIndex, size_t count); diff --git a/graphic/graphic_2d/native_drawing/drawing_text_run.h b/graphic/graphic_2d/native_drawing/drawing_text_run.h index 28949dc42..b71a197dd 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_run.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_run.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_TEXT_RUN_H -#define C_INCLUDE_DRAWING_TEXT_RUN_H - /** * @addtogroup Drawing * @{ @@ -37,6 +34,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_TEXT_RUN_H +#define C_INCLUDE_DRAWING_TEXT_RUN_H + #include "drawing_text_declaration.h" #include "drawing_types.h" @@ -47,12 +47,11 @@ extern "C" { * @brief Gets the run glyph indices ,the offset of the index relative to the entire paragraph. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @param run Indicates the pointer to an OH_Drawing_Run object. * @param start The run of start index. * @param length The run of length, if start and length are set to 0, then get all of the current run. - * @return Run of glyph indices array. + * @return Run of glyph indices array object OH_Drawing_Array. * @since 14 - * @version 1.0 */ OH_Drawing_Array* OH_Drawing_GetRunStringIndices(OH_Drawing_Run* run, int64_t start, int64_t length); @@ -60,21 +59,19 @@ OH_Drawing_Array* OH_Drawing_GetRunStringIndices(OH_Drawing_Run* run, int64_t st * @brief Gets the run glyph indices by index. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Array the run glyph indices array. + * @param stringIndices the run glyph indices array object OH_Drawing_Array. * @param index The run of glyph index. * @return Run of glyph indices element. * @since 14 - * @version 1.0 */ -uint64_t OH_Drawing_GetRunStringIndicesElement(OH_Drawing_Array* stringIndices, size_t index); +uint64_t OH_Drawing_GetRunStringIndicesByIndex(OH_Drawing_Array* stringIndices, size_t index); /** * @brief Releases the memory run glyph indices array. - * + * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param stringIndices glyph indices the pointer. + * @param stringIndices glyph indices array object OH_Drawing_Array. * @since 14 - * @version 1.0 */ void OH_Drawing_DestroyRunStringIndices(OH_Drawing_Array* stringIndices); @@ -82,11 +79,10 @@ void OH_Drawing_DestroyRunStringIndices(OH_Drawing_Array* stringIndices); * @brief Gets the range run glyph location and length. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @param run Indicates the pointer to an OH_Drawing_Run object. * @param location The run of glyph location. * @param length The run of glyph length. * @since 14 - * @version 1.0 */ void OH_Drawing_GetRunStringRange(OH_Drawing_Run* run, uint64_t* location, uint64_t* length); @@ -94,13 +90,12 @@ void OH_Drawing_GetRunStringRange(OH_Drawing_Run* run, uint64_t* location, uint6 * @brief Gets the run typographic bound. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @param run Indicates the pointer to an OH_Drawing_Run object. * @param ascent The run of ascent. * @param descent The run of descent. * @param leading The run of leading. * @return run typographic width. * @since 14 - * @version 1.0 */ float OH_Drawing_GetRunTypographicBounds(OH_Drawing_Run* run, float* ascent, float* descent, float* leading); @@ -108,12 +103,11 @@ float OH_Drawing_GetRunTypographicBounds(OH_Drawing_Run* run, float* ascent, flo * @brief Paints text on the canvas. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param run Indicates the pointer to an OH_Drawing_Run object. * @param x Indicates the x coordinate. * @param y Indicates the y coordinate. * @since 14 - * @version 1.0 */ void OH_Drawing_RunPaint(OH_Drawing_Canvas* canvas, OH_Drawing_Run* run, double x, double y); @@ -121,10 +115,9 @@ void OH_Drawing_RunPaint(OH_Drawing_Canvas* canvas, OH_Drawing_Run* run, double * @brief Gets the run image bound. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. - * @return OH_Drawing_Rect The run image bounds. + * @param run Indicates the pointer to an OH_Drawing_Run object. + * @return The run image bounds to an OH_Drawing_Rect object. * @since 14 - * @version 1.0 */ OH_Drawing_Rect* OH_Drawing_GetRunImageBounds(OH_Drawing_Run* run); @@ -132,22 +125,20 @@ OH_Drawing_Rect* OH_Drawing_GetRunImageBounds(OH_Drawing_Run* run); * @brief Releases the memory run image bounds pointer. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Rect Run image bounds pointer. + * @param rect Run image bounds to an OH_Drawing_Rect object. * @since 14 - * @version 1.0 */ void OH_Drawing_DestroyRunImageBounds(OH_Drawing_Rect* rect); /** * @brief Gets the range glyph identifier for each character. - * + * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @param run Indicates the pointer to an OH_Drawing_Run object. * @param start The run of start index. * @param length The run of length, if start and length are set to 0, then get all of the current run. - * @return Run of glyph array. + * @return Run of glyph array object OH_Drawing_ArrayOH_Drawing_Array. * @param index The run of glyph index. * @return Run of glyph element. * @since 14 * @version 1.0 */ -uint16_t OH_Drawing_GetRunGlyphsElement(OH_Drawing_Array* glyphs, size_t index); +uint16_t OH_Drawing_GetRunGlyphsByIndex(OH_Drawing_Array* glyphs, size_t index); /** * @brief Releases the memory run glyph array. - * + * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param glyphs The run of glyph array. + * @param glyphs The run of glyph array object OH_Drawing_Array. * @since 14 - * @version 1.0 */ void OH_Drawing_DestroyRunGlyphs(OH_Drawing_Array* glyphs); @@ -177,12 +167,11 @@ void OH_Drawing_DestroyRunGlyphs(OH_Drawing_Array* glyphs); * @brief Gets the range glyph position array. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @param run Indicates the pointer to an OH_Drawing_Run object. * @param start The run of start index. * @param length The run of length, if start and length are set to 0, then get all of the current run. - * @return Run of position array. + * @return Run of position array object OH_Drawing_Array. * @since 14 - * @version 1.0 */ OH_Drawing_Array* OH_Drawing_GetRunPositions(OH_Drawing_Run* run, int64_t start, int64_t length); @@ -190,21 +179,20 @@ OH_Drawing_Array* OH_Drawing_GetRunPositions(OH_Drawing_Run* run, int64_t start, * @brief Gets the glyph position by index. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Array The run of position array. + * @param positions The run of position array object OH_Drawing_Array. * @param index The run of glyph index. - * @return Run of glyph position pointer. + * @return Run of glyph position pointer to an OH_Drawing_Point object. * @since 14 * @version 1.0 */ -OH_Drawing_Point* OH_Drawing_GetRunPositionsElement(OH_Drawing_Array* positions, size_t index); +OH_Drawing_Point* OH_Drawing_GetRunPositionsByIndex(OH_Drawing_Array* positions, size_t index); /** * @brief Releases the memory run of position array. - * + * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param positions The run of position array. + * @param positions The run of position array object OH_Drawing_Array. * @since 14 - * @version 1.0 */ void OH_Drawing_DestroyRunPositions(OH_Drawing_Array* positions); @@ -212,10 +200,9 @@ void OH_Drawing_DestroyRunPositions(OH_Drawing_Array* positions); * @brief Gets the number of glyph. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Run Indicates the pointer to an OH_Drawing_Run object. + * @param run Indicates the pointer to an OH_Drawing_Run object. * @return The number of glyph. * @since 14 - * @version 1.0 */ uint32_t OH_Drawing_GetRunGlyphCount(OH_Drawing_Run* run); #ifdef __cplusplus diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 977062e81..28ffa8f5a 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -45,7 +45,6 @@ #include "drawing_color.h" #include "drawing_font.h" #include "drawing_text_declaration.h" -#include "drawing_text_font_descriptor.h" #include "drawing_types.h" #include "stdint.h" @@ -413,6 +412,35 @@ typedef struct OH_Drawing_FontConfigInfo { OH_Drawing_FontFallbackGroup* fallbackGroupSet; } OH_Drawing_FontConfigInfo; +/** + * @brief Describes the font information. + * + * @since 12 + * @version 1.0 + */ +typedef struct OH_Drawing_FontDescriptor { + /** The file path of System font */ + char* path; + /** A name that uniquely identifies the font */ + char* postScriptName; + /** The name of System font */ + char* fullName; + /** The family of System font */ + char* fontFamily; + /** The subfont family of the system font */ + char* fontSubfamily; + /** The weight of System font */ + int weight; + /** The width of System font */ + int width; + /** Whether the system font is tilted */ + int italic; + /** Whether the system font is compact */ + bool monoSpace; + /** whether symbolic fonts are supported */ + bool symbolic; +} OH_Drawing_FontDescriptor; + /** * @brief The metrics of line. * @@ -2754,8 +2782,10 @@ void OH_Drawing_SetTextShadow(OH_Drawing_TextShadow* shadow, uint32_t color, OH_ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TextAlign Indicates enumerates text tab alignment modes. TAB alignment, Support left alignment * right alignment center alignment, other enumeration values are left alignment effect. - * @param float Indicates location if text tab. - * @return Returns the pointer to the OH_Drawing_TextTab object created. + * @param float Indicates location of text tab. + * @return Returns the pointer to the OH_Drawing_TextTab object created. If the object returns NULL, + * the creation failed. The possible cause of the failure is that the application address space is used up. + * As a result, space cannot be allocated. * @since 14 * @version 1.0 */ @@ -2772,7 +2802,7 @@ OH_Drawing_TextTab* OH_Drawing_CreateTextTab(OH_Drawing_TextAlign alignment, flo void OH_Drawing_DestroyTextTab(OH_Drawing_TextTab*); /** - * @brief Get align of an OH_Drawing_TextTab object. + * @brief Get alignment of an OH_Drawing_TextTab object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TextTab Indicates the pointer to an OH_Drawing_TextTab object. @@ -2780,7 +2810,7 @@ void OH_Drawing_DestroyTextTab(OH_Drawing_TextTab*); * @since 14 * @version 1.0 */ -OH_Drawing_TextAlign OH_Drawing_GetTextTabAlign(OH_Drawing_TextTab*); +OH_Drawing_TextAlign OH_Drawing_GetTextTabAlignment(OH_Drawing_TextTab*); /** * @brief Get location of an OH_Drawing_TextTab object. @@ -2795,9 +2825,9 @@ float OH_Drawing_GetTextTabLocation(OH_Drawing_TextTab*); /** * @brief Sets the text tab of OH_Drawing_TypographyStyle object. - * TAB alignment does not take effect when text alignment is also set. Or when the TAB's location property - * is less than or equal to 0. When the TAB is not set, it is the default space effect, and all tabs in the paragraph - * after the setting are aligned according to this tab effect. + * Tab alignment does not take effect when text alignment is also set, Or when the ellipsis style is configured. + * When the tab is not set or the tab's location property is less than or equal to 0, it is the default space effect. + * And all tabs in the paragraph after the setting are aligned according to this tab effect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 264d710ff..870a68817 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -936,7 +936,7 @@ }, { "first_introduced": "14", - "name": "OH_Drawing_GetSystemFontFullNamesElement" + "name": "OH_Drawing_GetSystemFontFullNameByIndex" }, { "first_introduced": "14", @@ -1548,7 +1548,7 @@ }, { "first_introduced": "14", - "name":"OH_Drawing_GetTextTabAlign" + "name":"OH_Drawing_GetTextTabAlignment" }, { "first_introduced": "14", @@ -1580,7 +1580,7 @@ }, { "first_introduced": "14", - "name":"OH_Drawing_GetTextLinesIndex" + "name":"OH_Drawing_GetTextLineByIndex" }, { "first_introduced": "14", @@ -1600,7 +1600,7 @@ }, { "first_introduced": "14", - "name":"OH_Drawing_GetRunsIndex" + "name":"OH_Drawing_GetRunByIndex" }, { "first_introduced": "14", @@ -1630,10 +1630,6 @@ "first_introduced": "14", "name":"OH_Drawing_TextLineGetOffsetForStringIndex" }, - { - "first_introduced": "14", - "name":"OH_Drawing_TextLineEnumerateCaretOffsets" - }, { "first_introduced": "14", "name":"OH_Drawing_TextLineGetAlignmentOffset" @@ -1644,7 +1640,7 @@ }, { "first_introduced": "14", - "name":"OH_Drawing_GetRunStringIndicesElement" + "name":"OH_Drawing_GetRunStringIndicesByIndex" }, { "first_introduced": "14", @@ -1676,7 +1672,7 @@ }, { "first_introduced": "14", - "name":"OH_Drawing_GetRunGlyphsElement" + "name":"OH_Drawing_GetRunGlyphsByIndex" }, { "first_introduced": "14", @@ -1688,7 +1684,7 @@ }, { "first_introduced": "14", - "name":"OH_Drawing_GetRunPositionsElement" + "name":"OH_Drawing_GetRunPositionsByIndex" }, { "first_introduced": "14", -- Gitee From c6bdb322b0541e8cbbc6a0a79787a8d5a35e8d86 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Sun, 29 Sep 2024 11:24:11 +0800 Subject: [PATCH 295/620] fix callback interface Signed-off-by: changleipeng --- .../native_drawing/drawing_text_line.h | 25 +++++++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 4 +++ 2 files changed, 29 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_line.h b/graphic/graphic_2d/native_drawing/drawing_text_line.h index 196907ed5..760769b4b 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_line.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_line.h @@ -228,6 +228,31 @@ int32_t OH_Drawing_TextLineGetStringIndexForPosition(OH_Drawing_TextLine* line, */ double OH_Drawing_TextLineGetOffsetForStringIndex(OH_Drawing_TextLine* line, int32_t index); +/** + * @brief User-defined callback functions for using offsets and indexes. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param offset Character offset is traversed as an argument to the callback function. + * @param index Character index is traversed as an argument to the callback function. + * @param leadingEdge Whether the current offset is at the character front, as an argument to the callback function. + * @return The return value of the user-defined callback function. + * If false is returned, the traversal continues. + * If true is returned, the traversal stops. + * @since 14 + * @version 1.0 + */ +typedef bool (*Drawing_CaretOffsetsCallback)(double offset, int32_t index, bool leadingEdge); + +/** + * @brief Enumerate caret offset and index in text lines. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param line Indicates the pointer to an OH_Drawing_TextLine object. + * @param callback User-defined callback functions, see Drawing_CaretOffsetsCallback. + * @since 14 + */ +void OH_Drawing_TextLineEnumerateCaretOffsets(OH_Drawing_TextLine* line, Drawing_CaretOffsetsCallback callback); + /** * @brief Gets the text offset based on the given alignment factor and alignment width. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 3f0f7905b..353ce3f53 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1654,6 +1654,10 @@ "first_introduced": "14", "name":"OH_Drawing_TextLineGetOffsetForStringIndex" }, + { + "first_introduced": "14", + "name": "OH_Drawing_TextLineEnumerateCaretOffsets" + }, { "first_introduced": "14", "name":"OH_Drawing_TextLineGetAlignmentOffset" -- Gitee From 062297e7bbe4d7f066fb785fbb9121eaca1e3c05 Mon Sep 17 00:00:00 2001 From: wangsen1994 Date: Sun, 29 Sep 2024 19:31:10 +0800 Subject: [PATCH 296/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E4=B8=BA13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangsen1994 --- NotificationKit/BUILD.gn | 2 +- NotificationKit/libohnotification.ndk.json | 2 +- NotificationKit/notification.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NotificationKit/BUILD.gn b/NotificationKit/BUILD.gn index 1e12b6983..eff7eea6e 100644 --- a/NotificationKit/BUILD.gn +++ b/NotificationKit/BUILD.gn @@ -22,7 +22,7 @@ ohos_ndk_library("libnotification_ndk") { output_name = "ohnotification" output_extension = "so" ndk_description_file = "./libohnotification.ndk.json" - min_compact_version = "14" + min_compact_version = "13" system_capability = "SystemCapability.Notification.Notification" system_capability_headers = [ "NotificationKit/notification.h" ] } diff --git a/NotificationKit/libohnotification.ndk.json b/NotificationKit/libohnotification.ndk.json index 4a929d5ce..24b56b30a 100644 --- a/NotificationKit/libohnotification.ndk.json +++ b/NotificationKit/libohnotification.ndk.json @@ -1,6 +1,6 @@ [ { - "first_introduced": "14", + "first_introduced": "13", "name": "OH_Notification_IsNotificationEnabled" } ] diff --git a/NotificationKit/notification.h b/NotificationKit/notification.h index 236608ca5..d7a31be18 100644 --- a/NotificationKit/notification.h +++ b/NotificationKit/notification.h @@ -19,7 +19,7 @@ * * @brief Provides the definition of the C interface for the notification service. * - * @since 14 + * @since 13 */ /** * @file notification.h @@ -29,7 +29,7 @@ * @library libohnotification.so * @kit NotificationKit * @syscap SystemCapability.Notification.Notification - * @since 14 + * @since 13 */ #ifndef OH_NOTIFICATION_H @@ -47,7 +47,7 @@ extern "C" { * * @return true - This application is allowed to publish notifications. * false - This application is not allowed to publish notifications. - * @since 14 + * @since 13 */ bool OH_Notification_IsNotificationEnabled(void); -- Gitee From bae22027088154b904bab3ff475fb5e09314f1b8 Mon Sep 17 00:00:00 2001 From: zoulinken Date: Wed, 25 Sep 2024 14:28:37 +0800 Subject: [PATCH 297/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=A5=E5=8F=82?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=EF=BC=8C=E4=BF=9D=E6=8C=81=E5=A4=9A=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zoulinken --- arkui/ace_engine/native/libace.ndk.json | 4 ++-- arkui/ace_engine/native/native_node.h | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 3da27da07..9bc15b03c 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -1296,11 +1296,11 @@ "name": "OH_ArkUI_NodeUtils_GetPositionWithTranslateInScreen" }, { - "first_introduced": "14", + "first_introduced": "13", "name": "OH_ArkUI_NodeUtils_AddCustomProperty" }, { - "first_introduced": "14", + "first_introduced": "13", "name": "OH_ArkUI_NodeUtils_RemoveCustomProperty" }, { diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index a8ff1e5dd..68f16504a 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -7684,20 +7684,20 @@ int32_t OH_ArkUI_NodeUtils_GetPositionWithTranslateInScreen(ArkUI_NodeHandle nod * @brief Add the custom property of the component. * * @param node ArkUI_NodeHandle pointer. - * @param key The key of the custom property. - * @param key The value of the custom property. - * @since 14 + * @param name The name of the custom property. + * @param value The value of the custom property. + * @since 13 */ -void OH_ArkUI_NodeUtils_AddCustomProperty(ArkUI_NodeHandle node, const char* key, const char* value); +void OH_ArkUI_NodeUtils_AddCustomProperty(ArkUI_NodeHandle node, const char* name, const char* value); /** * @brief Remove the custom property of the component. * * @param node ArkUI_NodeHandle pointer. - * @param key The key of the custom property. - * @since 14 + * @param name The name of the custom property. + * @since 13 */ -void OH_ArkUI_NodeUtils_RemoveCustomProperty(ArkUI_NodeHandle node, const char* key); +void OH_ArkUI_NodeUtils_RemoveCustomProperty(ArkUI_NodeHandle node, const char* name); /** * @brief Collapse the ListItem in its expanded state. -- Gitee From 93fc1e3f5592341ed87b6b77f8b1516c00abaca2 Mon Sep 17 00:00:00 2001 From: gxjhl Date: Sat, 5 Oct 2024 16:56:27 +0800 Subject: [PATCH 298/620] =?UTF-8?q?=E5=90=8C=E4=B8=80=E4=B8=AA=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=A3=B0=E6=98=8E=E4=BA=86=E4=B8=A4=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gxjhl Change-Id: If7059b9ca7005d206ebd3032b038d7e1e2ceb4f6 --- arkui/ace_engine/native/native_type.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 18f2e18b6..7285cded2 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -2502,16 +2502,6 @@ void OH_ArkUI_WaterFlowSectionOption_SetMargin(ArkUI_WaterFlowSectionOption* opt */ ArkUI_Margin OH_ArkUI_WaterFlowSectionOption_GetMargin(ArkUI_WaterFlowSectionOption* option, int32_t index); -/** -* @brief Obtains the number of items in the water flow section that matches the specified index. -* -* @param option Indicates the pointer to a water flow section configuration. -* @param index Indicates the index of the target water flow section. -* @return Returns the number of items in the water flow section. -* @since 12 -*/ -int32_t OH_ArkUI_WaterFlowSectionOption_GetItemCount(ArkUI_WaterFlowSectionOption* option, int32_t index); - /** * @brief Creates a navigation indicator. * -- Gitee From d3dd74711ddccf2b9952f18b79961f915102a0cf Mon Sep 17 00:00:00 2001 From: hongzexuan Date: Fri, 27 Sep 2024 13:53:20 +0800 Subject: [PATCH 299/620] scroll capi supports fling Signed-off-by: hongzexuan Change-Id: I943e83f0a0865935522320952008d4d21aa2013a --- arkui/ace_engine/native/native_node.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index a8ff1e5dd..d8fb1258a 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -4483,6 +4483,18 @@ typedef enum { */ NODE_SCROLL_BY, + /** + * @brief Performs inertial scrolling based on the initial velocity passed in. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: Initial velocity of inertial scrolling. Unit: vp/s. If the value specified is 0, it is + * considered as invalid, and the scrolling for this instance will not take effect. If the value is positive, + * the scroll will move downward; if the value is negative, the scroll will move upward. \n + * + * @since 13 + */ + NODE_SCROLL_FLING, + /** * @brief Defines the direction in which the list items are arranged. This attribute can be set, reset, and * obtained as required through APIs. -- Gitee From a19e618834c9ac62ed3f3292cd3741af08e808d2 Mon Sep 17 00:00:00 2001 From: zhjs Date: Tue, 8 Oct 2024 16:53:36 +0800 Subject: [PATCH 300/620] add variable quality level Signed-off-by: zhjs --- .../image_processing/libimage_processing.ndk.json | 5 +++++ .../video_processing/libvideo_processing.ndk.json | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json b/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json index 13425858f..918e744ee 100644 --- a/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json +++ b/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json @@ -83,5 +83,10 @@ "first_introduced": "13", "name": "IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER", "type": "variable" + }, + { + "first_introduced": "13", + "name": "IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL", + "type": "variable" } ] diff --git a/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json b/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json index dd2fe35ab..19fc6e2cc 100644 --- a/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json +++ b/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json @@ -89,5 +89,10 @@ "first_introduced": "12", "name": "VIDEO_PROCESSING_TYPE_DETAIL_ENHANCER", "type": "variable" + }, + { + "first_introduced": "12", + "name": "VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL", + "type": "variable" } ] -- Gitee From 2089f4d326014424ad98e91ddc46e7fbd2dc0b65 Mon Sep 17 00:00:00 2001 From: lihui Date: Wed, 9 Oct 2024 12:17:12 +0800 Subject: [PATCH 301/620] pts api since api 14 fix Signed-off-by: lihui --- graphic/graphic_2d/native_window/external_window.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_window/external_window.h b/graphic/graphic_2d/native_window/external_window.h index 23d98d207..f2b57576e 100644 --- a/graphic/graphic_2d/native_window/external_window.h +++ b/graphic/graphic_2d/native_window/external_window.h @@ -264,7 +264,7 @@ typedef enum NativeWindowOperation { * the desiredPresentTimestamp will be ignored.\n * Variable parameter in function is * [in] int64_t desiredPresentTimestamp. - * @since 13 + * @since 14 */ SET_DESIRED_PRESENT_TIMESTAMP = 24, } NativeWindowOperation; -- Gitee From a9234c9c306e3d678713485eb5e96ea42accdaff Mon Sep 17 00:00:00 2001 From: zoulinken Date: Wed, 9 Oct 2024 16:53:56 +0800 Subject: [PATCH 302/620] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=B1=9E=E6=80=A7=E7=9A=84=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zoulinken --- arkui/ace_engine/native/native_node.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 4ba7d5ff2..859a52e31 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -7693,11 +7693,11 @@ int32_t OH_ArkUI_NodeUtils_GetPositionWithTranslateInWindow(ArkUI_NodeHandle nod int32_t OH_ArkUI_NodeUtils_GetPositionWithTranslateInScreen(ArkUI_NodeHandle node, ArkUI_IntOffset* translateOffset); /** - * @brief Add the custom property of the component. + * @brief Add the custom property of the component. This interface only works on the main thread. * * @param node ArkUI_NodeHandle pointer. - * @param name The name of the custom property. - * @param value The value of the custom property. + * @param name The name of the custom property. Passing null pointers is not allowed. + * @param value The value of the custom property. Passing null pointers is not allowed. * @since 13 */ void OH_ArkUI_NodeUtils_AddCustomProperty(ArkUI_NodeHandle node, const char* name, const char* value); -- Gitee From 79017ed65cac0c4835c8a79aaa5d5bc30e2ebb51 Mon Sep 17 00:00:00 2001 From: wangsen1994 Date: Fri, 11 Oct 2024 16:37:09 +0800 Subject: [PATCH 303/620] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dces=20C=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=9A=84=E6=8E=A5=E5=8F=A3=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangsen1994 --- BasicServicesKit/commonevent/oh_commonevent.h | 4 ++-- BasicServicesKit/commonevent/oh_commonevent_support.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BasicServicesKit/commonevent/oh_commonevent.h b/BasicServicesKit/commonevent/oh_commonevent.h index 695328b66..44c679926 100644 --- a/BasicServicesKit/commonevent/oh_commonevent.h +++ b/BasicServicesKit/commonevent/oh_commonevent.h @@ -121,7 +121,7 @@ CommonEvent_SubscribeInfo* OH_CommonEvent_CreateSubscribeInfo(const char* events * @brief Set the subscribe information of permission. * * @param info Indicates the subscribed events. - * @param permission Indicates the subscribed events of number. + * @param permission Indicates the subscribed events of permission. * @return Returns the error code. * Returns {@link COMMONEVENT_ERR_OK} if the operation is successful. * Returns {@link COMMONEVENT_ERR_INVALID_PARAMETER} if a parameter error occurs. @@ -133,7 +133,7 @@ CommonEvent_ErrCode OH_CommonEvent_SetPublisherPermission(CommonEvent_SubscribeI * @brief Set the subscribe information of bundleName. * * @param info Indicates the subscribed events. - * @param bundleName Indicates the subscribed events of number. + * @param bundleName Indicates the subscribed events of bundleName. * @return Returns the error code. * Returns {@link COMMONEVENT_ERR_OK} if the operation is successful. * Returns {@link COMMONEVENT_ERR_INVALID_PARAMETER} if a parameter error occurs. diff --git a/BasicServicesKit/commonevent/oh_commonevent_support.h b/BasicServicesKit/commonevent/oh_commonevent_support.h index 67f77687b..6d1256b95 100644 --- a/BasicServicesKit/commonevent/oh_commonevent_support.h +++ b/BasicServicesKit/commonevent/oh_commonevent_support.h @@ -57,7 +57,7 @@ static const char* const COMMON_EVENT_SHUTDOWN = "usual.event.SHUTDOWN"; static const char* const COMMON_EVENT_BATTERY_CHANGED = "usual.event.BATTERY_CHANGED"; /** - * @brief This commonEvent means when the device in low battery state.. + * @brief This commonEvent means when the device in low battery state. * * @since 12 */ @@ -141,7 +141,7 @@ static const char* const COMMON_EVENT_PACKAGE_ADDED = "usual.event.PACKAGE_ADDED static const char* const COMMON_EVENT_PACKAGE_REMOVED = "usual.event.PACKAGE_REMOVED"; /** - * @brief This commonEvent means when an existing application package is removed from the device. + * @brief This commonEvent means when an installed application's add-on package is removed from the device. * * @since 12 */ -- Gitee From 48f43a225ca28d2a5a0c1a695bd03cbcfaef5d59 Mon Sep 17 00:00:00 2001 From: lxlxlxl Date: Fri, 11 Oct 2024 08:38:22 +0000 Subject: [PATCH 304/620] modify Close interface description Signed-off-by: lxlxlxl --- distributeddatamgr/preferences/include/oh_preferences.h | 1 - 1 file changed, 1 deletion(-) diff --git a/distributeddatamgr/preferences/include/oh_preferences.h b/distributeddatamgr/preferences/include/oh_preferences.h index c3a56fd95..944fa9dff 100644 --- a/distributeddatamgr/preferences/include/oh_preferences.h +++ b/distributeddatamgr/preferences/include/oh_preferences.h @@ -89,7 +89,6 @@ OH_Preferences *OH_Preferences_Open(OH_PreferencesOption *option, int *errCode); * @brief Closes a Preferences object. * * @param preference Pointer to the {@Link OH_Preferences} instance to close. - * @param option Pointer to an {@Link OH_PreferencesOption} instance. * @return Returns the status code of the execution. For details, see {@Link OH_Preferences_ErrCode}. * {@link PREFERENCES_OK} indicates the operation is successful. * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. -- Gitee From 2568a93b4bdb1e79575e15a57f236667169b7dfb Mon Sep 17 00:00:00 2001 From: changleipeng Date: Mon, 14 Oct 2024 14:31:38 +0800 Subject: [PATCH 305/620] Correct spelling errors Signed-off-by: changleipeng --- graphic/graphic_2d/native_drawing/drawing_rect.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_rect.h b/graphic/graphic_2d/native_drawing/drawing_rect.h index 6ea9ca992..d247e88f7 100644 --- a/graphic/graphic_2d/native_drawing/drawing_rect.h +++ b/graphic/graphic_2d/native_drawing/drawing_rect.h @@ -251,7 +251,7 @@ OH_Drawing_ErrorCode OH_Drawing_RectGetArraySize(OH_Drawing_Array* rectArray, si * @param rect Pointers to Pointer of OH_Drawing_Rect object, returned to the caller. * @return Returns the error code. * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. - * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if rectArray or pprect is nullptr, + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if rectArray or rect is nullptr, * or index is valid. * @since 14 * @version 1.0 -- Gitee From c5c943d9bcadb1fcb4fe853da7d6be495854edf3 Mon Sep 17 00:00:00 2001 From: zhangchao Date: Sat, 12 Oct 2024 14:56:16 +0800 Subject: [PATCH 306/620] auto switch device NDK API Signed-off-by: zhangchao --- multimedia/camera_framework/camera.h | 18 ++++++ multimedia/camera_framework/camera.ndk.json | 16 +++++ multimedia/camera_framework/capture_session.h | 59 +++++++++++++++++++ 3 files changed, 93 insertions(+) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 50e6f143b..51682d06e 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -973,6 +973,24 @@ typedef struct Camera_FrameShutterEndInfo { int32_t captureId; } Camera_FrameShutterEndInfo; +/** + * @brief Auto device switch status info. + * + * @since 13 + * @version 1.0 + */ +typedef struct Camera_AutoDeviceSwitchStatusInfo { + /** + * is device switched. + */ + bool isDeviceSwitched; + + /** + * is device capability changed. + */ + bool isDeviceCapabilityChanged; +} Camera_AutoDeviceSwitchStatusInfo; + /** * @brief Creates a CameraManager instance. * diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index e5faf336c..a49b65320 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -602,5 +602,21 @@ { "first_introduced": "12", "name": "OH_PhotoNative_Release" + }, + { + "first_introduced": "13", + "name": "OH_CaptureSession_RegisterAutoDeviceSwitchStatusCallback" + }, + { + "first_introduced": "13", + "name": "OH_CaptureSession_UnregisterAutoDeviceSwitchStatusCallback" + }, + { + "first_introduced": "13", + "name": "OH_CaptureSession_IsAutoSwitchDeviceSupported" + }, + { + "first_introduced": "13", + "name": "OH_CaptureSession_EnableAutoSwitchDevice" } ] diff --git a/multimedia/camera_framework/capture_session.h b/multimedia/camera_framework/capture_session.h index 5f19ac724..54786c5d9 100644 --- a/multimedia/camera_framework/capture_session.h +++ b/multimedia/camera_framework/capture_session.h @@ -94,6 +94,16 @@ typedef void (*OH_CaptureSession_OnError)(Camera_CaptureSession* session, Camera typedef void (*OH_CaptureSession_OnSmoothZoomInfo)(Camera_CaptureSession* session, Camera_SmoothZoomInfo* smoothZoomInfo); +/** + * @brief Capture session device switch status callback. + * + * @param session the {@link Camera_CaptureSession} which deliver the callback. + * @param autoDeviceSwitchStatusInfo the {@link Camera_AutoDeviceSwitchStatusInfo} which delivered by the callback. + * @since 13 + */ +typedef void (*OH_CaptureSession_OnAutoDeviceSwitchStatusChange)(Camera_CaptureSession* session, + Camera_AutoDeviceSwitchStatusInfo* autoDeviceSwitchStatusInfo); + /** * @brief A listener for capture session. * @@ -857,6 +867,55 @@ Camera_ErrorCode OH_CaptureSession_GetActiveColorSpace(Camera_CaptureSession* se Camera_ErrorCode OH_CaptureSession_SetActiveColorSpace(Camera_CaptureSession* session, OH_NativeBuffer_ColorSpace colorSpace); +/** + * @brief Register device switch event callback. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param autoDeviceSwitchStatusChange the {@link OH_CaptureSession_OnAutoDeviceSwitchStatusChange} to be registered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 13 + */ +Camera_ErrorCode OH_CaptureSession_RegisterAutoDeviceSwitchStatusCallback(Camera_CaptureSession* session, + OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChange); + +/** + * @brief Unregister device switch event callback. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param autoDeviceSwitchStatusChange the {@link OH_CaptureSession_OnAutoDeviceSwitchStatusChange} to be unregistered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 13 + */ +Camera_ErrorCode OH_CaptureSession_UnregisterAutoDeviceSwitchStatusCallback(Camera_CaptureSession* session, + OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChange); + +/** + * @brief Check whether auto device switch is supported. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param isSupported the result of whether auto device switch supported. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. + * @since 13 + */ +Camera_ErrorCode OH_CaptureSession_IsAutoDeviceSwitchSupported(Camera_CaptureSession* session, bool* isSupported); + +/** + * @brief Enable auto switch or not for the camera device. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param enabled the flag of enable auto switch or not. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 13 + */ +Camera_ErrorCode OH_CaptureSession_EnableAutoDeviceSwitch(Camera_CaptureSession* session, bool enabled); + #ifdef __cplusplus } #endif -- Gitee From 61fea1df608ab0864e661a8eff169bb1d093cd86 Mon Sep 17 00:00:00 2001 From: zyx0121 Date: Sun, 29 Sep 2024 17:03:07 +0800 Subject: [PATCH 307/620] =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E4=B8=8Ehtml=E7=9A=84=E5=BA=8F=E5=88=97=E5=8C=96?= =?UTF-8?q?=E5=92=8C=E5=8F=8D=E5=BA=8F=E5=88=97=E5=8C=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zyx0121 --- arkui/ace_engine/native/libace.ndk.json | 12 ++++++++++++ arkui/ace_engine/native/native_type.h | 12 ++++++++++++ arkui/ace_engine/native/styled_string.h | 26 +++++++++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 3da27da07..581097c0f 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2362,5 +2362,17 @@ { "first_introduced": "13", "name": "OH_ArkUI_AccessibilityElementInfoSetElementId" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_StyledString_Descriptor_Create" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_StyledString_Descriptor_Destroy" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_ConvertToHtml" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 18f2e18b6..47d73301f 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -136,6 +136,13 @@ typedef struct ArkUI_Context* ArkUI_ContextHandle; */ typedef struct ArkUI_SwiperIndicator ArkUI_SwiperIndicator; +/** +* @brief Define the data objects of styled string supported by text components. +* +* @since 14 +*/ +typedef struct ArkUI_StyledString_Descriptor ArkUI_StyledString_Descriptor; + /** * @brief specifies the alignment rules for subcomponents set in relative containers. * @@ -1911,6 +1918,11 @@ typedef enum { ARKUI_ERROR_CODE_NON_SCROLLABLE_CONTAINER = 180001, /** The buffer is not large enough. */ ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH = 180002, + /** + * @error invalid styled string. + * @since 14 + */ + ARKUI_ERROR_CODE_INVALID_STYLED_STRING = 180101, } ArkUI_ErrorCode; /** diff --git a/arkui/ace_engine/native/styled_string.h b/arkui/ace_engine/native/styled_string.h index cb537a6c6..5d0c816b8 100644 --- a/arkui/ace_engine/native/styled_string.h +++ b/arkui/ace_engine/native/styled_string.h @@ -39,6 +39,7 @@ #include "native_drawing/drawing_text_declaration.h" #include "native_drawing/drawing_text_typography.h" +#include "native_type.h" #ifdef __cplusplus extern "C" { @@ -118,6 +119,31 @@ OH_Drawing_Typography* OH_ArkUI_StyledString_CreateTypography(ArkUI_StyledString */ void OH_ArkUI_StyledString_AddPlaceholder(ArkUI_StyledString* handle, OH_Drawing_PlaceholderSpan* placeholder); +/** + * @brief Create a ArkUI_StyledString_Descriptor object. + * + * @return Pointer to the ArkUI_StyledString_Descriptor object.。 + * @since 14 + */ +ArkUI_StyledString_Descriptor* OH_ArkUI_StyledString_Descriptor_Create(); + +/** + * @brief Release the memory occupied by the ArkUI_StyledString_Descriptor object. + * + * @param str Pointer to the ArkUI_StyledString_Descriptor object. + * @since 14 + */ +void OH_ArkUI_StyledString_Descriptor_Destroy(ArkUI_StyledString_Descriptor* str); + +/** + * @brief Convert the styled string into html. + * + * @param str Pointer to the ArkUI_StyledString_Descriptor object. + * @return The converted html. + * @since 14 + */ +const char* OH_ArkUI_ConvertToHtml(ArkUI_StyledString_Descriptor* str); + #ifdef __cplusplus }; #endif -- Gitee From 9b01924673366ae3e64e32087edec32e85ae6c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=96=87=E9=BE=99?= Date: Tue, 15 Oct 2024 10:08:27 +0800 Subject: [PATCH 308/620] bugfix:library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李文龙 --- LocationKit/oh_location.h | 2 +- LocationKit/oh_location_type.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LocationKit/oh_location.h b/LocationKit/oh_location.h index b4d3bbc5c..62eac6710 100644 --- a/LocationKit/oh_location.h +++ b/LocationKit/oh_location.h @@ -24,7 +24,7 @@ * @file oh_location.h * @kit LocationKit * @brief Define interfaces for querying location switch status, starting locating, and stopping locating. - * @library libohlocation.so + * @library liblocation_ndk.so * @syscap SystemCapability.Location.Location.Core * @since 13 */ diff --git a/LocationKit/oh_location_type.h b/LocationKit/oh_location_type.h index 235c436ff..729a61051 100644 --- a/LocationKit/oh_location_type.h +++ b/LocationKit/oh_location_type.h @@ -26,7 +26,7 @@ * @file oh_location_type.h * @kit LocationKit * @brief Declares the common location attributes. - * @library libohlocation.so + * @library liblocation_ndk.so * @syscap SystemCapability.Location.Location.Core * @since 13 */ -- Gitee From b7a702d01fa194773f49955085cd47d645dd9092 Mon Sep 17 00:00:00 2001 From: zyx0121 Date: Wed, 16 Oct 2024 09:22:03 +0800 Subject: [PATCH 309/620] =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E5=BA=8F=E5=88=97=E5=8C=96=E5=92=8C=E5=8F=8D=E5=BA=8F?= =?UTF-8?q?=E5=88=97=E5=8C=96CAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zyx0121 --- arkui/ace_engine/native/libace.ndk.json | 8 +++++++ arkui/ace_engine/native/styled_string.h | 30 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index dbae1db8b..48c1d3a84 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2374,5 +2374,13 @@ { "first_introduced": "14", "name": "OH_ArkUI_ConvertToHtml" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_MarshallStyledStringDescriptor" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_UnmarshallStyledStringDescriptor" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/styled_string.h b/arkui/ace_engine/native/styled_string.h index 5d0c816b8..49b4d39d3 100644 --- a/arkui/ace_engine/native/styled_string.h +++ b/arkui/ace_engine/native/styled_string.h @@ -144,6 +144,36 @@ void OH_ArkUI_StyledString_Descriptor_Destroy(ArkUI_StyledString_Descriptor* str */ const char* OH_ArkUI_ConvertToHtml(ArkUI_StyledString_Descriptor* str); +/** + * @brief Deserializes a byte array containing styled string information into a styled string. + * + * @param buffer Byte array to be deserialized. + * @param bufferSize Length of the byte array. + * @param descriptor Pointer to an ArkUI_StyledString_Descriptor object. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 14 + */ +int32_t OH_ArkUI_UnmarshallStyledStringDescriptor( + uint8_t* buffer, size_t bufferSize, ArkUI_StyledString_Descriptor* descriptor); + +/** + * @brief Serializes the styled string information into a byte array. + * + * @param buffer Byte array where the serialized data will be stored. + * @param bufferSize Length of the byte array. + * @param descriptor Pointer to an ArkUI_StyledString_Descriptor object. + * @param resultSize Actual length of the byte array. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * Returns {@link ARKUI_ERROR_CODE_INVALID_STYLED_STRING} if the styled string is invalid. + * @since 14 + */ +int32_t OH_ArkUI_MarshallStyledStringDescriptor( + uint8_t* buffer, size_t bufferSize, ArkUI_StyledString_Descriptor* descriptor, size_t* resultSize); + #ifdef __cplusplus }; #endif -- Gitee From 8f4cccf446d0d8115a8429cae577fac4ad69d132 Mon Sep 17 00:00:00 2001 From: xukuncai123 <401117262@qq.com> Date: Thu, 17 Oct 2024 10:24:16 +0800 Subject: [PATCH 310/620] move ndk_targets.gni to sdk_c Signed-off-by: xukuncai123 <401117262@qq.com> --- ndk_targets.gni | 330 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 330 insertions(+) create mode 100644 ndk_targets.gni diff --git a/ndk_targets.gni b/ndk_targets.gni new file mode 100644 index 000000000..a97312222 --- /dev/null +++ b/ndk_targets.gni @@ -0,0 +1,330 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos_var.gni") + +# ndk library, ndk header configuration +_ndk_library_targets = [ + "//interface/sdk_c/sensors/miscdevice/vibrator:lib_vibrator_ndk", + "//interface/sdk_c/sensors/miscdevice/vibrator:ndk_vibrator_header", + "//interface/sdk_c/third_party/zlib:libz_ndk", + "//interface/sdk_c/third_party/zlib:zlib_header", + "//interface/sdk_c/global/resource_management:librawfile_ndk", + "//interface/sdk_c/global/resource_management:rawfile_header", + "//interface/sdk_c/global/resource_management:native_resmgr_ndk", + "//interface/sdk_c/global/resource_management:native_resmgr_header", + "//interface/sdk_c/hiviewdfx/hiappevent:libhiappevent_header", + "//interface/sdk_c/hiviewdfx/hiappevent:libhiappevent_ndk", + "//interface/sdk_c/hiviewdfx/hidebug:libohhidebug", + "//interface/sdk_c/hiviewdfx/hidebug:oh_hidebug_header", + "//interface/sdk_c/hiviewdfx/hicollie:libohhicollie", + "//interface/sdk_c/hiviewdfx/hicollie:oh_hicollie_header", + "//interface/sdk_c/hiviewdfx/hilog:hilog_header", + "//interface/sdk_c/hiviewdfx/hilog:libhilog_ndk", + "//interface/sdk_c/hiviewdfx/hitrace:hitrace_header", + "//interface/sdk_c/hiviewdfx/hitrace:libhitrace_ndk", + "//interface/sdk_c/network/netstack/net_websocket:libnet_websocket", + "//interface/sdk_c/network/netstack/net_websocket:websocket_header", + "//interface/sdk_c/network/netssl:libnet_ssl_ndk", + "//interface/sdk_c/network/netssl:net_ssl_header", + "//interface/sdk_c/security/access_token:libability_access_control", + "//interface/sdk_c/security/access_token:accesstoken_header", + "//interface/sdk_c/security/huks:libhuks_ndk", + "//interface/sdk_c/security/huks:huks_header", + "//interface/sdk_c/security/asset:libasset_ndk", + "//interface/sdk_c/security/asset:asset_header", + "//interface/sdk_c/startup/init/syscap:libdeviceinfo_ndk", + "//interface/sdk_c/startup/init/syscap:deviceinfo_header", + "//interface/sdk_c/third_party/mindspore/kits:mindspore_header", + "//interface/sdk_c/third_party/mindspore/kits:mindspore_lib", + "//interface/sdk_c/web/webview/interfaces/native:web_header", + "//interface/sdk_c/web/webview/interfaces/native:libohweb", + "//interface/sdk_c/BasicServicesKit:libos_account_ndk", + "//interface/sdk_c/BasicServicesKit:os_account_ndk_header", + "//interface/sdk_c/ability/ability_runtime/child_process:child_process_header", + "//interface/sdk_c/ability/ability_runtime/child_process:libchild_process", + "//interface/sdk_c/AbilityKit/ability_runtime:ability_runtime_ndk_header", + "//interface/sdk_c/AbilityKit/ability_runtime:libability_runtime", + "//interface/sdk_c/arkui/ace_engine/native:ace_header", + "//interface/sdk_c/arkui/ace_engine/native:arkui_header", + "//interface/sdk_c/arkui/ace_engine/native:libace_ndk", + "//interface/sdk_c/arkui/napi:libnapi_ndk", + "//interface/sdk_c/arkui/napi:napi_header", + "//interface/sdk_c/arkui/window_manager:window_manager_header", + "//interface/sdk_c/arkui/window_manager:native_window_manager", + "//interface/sdk_c/arkui/display_manager:display_manager_header", + "//interface/sdk_c/arkui/display_manager:native_display_manager", + "//interface/sdk_c/ark_runtime/jsvm:libjsvm_ndk", + "//interface/sdk_c/ark_runtime/jsvm:jsvm_header", + "//interface/sdk_c/bundlemanager/bundle_framework/bundle:bundle_header", + "//interface/sdk_c/bundlemanager/bundle_framework/bundle:libbundle_ndk", + "//interface/sdk_c/third_party/node:node_header", + "//interface/sdk_c/graphic/graphic_2d/EGL:libEGL_ndk", + "//interface/sdk_c/graphic/graphic_2d/EGL:EGL_header", + "//interface/sdk_c/graphic/graphic_2d/GLES2:libGLESv2_ndk", + "//interface/sdk_c/graphic/graphic_2d/GLES2:GLES2_header", + "//interface/sdk_c/graphic/graphic_2d/GLES3:libGLESv3_ndk", + "//interface/sdk_c/graphic/graphic_2d/GLES3:GLES3_header", + "//interface/sdk_c/graphic/graphic_2d/KHR:KHR_header", + "//interface/sdk_c/graphic/graphic_2d/native_window:libnative_window_ndk", + "//interface/sdk_c/graphic/graphic_2d/native_window:native_window_header", + "//interface/sdk_c/graphic/graphic_2d/native_buffer:libnative_buffer_ndk", + "//interface/sdk_c/graphic/graphic_2d/native_buffer:native_buffer_header", + "//interface/sdk_c/graphic/graphic_2d/native_image:libnative_image_ndk", + "//interface/sdk_c/graphic/graphic_2d/native_image:native_image_header", + "//interface/sdk_c/graphic/graphic_2d/native_vsync:libnative_vsync_ndk", + "//interface/sdk_c/graphic/graphic_2d/native_vsync:native_vsync_header", + "//interface/sdk_c/graphic/graphic_2d/native_color_space_manager:libnative_color_space_manager_ndk", + "//interface/sdk_c/graphic/graphic_2d/native_color_space_manager:native_color_space_manager_header", + "//interface/sdk_c/graphic/graphic_2d/native_drawing:libnative_drawing_ndk", + "//interface/sdk_c/graphic/graphic_2d/native_drawing:native_drawing_header", + "//interface/sdk_c/graphic/graphic_2d/native_effect:libnative_effect_ndk", + "//interface/sdk_c/graphic/graphic_2d/native_effect:native_effect_header", + "//interface/sdk_c/IPCKit:libipc_capi", + "//interface/sdk_c/IPCKit:ipc_capi_header", + "//interface/sdk_c/LocationKit:liblocation_ndk", + "//interface/sdk_c/LocationKit:location_ndk_header", + "//interface/sdk_c/NotificationKit:libnotification_ndk", + "//interface/sdk_c/NotificationKit:ohnotification_header", + "//interface/sdk_c/ConnectivityKit/bluetooth:libbluetooth_ndk", + "//interface/sdk_c/ConnectivityKit/bluetooth:bluetooth_ndk_header", + "//interface/sdk_c/third_party/libuv:libuv_ndk", + "//interface/sdk_c/third_party/libuv:libuv_header", + "//interface/sdk_c/third_party/libuv:libuv_uv_header", + "//interface/sdk_c/third_party/icu4c:libicu_ndk", + "//interface/sdk_c/third_party/icu4c:icu_unicode_header", + "//interface/sdk_c/multimedia/av_codec/audio_decoder:libnative_media_adec", + "//interface/sdk_c/multimedia/av_codec/audio_decoder:native_media_adec_header", + "//interface/sdk_c/multimedia/av_codec/audio_encoder:libnative_media_aenc", + "//interface/sdk_c/multimedia/av_codec/audio_encoder:native_media_aenc_header", + "//interface/sdk_c/multimedia/av_codec/audio_codec:libnative_media_acodec", + "//interface/sdk_c/multimedia/av_codec/audio_codec:native_media_acodec_header", + "//interface/sdk_c/multimedia/av_codec/video_decoder:libnative_media_vdec", + "//interface/sdk_c/multimedia/av_codec/video_decoder:native_media_vdec_header", + "//interface/sdk_c/multimedia/av_codec/video_encoder:libnative_media_venc", + "//interface/sdk_c/multimedia/av_codec/video_encoder:native_media_venc_header", + "//interface/sdk_c/multimedia/av_codec/codec_base:libnative_media_codecbase", + "//interface/sdk_c/multimedia/av_codec/codec_base:native_media_codecbase_header", + "//interface/sdk_c/multimedia/av_codec/avmuxer:libnative_media_avmuxer", + "//interface/sdk_c/multimedia/av_codec/avmuxer:native_media_avmuxer_header", + "//interface/sdk_c/multimedia/av_codec/avdemuxer:libnative_media_avdemuxer", + "//interface/sdk_c/multimedia/av_codec/avdemuxer:native_media_avdemuxer_header", + "//interface/sdk_c/multimedia/av_codec/avsource:libnative_media_avsource", + "//interface/sdk_c/multimedia/av_codec/avsource:native_media_avsource_header", + "//interface/sdk_c/multimedia/av_codec/avcencinfo:libnative_media_avcencinfo", + "//interface/sdk_c/multimedia/av_codec/avcencinfo:native_media_avcencinfo_header", + "//interface/sdk_c/multimedia/drm_framework:libnative_drm", + "//interface/sdk_c/multimedia/drm_framework:native_drm_header", + "//interface/sdk_c/multimedia/media_foundation/core:native_media_core_header", + "//interface/sdk_c/multimedia/media_foundation/core:native_media_core_common_header", + "//interface/sdk_c/multimedia/media_foundation/core:libnative_media_core", + "//interface/sdk_c/multimedia/media_library/media_asset_manager:libmedia_asset_manager", + "//interface/sdk_c/multimedia/media_library/media_asset_manager:media_asset_manager_header", + "//interface/sdk_c/multimedia/player_framework/avscreen_capture:libnative_avscreen_capture", + "//interface/sdk_c/multimedia/player_framework/avscreen_capture:native_avscreen_capture_header", + "//interface/sdk_c/multimedia/player_framework/avplayer:libavplayer", + "//interface/sdk_c/multimedia/player_framework/avplayer:avplayer_header", + "//interface/sdk_c/multimedia/audio_framework:libohaudio_ndk", + "//interface/sdk_c/multimedia/audio_framework:ohaudio_header", + "//interface/sdk_c/multimedia/av_session:libohavsession_ndk", + "//interface/sdk_c/multimedia/av_session:ohavsession_header", + "//interface/sdk_c/multimedia/camera_framework:libohcamera", + "//interface/sdk_c/multimedia/camera_framework:camera_ndk_header", + "//interface/sdk_c/multimedia/image_framework:libpixelmap_ndk", + "//interface/sdk_c/multimedia/image_framework:libpixelmap", + "//interface/sdk_c/multimedia/image_framework:libpixelmap_header", + "//interface/sdk_c/multimedia/image_framework:image_header", + "//interface/sdk_c/multimedia/image_framework:libimage_ndk", + "//interface/sdk_c/multimedia/image_framework:image_ndk_header", + "//interface/sdk_c/multimedia/image_framework:libimage_receiver_ndk", + "//interface/sdk_c/multimedia/image_framework:image_receiver_ndk_header", + "//interface/sdk_c/multimedia/image_framework:libimage_source_ndk", + "//interface/sdk_c/multimedia/image_framework:image_source_ndk_header", + "//interface/sdk_c/multimedia/image_framework:libimage_source", + "//interface/sdk_c/multimedia/image_framework:libimage_source_header", + "//interface/sdk_c/multimedia/image_framework:libimage_packer_ndk", + "//interface/sdk_c/multimedia/image_framework:image_packer_ndk_header", + "//interface/sdk_c/multimedia/image_framework:libimage_packer", + "//interface/sdk_c/multimedia/image_framework:libimage_packer_header", + "//interface/sdk_c/multimedia/image_framework:libpicture", + "//interface/sdk_c/multimedia/image_framework:libpicture_header", + "//interface/sdk_c/multimedia/image_framework:libimage_common", + "//interface/sdk_c/multimedia/image_framework:libimage_common_header", + "//interface/sdk_c/multimedia/image_effect:libimage_effect", + "//interface/sdk_c/multimedia/image_effect:libimage_effect_header", + "//interface/sdk_c/multimedia/video_processing_engine/video_processing:libvideo_processing_ndk", + "//interface/sdk_c/multimedia/video_processing_engine/video_processing:video_processing_ndk_headers", + "//interface/sdk_c/multimedia/video_processing_engine/image_processing:libimage_processing_ndk", + "//interface/sdk_c/multimedia/video_processing_engine/image_processing:image_processing_ndk_headers", + "//interface/sdk_c/third_party/openSLES:sles_header", + "//interface/sdk_c/third_party/openSLES:libOpenSLES_ndk", + "//interface/sdk_c/ai/neural_network_runtime:libneural_network_core_ndk", + "//interface/sdk_c/ai/neural_network_runtime:libneural_network_runtime_ndk", + "//interface/sdk_c/ai/neural_network_runtime:libneural_network_runtime_header", + "//interface/sdk_c/commonlibrary/memory_utils/libpurgeablemem:libpurgeable_memory_ndk", + "//interface/sdk_c/commonlibrary/memory_utils/libpurgeablemem:purgeable_memory_header", + "//interface/sdk_c/distributeddatamgr/relational_store:data_ndk_header", + "//interface/sdk_c/distributeddatamgr/relational_store:native_rdb_ndk_header", + "//interface/sdk_c/distributeddatamgr/relational_store:libnative_rdb_ndk", + "//interface/sdk_c/distributeddatamgr/udmf:libudmf", + "//interface/sdk_c/distributeddatamgr/udmf:udmf_ndk_header", + "//interface/sdk_c/distributeddatamgr/pasteboard:libpasteboard", + "//interface/sdk_c/distributeddatamgr/pasteboard:pasteboard_ndk_header", + "//interface/sdk_c/distributeddatamgr/preferences:preferences_ndk_header", + "//interface/sdk_c/distributeddatamgr/preferences:libohpreferences", + "//interface/sdk_c/drivers/external_device_manager/usb:libusb_ndk", + "//interface/sdk_c/drivers/external_device_manager/usb:usb_header", + "//interface/sdk_c/drivers/external_device_manager/hid:libhid", + "//interface/sdk_c/drivers/external_device_manager/hid:hid_header", + "//interface/sdk_c/drivers/external_device_manager/base:libddk_base", + "//interface/sdk_c/drivers/external_device_manager/base:ddk_header", + "//interface/sdk_c/graphic/graphic_2d/vulkan:libvulkan_ndk", + "//interface/sdk_c/graphic/graphic_2d/vulkan:vulkan_header", + "//interface/sdk_c/graphic/graphic_2d/vulkan:vulkan_header_vk_video", + "//interface/sdk_c/resourceschedule/ffrt:libffrt_ndk", + "//interface/sdk_c/resourceschedule/ffrt:ffrt_header", + "//interface/sdk_c/network/netmanager:libnet_connection", + "//interface/sdk_c/network/netmanager:netconn_header", + "//interface/sdk_c/sensors/sensor:libsensor_ndk", + "//interface/sdk_c/sensors/sensor:sensor_ndk_header", + "//interface/sdk_c/resourceschedule/qos_manager:libqos_ndk", + "//interface/sdk_c/resourceschedule/qos_manager:qos_header", + "//interface/sdk_c/filemanagement/fileio:libohfileio", + "//interface/sdk_c/filemanagement/fileio:oh_fileio_header", + "//interface/sdk_c/filemanagement/environment:libohenvironment", + "//interface/sdk_c/filemanagement/environment:oh_environment_header", + "//interface/sdk_c/filemanagement/file_uri:libohfileuri", + "//interface/sdk_c/filemanagement/file_uri:oh_file_uri_header", + "//interface/sdk_c/filemanagement/fileshare:libohfileshare", + "//interface/sdk_c/filemanagement/fileshare:oh_file_share_header", + "//interface/sdk_c/multimodalinput/kits/c:libohinput_ndk", + "//interface/sdk_c/multimodalinput/kits/c:ohinput_header", + "//interface/sdk_c/BasicServicesKit:libohprint_ndk", + "//interface/sdk_c/BasicServicesKit:ohprint_header", + "//interface/sdk_c/multimedia/image_framework:libohimage", + "//interface/sdk_c/multimedia/image_framework:ohimage_header", + "//interface/sdk_c/multimedia/image_framework:libimage_receiver", + "//interface/sdk_c/multimedia/image_framework:image_receiver_header", + "//interface/sdk_c/graphic/graphic_2d/native_display_soloist:libnative_display_soloist_ndk", + "//interface/sdk_c/graphic/graphic_2d/native_display_soloist:native_display_soloist_header", + "//interface/sdk_c/third_party/musl/ndk_script:copy_compatible_config", + "//interface/sdk_c/CryptoArchitectureKit:libohcrypto", + "//interface/sdk_c/CryptoArchitectureKit:crypto_capi_header", + "//interface/sdk_c/BasicServicesKit:libohscan_ndk", + "//interface/sdk_c/BasicServicesKit:ohscan_header", + "//interface/sdk_c/BasicServicesKit:libtime_service_ndk", + "//interface/sdk_c/BasicServicesKit:time_service_ndk_header", + "//interface/sdk_c/BasicServicesKit:libcommonevent_ndk", + "//interface/sdk_c/BasicServicesKit:ohcommonevent_header", + "//interface/sdk_c/DataProtectionKit:libohdlp_permission", + "//interface/sdk_c/DataProtectionKit:dlppermission_capi_header", + "//interface/sdk_c/inputmethod:libohinputmethod", + "//interface/sdk_c/inputmethod:libohinputmethod_header", + "//interface/sdk_c/backgroundtasks/transient:libtransient_task_ndk", + "//interface/sdk_c/backgroundtasks/transient:transient_task_header", + "//interface/sdk_c/BasicServicesKit:ohbattery_info_header", + "//interface/sdk_c/BasicServicesKit:libohbattery_info_ndk", + "//interface/sdk_c/telephony/cellular_data:libtelephony_data", + "//interface/sdk_c/telephony/cellular_data:telephony_data_header", + "//interface/sdk_c/telephony/core_service:libtelephony_radio", + "//interface/sdk_c/telephony/core_service:telephony_radio_header", + "//interface/sdk_c/ConnectivityKit/wifi:libwifi_ndk", + "//interface/sdk_c/ConnectivityKit/wifi:wifi_ndk_header", +] + +_ndk_base_libs = [ + "//interface/sdk_c/third_party/musl/ndk_script/adapter:libc_ndk", + "//interface/sdk_c/third_party/musl/ndk_script:musl_ndk_libs_arm32", + "//interface/sdk_c/third_party/musl/ndk_script:musl_ndk_libs_aarch64", + "//interface/sdk_c/third_party/musl/ndk_script:musl_ndk_libs_x86_64", + "//interface/sdk_c/third_party/musl/ndk_script:ndk_toolchain", +] +_ndk_sysroot_uapi = + [ "//interface/sdk_c/third_party/musl/ndk_script:musl_sysroot" ] + +_ndk_cmake = [ + "//prebuilts/cmake/darwin-universal:darwin_cmake_copy", + "//prebuilts/cmake/linux-x86:linux_cmake_copy", + "//prebuilts/cmake/windows-x86:windows_cmake_copy", + "//prebuilts/cmake/ohos:ohos_cmake_copy", + "//build/ohos/ndk:ndk_cmake_files", +] + +if (host_os == "mac") { + _ndk_cmake += [ "//build/ohos/ndk:copy_darwin_ohos_cmake" ] +} else { + _ndk_cmake += [ + "//build/ohos/ndk:copy_linux_ohos_cmake", + "//build/ohos/ndk:copy_windows_ohos_cmake", + "//build/ohos/ndk:copy_ohos_ohos_cmake", + ] +} + +_ndk_ninja = [] +if (host_os == "mac") { + _ndk_ninja += [ "//prebuilts/build-tools/darwin-x86/bin:darwin_ninja_copy" ] +} else { + _ndk_ninja += [ + "//prebuilts/build-tools/linux-x86/bin:linux_ninja_copy", + "//prebuilts/build-tools/windows-x86/bin:windows_ninja_copy", + "//prebuilts/build-tools/ohos/bin:ohos_ninja_copy", + ] +} + +_ndk_targets_list = _ndk_library_targets + _ndk_base_libs + _ndk_sysroot_uapi + + _ndk_cmake + _ndk_ninja + +_parse_script = "//build/ohos/ndk/parse_ndk_targets.py" +_parse_args = [ + "--source-root-dir", + rebase_path("//", root_build_dir), + "--ndk-lib-target-list", +] +_parse_args += _ndk_targets_list + +all_ndk_targets_list = exec_script(_parse_script, _parse_args, "list lines") + +if (ndk_platform == "win") { + all_ndk_targets_list += + [ "//interface/sdk_c/third_party/musl/ndk_script:windows_x86_64" ] +} else if (ndk_platform == "mac") { + if (host_cpu == "arm64") { + all_ndk_targets_list += + [ "//interface/sdk_c/third_party/musl/ndk_script:darwin_arm64" ] + } else { + all_ndk_targets_list += + [ "//interface/sdk_c/third_party/musl/ndk_script:darwin_x86_64" ] + } +} else if (ndk_platform == "linux") { + all_ndk_targets_list += + [ "//interface/sdk_c/third_party/musl/ndk_script:linux_x86_64" ] +} else if (ndk_platform == "ohos") { + all_ndk_targets_list += + [ "//interface/sdk_c/third_party/musl/ndk_script:ohos_arm64" ] +} else if (ndk_platform == "default") { + if (host_os == "mac") { + if (host_cpu == "arm64") { + all_ndk_targets_list += + [ "//interface/sdk_c/third_party/musl/ndk_script:darwin_arm64" ] + } else { + all_ndk_targets_list += + [ "//interface/sdk_c/third_party/musl/ndk_script:darwin_x86_64" ] + } + } else { + all_ndk_targets_list += [ + "//interface/sdk_c/third_party/musl/ndk_script:windows_x86_64", + "//interface/sdk_c/third_party/musl/ndk_script:linux_x86_64", + "//interface/sdk_c/third_party/musl/ndk_script:ohos_arm64", + ] + } +} -- Gitee From 9cf3de7ddd09c9c323669101a789be250d0ae265 Mon Sep 17 00:00:00 2001 From: zhjs Date: Thu, 17 Oct 2024 11:23:57 +0800 Subject: [PATCH 311/620] DTS0000000000000test Signed-off-by: zhjs --- graphic/graphic_2d/native_buffer/buffer_common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_buffer/buffer_common.h b/graphic/graphic_2d/native_buffer/buffer_common.h index fd1bfa4a5..e3e610d71 100644 --- a/graphic/graphic_2d/native_buffer/buffer_common.h +++ b/graphic/graphic_2d/native_buffer/buffer_common.h @@ -138,7 +138,11 @@ typedef enum OH_NativeBuffer_MetadataType { /** HDR10 */ OH_VIDEO_HDR_HDR10, /** HDR VIVID */ - OH_VIDEO_HDR_VIVID + OH_VIDEO_HDR_VIVID, + /** + * NONE Metadata + * @since 13 + */ } OH_NativeBuffer_MetadataType; /** -- Gitee From 2f09c5f4b1483ca3b9ffd46a6f21cb8e5ab21c38 Mon Sep 17 00:00:00 2001 From: zhjs Date: Thu, 17 Oct 2024 11:55:13 +0800 Subject: [PATCH 312/620] DTS0000000000000test Signed-off-by: zhjs --- graphic/graphic_2d/native_buffer/buffer_common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/graphic/graphic_2d/native_buffer/buffer_common.h b/graphic/graphic_2d/native_buffer/buffer_common.h index e3e610d71..d67646240 100644 --- a/graphic/graphic_2d/native_buffer/buffer_common.h +++ b/graphic/graphic_2d/native_buffer/buffer_common.h @@ -143,6 +143,7 @@ typedef enum OH_NativeBuffer_MetadataType { * NONE Metadata * @since 13 */ + OH_VIDEO_NONE = -1 } OH_NativeBuffer_MetadataType; /** -- Gitee From 9364f17f6f805064c0541635182ca197b8dcbe60 Mon Sep 17 00:00:00 2001 From: xxb-wzy Date: Fri, 18 Oct 2024 10:44:16 +0800 Subject: [PATCH 313/620] Signed-off-by: xxb-wzy Change-Id: Id49de840b724bca45076d887d0317f282f30314d --- .../native_vsync/libnative_vsync.ndk.json | 3 ++- .../graphic_2d/native_vsync/native_vsync.h | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json b/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json index 196fab524..7c0511407 100644 --- a/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json +++ b/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json @@ -3,5 +3,6 @@ { "name": "OH_NativeVSync_Destroy" }, { "name": "OH_NativeVSync_RequestFrame" }, { "name": "OH_NativeVSync_RequestFrameWithMultiCallback" }, - { "name": "OH_NativeVSync_GetPeriod" } + { "name": "OH_NativeVSync_GetPeriod" }, + { "name": "OH_NativeVSync_DVSyncSwitch" } ] \ No newline at end of file diff --git a/graphic/graphic_2d/native_vsync/native_vsync.h b/graphic/graphic_2d/native_vsync/native_vsync.h index 610fe1deb..0da2aa8e9 100644 --- a/graphic/graphic_2d/native_vsync/native_vsync.h +++ b/graphic/graphic_2d/native_vsync/native_vsync.h @@ -114,6 +114,31 @@ int OH_NativeVSync_RequestFrameWithMultiCallback( * @version 1.0 */ int OH_NativeVSync_GetPeriod(OH_NativeVSync* nativeVsync, long long* period); + +/** + * @brief Enable dvsync to improve the performance of self-drawn animation scenes. + * After enabled, dvsync needs to occupy the free surfacebuffer for frame buffering. Users need to ensure that + * there is an idle buffer at least. Otherwise, you are not advised to enable this function. + * When you enable dvsync, it will drive the early drawing of subsequent animations by sending vsync with future + * timestamp in advance, and you need to disable dvsync at the end of animation. + * After dvsync is enabled, the user needs to respond correctly to vsync sent in advance, and needs to request + * the next vsync after the animation frame of the last vsync completes drawing. And the surfacebuffer needs to + * carry a timestamp consistent with vsync. + * In some scenarios, if another application enables dvsync first, the current enabling operation will not + * take effect, and the application will still receive normal vsync signals. + * Not all platforms support dvsync. On platforms that do not support it, users will receive normal vsync + * after enabling it. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeVsync + * @param nativeVsync Indicates the pointer to a NativeVsync. + * @param enable Enable or disable the dvsync. + * @return {@link NATIVE_ERROR_OK} 0 - Success. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - the parameter nativeVsync is NULL or callback is NULL. + * {@link NATIVE_ERROR_BINDER_ERROR} 50401000 - ipc send failed. + * @since 12 + * @version 1.0 + */ +int OH_NativeVSync_DVSyncSwitch(OH_NativeVSync* nativeVsync, bool enable); #ifdef __cplusplus } #endif -- Gitee From 9a7ff952b1bc444e522e8dfbbf8e0e2f2fd70d67 Mon Sep 17 00:00:00 2001 From: xxb-wzy Date: Sat, 19 Oct 2024 15:41:14 +0800 Subject: [PATCH 314/620] Signed-off-by: xxb-wzy Change-Id: I91b51c7786f5aa8bccfc4936d602caceda547f89 --- graphic/graphic_2d/native_vsync/native_vsync.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_vsync/native_vsync.h b/graphic/graphic_2d/native_vsync/native_vsync.h index 0da2aa8e9..2dfb5c1ac 100644 --- a/graphic/graphic_2d/native_vsync/native_vsync.h +++ b/graphic/graphic_2d/native_vsync/native_vsync.h @@ -135,7 +135,7 @@ int OH_NativeVSync_GetPeriod(OH_NativeVSync* nativeVsync, long long* period); * @return {@link NATIVE_ERROR_OK} 0 - Success. * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - the parameter nativeVsync is NULL or callback is NULL. * {@link NATIVE_ERROR_BINDER_ERROR} 50401000 - ipc send failed. - * @since 12 + * @since 14 * @version 1.0 */ int OH_NativeVSync_DVSyncSwitch(OH_NativeVSync* nativeVsync, bool enable); -- Gitee From bd28071d94885018b4000188bb3a7071ba11029a Mon Sep 17 00:00:00 2001 From: hongzexuan Date: Thu, 17 Oct 2024 11:32:06 +0800 Subject: [PATCH 315/620] scroll capi add fadingEdge Signed-off-by: hongzexuan Change-Id: Ifd16e5d9eba02305e2eaed84a613c246d68499ae --- arkui/ace_engine/native/native_node.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 4ba7d5ff2..2266726b5 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -4495,6 +4495,23 @@ typedef enum { */ NODE_SCROLL_FLING, + /** + * @brief Sets the fading effect for the edges of scrollable components. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute: + * .value[0].i32: whether to enable the fading effect on edges. The value 0 means to disable the fading effect, + * and 1 means to enable it. + * .value[1]?.f32: length of the fading effect on edges, in vp. Default value: 32. + * + * Format of the return value {@link ArkUI_AttributeItem}: + * .value[0].i32: whether the fading effect on edges is enabled. The value 0 means that the fading effect is + * disabled, and 1 means that it is enabled. + * .value[1].f32: length of the fading effect on edges, in vp. + * + * @since 14 + */ + NODE_SCROLL_FADING_EDGE, + /** * @brief Defines the direction in which the list items are arranged. This attribute can be set, reset, and * obtained as required through APIs. -- Gitee From 81c67fa44d1c74f8db7fe07a8980b42bcde5c46b Mon Sep 17 00:00:00 2001 From: xzcbob Date: Mon, 21 Oct 2024 04:12:49 +0000 Subject: [PATCH 316/620] vrr update Signed-off-by: xzcbob --- multimedia/av_codec/native_avcodec_base.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 1bec2e144..147a7268e 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -958,9 +958,9 @@ extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE; * This is an optional key that applies only to video decoder. It is used in configure. * * @syscap SystemCapability.Multimedia.Media.CodecBase - * @since 13 + * @since 14 */ -extern const char *OH_MD_KEY_VIDEO_DECODER_ENABLE_VRR; +extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR; /** * @brief Media type. -- Gitee From ddb15cb2662ac117323cedb9800a8a60abd3b3ca Mon Sep 17 00:00:00 2001 From: xxb-wzy Date: Mon, 21 Oct 2024 19:32:31 +0800 Subject: [PATCH 317/620] Signed-off-by: xxb-wzy Change-Id: Ib3e74dcad38979a2c1aa14e3de68e99cb0e90d07 --- .../graphic_2d/native_vsync/native_vsync.h | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/graphic/graphic_2d/native_vsync/native_vsync.h b/graphic/graphic_2d/native_vsync/native_vsync.h index 2dfb5c1ac..8d6d3df64 100644 --- a/graphic/graphic_2d/native_vsync/native_vsync.h +++ b/graphic/graphic_2d/native_vsync/native_vsync.h @@ -116,22 +116,23 @@ int OH_NativeVSync_RequestFrameWithMultiCallback( int OH_NativeVSync_GetPeriod(OH_NativeVSync* nativeVsync, long long* period); /** - * @brief Enable dvsync to improve the performance of self-drawn animation scenes. - * After enabled, dvsync needs to occupy the free surfacebuffer for frame buffering. Users need to ensure that - * there is an idle buffer at least. Otherwise, you are not advised to enable this function. - * When you enable dvsync, it will drive the early drawing of subsequent animations by sending vsync with future - * timestamp in advance, and you need to disable dvsync at the end of animation. - * After dvsync is enabled, the user needs to respond correctly to vsync sent in advance, and needs to request - * the next vsync after the animation frame of the last vsync completes drawing. And the surfacebuffer needs to - * carry a timestamp consistent with vsync. - * In some scenarios, if another application enables dvsync first, the current enabling operation will not - * take effect, and the application will still receive normal vsync signals. - * Not all platforms support dvsync. On platforms that do not support it, users will receive normal vsync - * after enabling it. + * @brief Enable DVSync to improve the smoothness of self drawn animation scenes. + * DVSync is Decoupled VSync, which is a frame timing management strategy decoupled from hardware VSync. + * DVSync drives the early drawing of subsequent animation frames by sending VSync signals with future timestamps + * in advance, which are then cached in the frame buffer queue; DVSync reduces the possibility of frame loss + * in the future by caching frames, thereby improving the smoothness of animation scenes. + * Because DVSync requires the use of idle self drawn frame buffers to cache pre drawn animation frames, users need to + * ensure that there is at least one free frame buffer, otherwise it is not recommended to enable this feature. + * After enabling DVSync, users need to respond correctly to the VSync signal sent in advance, and request + * the next VSync after the animation frame corresponding to the previous VSync is completed, and the self + * drawn frame needs to carry a timestamp consistent with VSync. + * After the animation ends, the user needs to turn off DVSync. + * On platforms that do not support DVSync or if another application has already enabled DVSync, the current + * enable operation will not take effect and the application will still receive a normal VSync signal. * * @syscap SystemCapability.Graphic.Graphic2D.NativeVsync * @param nativeVsync Indicates the pointer to a NativeVsync. - * @param enable Enable or disable the dvsync. + * @param enable Indicates enable or disable DVSync, true indicates enable, false indicates disable. * @return {@link NATIVE_ERROR_OK} 0 - Success. * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - the parameter nativeVsync is NULL or callback is NULL. * {@link NATIVE_ERROR_BINDER_ERROR} 50401000 - ipc send failed. -- Gitee From f72041a06fded0ff5af3fcacd2cf153171234583 Mon Sep 17 00:00:00 2001 From: xxb-wzy Date: Mon, 21 Oct 2024 19:59:02 +0800 Subject: [PATCH 318/620] Signed-off-by: xxb-wzy Change-Id: I7ae1c0e354949db4a00d9c83b5bb910e3122b68d --- .../graphic_2d/native_vsync/native_vsync.h | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/graphic/graphic_2d/native_vsync/native_vsync.h b/graphic/graphic_2d/native_vsync/native_vsync.h index 8d6d3df64..83f9af719 100644 --- a/graphic/graphic_2d/native_vsync/native_vsync.h +++ b/graphic/graphic_2d/native_vsync/native_vsync.h @@ -116,19 +116,19 @@ int OH_NativeVSync_RequestFrameWithMultiCallback( int OH_NativeVSync_GetPeriod(OH_NativeVSync* nativeVsync, long long* period); /** - * @brief Enable DVSync to improve the smoothness of self drawn animation scenes. - * DVSync is Decoupled VSync, which is a frame timing management strategy decoupled from hardware VSync. - * DVSync drives the early drawing of subsequent animation frames by sending VSync signals with future timestamps - * in advance, which are then cached in the frame buffer queue; DVSync reduces the possibility of frame loss - * in the future by caching frames, thereby improving the smoothness of animation scenes. - * Because DVSync requires the use of idle self drawn frame buffers to cache pre drawn animation frames, users need to - * ensure that there is at least one free frame buffer, otherwise it is not recommended to enable this feature. + * @brief Enable DVSync to improve the smoothness of self-drawn animation scenes. + * DVSync stands for Decoupled VSync, a frame timing management strategy decoupled from hardware VSync. + * DVSync drives the early rendering of subsequent animation frames by sending VSync signals with future timestamps + * in advance, which are then cached in the frame buffer queue. DVSync reduces the possibility of future frame drops + * by caching pre-rendered frames for display, thereby improving the smoothness of animation scenes. + * Because DVSync requires the use of free self-drawn frame buffers to cache pre-rendered animation frames, users need + * to ensure that there is at least one free frame buffer, otherwise it is not recommended to enable this feature. * After enabling DVSync, users need to respond correctly to the VSync signal sent in advance, and request - * the next VSync after the animation frame corresponding to the previous VSync is completed, and the self - * drawn frame needs to carry a timestamp consistent with VSync. - * After the animation ends, the user needs to turn off DVSync. + * the next VSync after the animation frame corresponding to the previous VSync has completed, and the self-drawn + * frame needs to carry a timestamp consistent with its VSync event. + * After the animation ends, the user needs to disable DVSync. * On platforms that do not support DVSync or if another application has already enabled DVSync, the current - * enable operation will not take effect and the application will still receive a normal VSync signal. + * enable operation will not take effect and the application will still receive normal VSync signals. * * @syscap SystemCapability.Graphic.Graphic2D.NativeVsync * @param nativeVsync Indicates the pointer to a NativeVsync. -- Gitee From 72930806a551fa94cfe8298dd8ccdf15c1747985 Mon Sep 17 00:00:00 2001 From: lizhuojun Date: Mon, 21 Oct 2024 16:24:51 +0800 Subject: [PATCH 319/620] add ContentForm UDS Signed-off-by: lizhuojun --- distributeddatamgr/udmf/include/udmf.h | 26 +++ distributeddatamgr/udmf/include/udmf_meta.h | 7 + distributeddatamgr/udmf/include/uds.h | 186 ++++++++++++++++++++ distributeddatamgr/udmf/libudmf.ndk.json | 68 +++++++ 4 files changed, 287 insertions(+) diff --git a/distributeddatamgr/udmf/include/udmf.h b/distributeddatamgr/udmf/include/udmf.h index e79579b5f..d8d7149e5 100644 --- a/distributeddatamgr/udmf/include/udmf.h +++ b/distributeddatamgr/udmf/include/udmf.h @@ -368,6 +368,19 @@ int OH_UdmfRecord_AddPixelMap(OH_UdmfRecord* pThis, OH_UdsPixelMap* pixelMap); */ int OH_UdmfRecord_AddArrayBuffer(OH_UdmfRecord* record, const char* type, OH_UdsArrayBuffer* buffer); +/** + * @brief Add one {@link OH_UdsContentForm} data to the {@link OH_UdmfRecord} record. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @param contentForm Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @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_UdsContentForm Udmf_ErrCode. + * @since 14 + */ +int OH_UdmfRecord_AddContentForm(OH_UdmfRecord* pThis, OH_UdsContentForm* contentForm); + /** * @brief Get all types in the {@link OH_UdmfRecord} record. * @@ -509,6 +522,19 @@ int OH_UdmfRecord_GetPixelMap(OH_UdmfRecord* pThis, OH_UdsPixelMap* pixelMap); */ int OH_UdmfRecord_GetArrayBuffer(OH_UdmfRecord* record, const char* type, OH_UdsArrayBuffer* buffer); +/** + * @brief Get one {@link OH_UdsContentForm} data from the {@link OH_UdmfRecord} record. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. + * @param contentForm Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @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_UdsContentForm Udmf_ErrCode. + * @since 14 + */ +int OH_UdmfRecord_GetContentForm(OH_UdmfRecord* pThis, OH_UdsContentForm* contentForm); + /** * @brief Get primary {@link OH_UdsPlainText} data from the {@link OH_UdmfData}. * diff --git a/distributeddatamgr/udmf/include/udmf_meta.h b/distributeddatamgr/udmf/include/udmf_meta.h index 25b31bf80..cfe651a89 100644 --- a/distributeddatamgr/udmf/include/udmf_meta.h +++ b/distributeddatamgr/udmf/include/udmf_meta.h @@ -997,6 +997,13 @@ extern "C" { */ #define UDMF_META_GENERAL_FILE_URI "general.file-uri" +/** + * @brief A specific type of uniform data type. + * + * @since 14 + */ +#define UDMF_METE_GENERAL_CONTENT_FORM "general.content-form" + #ifdef __cplusplus }; #endif diff --git a/distributeddatamgr/udmf/include/uds.h b/distributeddatamgr/udmf/include/uds.h index 4ccef6ebe..e7450a53a 100644 --- a/distributeddatamgr/udmf/include/uds.h +++ b/distributeddatamgr/udmf/include/uds.h @@ -89,6 +89,13 @@ typedef struct OH_UdsFileUri OH_UdsFileUri; */ typedef struct OH_UdsPixelMap OH_UdsPixelMap; +/** + * @brief Describes the unified data struct of content form. + * + * @since 14 + */ +typedef struct OH_UdsContentForm OH_UdsContentForm; + /** * @brief Describes the unified data struct of array buffer. * @@ -665,6 +672,185 @@ int OH_UdsArrayBuffer_SetData(OH_UdsArrayBuffer* buffer, unsigned char* data, un */ int OH_UdsArrayBuffer_GetData(OH_UdsArrayBuffer* buffer, unsigned char** data, unsigned int* len); +/** + * @brief Creation a pointer to the instance of the {@link OH_UdsContentForm}. + * + * @return If the operation is successful, a pointer to the instance of the {@link OH_UdsContentForm} + * structure is returned. If the operation is failed, nullptr is returned. + * @see OH_UdsContentForm + * @since 14 + */ +OH_UdsContentForm* OH_UdsContentForm_Create(); + +/** + * @brief Destroy a pointer that points to the {@link OH_UdsContentForm} instance. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @see OH_UdsContentForm + * @since 14 + */ +void OH_UdsContentForm_Destroy(OH_UdsContentForm* pThis); + +/** + * @brief Get type id from the {@link OH_UdsContentForm}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @return Returns a pointer of the value string when input args normally, otherwise return nullptr. + * @see OH_UdsContentForm + * @since 14 + */ +const char* OH_UdsContentForm_GetType(OH_UdsContentForm* pThis); + +/** + * @brief Get thumb data from the {@link OH_UdsContentForm}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @param thumbData Represents a pointer to thumb data that is a output param. + * @param len Represents the thumb data length that is a output param. + * @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} Internal data error. + * @see OH_UdsContentForm Udmf_ErrCode + * @since 14 + */ +int OH_UdsContentForm_GetThumbData(OH_UdsContentForm* pThis, unsigned char** thumbData, unsigned int* len); + +/** + * @brief Get description from the {@link OH_UdsContentForm}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @return Returns a pointer of the value string when input args normally, otherwise return nullptr. + * @see OH_UdsContentForm + * @since 14 + */ +const char* OH_UdsContentForm_GetDescription(OH_UdsContentForm* pThis); + +/** + * @brief Get title from the {@link OH_UdsContentForm}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @return Returns a pointer of the value string when input args normally, otherwise return nullptr. + * @see OH_UdsContentForm + * @since 14 + */ +const char* OH_UdsContentForm_GetTitle(OH_UdsContentForm* pThis); + +/** + * @brief Get thumb data from the {@link OH_UdsContentForm}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @param appIcon Represents a pointer to app icon that is a output param. + * @param len Represents the app icon length that is a output param. + * @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} Internal data error. + * @see OH_UdsContentForm Udmf_ErrCode + * @since 14 + */ +int OH_UdsContentForm_GetAppIcon(OH_UdsContentForm* pThis, unsigned char** appIcon, unsigned int* len); + +/** + * @brief Get app name from the {@link OH_UdsContentForm}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @return Returns a pointer of the value string when input args normally, otherwise return nullptr. + * @see OH_UdsContentForm + * @since 14 + */ +const char* OH_UdsContentForm_GetAppName(OH_UdsContentForm* pThis); + +/** + * @brief Get link url from the {@link OH_UdsContentForm}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @return Returns a pointer of the value string when input args normally, otherwise return nullptr. + * @see OH_UdsContentForm + * @since 14 + */ +const char* OH_UdsContentForm_GetLinkUri(OH_UdsContentForm* pThis); + +/** + * @brief Set thumb data to the {@link OH_UdsContentForm}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @param thumbData Represents the thumb data. + * @param len Represents the length of thumb data param. + * @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_UdsContentForm Udmf_ErrCode + * @since 14 + */ +int OH_UdsContentForm_SetThumbData(OH_UdsContentForm* pThis, const unsigned char* thumbData, unsigned int len); + +/** + * @brief Set description to the {@link OH_UdsContentForm}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @param description Represents a description 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_UdsContentForm Udmf_ErrCode + * @since 14 + */ +int OH_UdsContentForm_SetDescription(OH_UdsContentForm* pThis, const char* description); + +/** + * @brief Set title to the {@link OH_UdsContentForm}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @param title Represents a title 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_UdsContentForm Udmf_ErrCode + * @since 14 + */ +int OH_UdsContentForm_SetTitle(OH_UdsContentForm* pThis, const char* title); + +/** + * @brief Set thumb data to the {@link OH_UdsContentForm}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @param appIcon Represents the app icon. + * @param len Represents the length of app icon param. + * @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_UdsContentForm Udmf_ErrCode + * @since 14 + */ +int OH_UdsContentForm_SetAppIcon(OH_UdsContentForm* pThis, const unsigned char* appIcon, unsigned int len); + +/** + * @brief Set app name to the {@link OH_UdsContentForm}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @param appName Represents a app name 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_UdsContentForm Udmf_ErrCode + * @since 14 + */ +int OH_UdsContentForm_SetAppName(OH_UdsContentForm* pThis, const char* appName); + +/** + * @brief Set link uri to the {@link OH_UdsContentForm}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}. + * @param linkUri Represents a link 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_UdsContentForm Udmf_ErrCode + * @since 14 + */ +int OH_UdsContentForm_SetLinkUri(OH_UdsContentForm* pThis, const char* linkUri); + #ifdef __cplusplus }; #endif diff --git a/distributeddatamgr/udmf/libudmf.ndk.json b/distributeddatamgr/udmf/libudmf.ndk.json index fc246ae6d..0cef8921c 100644 --- a/distributeddatamgr/udmf/libudmf.ndk.json +++ b/distributeddatamgr/udmf/libudmf.ndk.json @@ -458,5 +458,73 @@ { "first_introduced": "13", "name": "OH_UdsArrayBuffer_GetData" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_Create" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_Destroy" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_GetType" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_GetThumbData" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_GetDescription" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_GetTitle" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_GetAppIcon" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_GetAppName" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_GetLinkUri" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_SetThumbData" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_SetDescription" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_SetTitle" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_SetAppIcon" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_SetAppName" + }, + { + "first_introduced": "14", + "name": "OH_UdsContentForm_SetLinkUri" + }, + { + "first_introduced": "14", + "name": "OH_UdmfRecord_AddContentForm" + }, + { + "first_introduced": "14", + "name": "OH_UdmfRecord_GetContentForm" } ] \ No newline at end of file -- Gitee From 181b424d6ce58de648775a0d255805db5788da1c Mon Sep 17 00:00:00 2001 From: zhangchao Date: Sat, 12 Oct 2024 14:43:57 +0800 Subject: [PATCH 320/620] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8A=98=E5=8F=A0?= =?UTF-8?q?=E5=B1=8F=E9=95=9C=E5=A4=B4=E7=BB=9F=E4=B8=80=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?NDK=E9=9C=80=E6=B1=82=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangchao --- multimedia/camera_framework/camera.h | 46 ++++++++++++++++++++ multimedia/camera_framework/camera.ndk.json | 8 ++++ multimedia/camera_framework/camera_manager.h | 34 +++++++++++++++ 3 files changed, 88 insertions(+) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 50e6f143b..00561fba4 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -973,6 +973,52 @@ typedef struct Camera_FrameShutterEndInfo { int32_t captureId; } Camera_FrameShutterEndInfo; +/** +* @brief Enum for fold status. +* +* @since 13 +* @version 1.0 +*/ +typedef enum Camera_FoldStatus { + /** + * Non_foldable status. + */ + NON_FOLDABLE = 0, + + /** + * Expanded status. + */ + EXPANDED = 1, + + /** + * Folded status. + */ + FOLDED = 2 +} Camera_FoldStatus; + +/** + * @brief Fold status info. + * + * @since 13 + * @version 1.0 + */ +typedef struct Camera_FoldStatusInfo { + /** + * Camera instance list. + */ + Camera_Device** supportedCameras; + + /** + * Size of camera list. + */ + uint32_t cameraSize; + + /** + * Current fold status. + */ + Camera_FoldStatus foldStatus; +} Camera_FoldStatusInfo; + /** * @brief Creates a CameraManager instance. * diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index e5faf336c..e7c84c388 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -602,5 +602,13 @@ { "first_introduced": "12", "name": "OH_PhotoNative_Release" + }, + { + "first_introduced": "13", + "name": "OH_CameraManager_RegisterFoldStatusInfoCallback" + }, + { + "first_introduced": "13", + "name": "OH_CameraManager_UnregisterFoldStatusInfoCallback" } ] diff --git a/multimedia/camera_framework/camera_manager.h b/multimedia/camera_framework/camera_manager.h index 42bcc1aaa..3c7f2fee0 100644 --- a/multimedia/camera_framework/camera_manager.h +++ b/multimedia/camera_framework/camera_manager.h @@ -72,6 +72,16 @@ typedef void (*OH_CameraManager_StatusCallback)(Camera_Manager* cameraManager, C */ typedef void (*OH_CameraManager_TorchStatusCallback)(Camera_Manager* cameraManager, Camera_TorchStatusInfo* status); +/** + * @brief Camera manager fold status info callback. + * + * @param cameraManager the {@link Camera_Manager} which deliver the callback. + * @param foldStatusInfo the {@link Camera_FoldStatusInfo} of the device. + * @since 13 + */ +typedef void (*OH_CameraManager_OnFoldStatusInfoChange)(Camera_Manager* cameraManager, + Camera_FoldStatusInfo* foldStatusInfo); + /** * @brief A listener for camera devices status. * @@ -132,6 +142,30 @@ Camera_ErrorCode OH_CameraManager_RegisterTorchStatusCallback(Camera_Manager* ca Camera_ErrorCode OH_CameraManager_UnregisterTorchStatusCallback(Camera_Manager* cameraManager, OH_CameraManager_TorchStatusCallback torchStatusCallback); +/** + * @brief Register fold status info change event callback. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param foldStatusInfoCallback the {@link OH_CameraManager_OnFoldStatusInfoChange} to be registered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 13 + */ +Camera_ErrorCode OH_CameraManager_RegisterFoldStatusInfoCallback(Camera_Manager* cameraManager, + OH_CameraManager_OnFoldStatusInfoChange foldStatusInfoCallback); + +/** + * @brief Unregister fold status info change event callback. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param foldStatusInfoCallback the {@link OH_CameraManager_OnFoldStatusInfoChange} to be unregistered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 13 + */ +Camera_ErrorCode OH_CameraManager_UnregisterFoldStatusInfoCallback(Camera_Manager* cameraManager, + OH_CameraManager_OnFoldStatusInfoChange foldStatusInfoCallback); + /** * @brief Gets supported camera descriptions. * -- Gitee From ff3d26596703ebc1ba24c43383cd546e7cf4ffe9 Mon Sep 17 00:00:00 2001 From: xxb-wzy Date: Wed, 23 Oct 2024 16:11:03 +0800 Subject: [PATCH 321/620] Signed-off-by: xxb-wzy Change-Id: I2e337ec5699505cbb0121da95b62f38a7238f959 --- .../graphic_2d/native_vsync/native_vsync.h | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/graphic/graphic_2d/native_vsync/native_vsync.h b/graphic/graphic_2d/native_vsync/native_vsync.h index 83f9af719..791fbfd36 100644 --- a/graphic/graphic_2d/native_vsync/native_vsync.h +++ b/graphic/graphic_2d/native_vsync/native_vsync.h @@ -116,25 +116,25 @@ int OH_NativeVSync_RequestFrameWithMultiCallback( int OH_NativeVSync_GetPeriod(OH_NativeVSync* nativeVsync, long long* period); /** - * @brief Enable DVSync to improve the smoothness of self-drawn animation scenes. - * DVSync stands for Decoupled VSync, a frame timing management strategy decoupled from hardware VSync. - * DVSync drives the early rendering of subsequent animation frames by sending VSync signals with future timestamps - * in advance, which are then cached in the frame buffer queue. DVSync reduces the possibility of future frame drops - * by caching pre-rendered frames for display, thereby improving the smoothness of animation scenes. - * Because DVSync requires the use of free self-drawn frame buffers to cache pre-rendered animation frames, users need - * to ensure that there is at least one free frame buffer, otherwise it is not recommended to enable this feature. - * After enabling DVSync, users need to respond correctly to the VSync signal sent in advance, and request - * the next VSync after the animation frame corresponding to the previous VSync has completed, and the self-drawn - * frame needs to carry a timestamp consistent with its VSync event. - * After the animation ends, the user needs to disable DVSync. - * On platforms that do not support DVSync or if another application has already enabled DVSync, the current - * enable operation will not take effect and the application will still receive normal VSync signals. + * @brief Enables DVSync to improve the smoothness of self-drawing animations. + * DVSync, short for Decoupled VSync, is a frame timing management policy that is decoupled from the hardware's VSync. + * DVSync drives the early rendering of upcoming animation frames by sending VSync signals with future timestamps. + * These frames are stored in a frame buffer queue. This helps DVSync reduce potential frame drop and therefore + * enhances the smoothness of animations. + * DVSync requires free self-drawing frame buffers to store these pre-rendered animation frames. + * Therefore, you must ensure that at least one free frame buffer is available. Otherwise, do not enable DVSync. + * After DVSync is enabled, you must correctly respond to the early VSync signals and request the subsequent VSync + * after the animation frame associated with the previous VSync is complete. In addition, the self-drawing frames must + * carry timestamps that align with VSync. + * After the animation ends, disable DVSync. + * On a platform that does not support DVSync or if another application has enabled DVSync, the attempt to enable it + * will not take effect, and the application still receives normal VSync signals. * * @syscap SystemCapability.Graphic.Graphic2D.NativeVsync * @param nativeVsync Indicates the pointer to a NativeVsync. - * @param enable Indicates enable or disable DVSync, true indicates enable, false indicates disable. + * @param enable Whether to enable DVSync.The value true means to enable DVSync, and false means the opposite. * @return {@link NATIVE_ERROR_OK} 0 - Success. - * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - the parameter nativeVsync is NULL or callback is NULL. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - the parameter nativeVsync is NULL. * {@link NATIVE_ERROR_BINDER_ERROR} 50401000 - ipc send failed. * @since 14 * @version 1.0 -- Gitee From c7a5190b111cea0ee4a5aedb29dd7a126dd96a0d Mon Sep 17 00:00:00 2001 From: lusunqi Date: Tue, 13 Aug 2024 21:45:00 +0800 Subject: [PATCH 322/620] =?UTF-8?q?cherry=20pick=205f81cf1=20from=20https:?= =?UTF-8?q?//gitee.com/lusunqi/interface=5Fsdk=5Fc/pulls/1183=20image=5Fef?= =?UTF-8?q?fect=20ndk=E6=8E=A5=E5=8F=A3=E6=8E=92=E6=9F=A5=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lusunqi --- multimedia/image_effect/image_effect_filter.h | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/multimedia/image_effect/image_effect_filter.h b/multimedia/image_effect/image_effect_filter.h index 8c616e60a..d42de85d7 100644 --- a/multimedia/image_effect/image_effect_filter.h +++ b/multimedia/image_effect/image_effect_filter.h @@ -36,6 +36,7 @@ #ifndef NATIVE_IMAGE_EFFECT_FILTER_H #define NATIVE_IMAGE_EFFECT_FILTER_H +#include #include #include "image_effect_errors.h" #include "multimedia/image_framework/image/pixelmap_native.h" @@ -147,6 +148,7 @@ typedef union ImageEffect_DataValue { void *ptrValue; } ImageEffect_DataValue; +#ifdef __cplusplus /** * @brief Data parameter struct information * @@ -159,6 +161,20 @@ typedef struct ImageEffect_Any { /** Effect any data value */ ImageEffect_DataValue dataValue = { 0 }; } ImageEffect_Any; +#else +/** + * @brief Data parameter struct information + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef struct ImageEffect_Any { + /** Effect any data type */ + ImageEffect_DataType dataType; + /** Effect any data value */ + ImageEffect_DataValue dataValue; +} ImageEffect_Any; +#endif /** * @brief Enumerates the pixel format type @@ -315,6 +331,7 @@ ImageEffect_ErrorCode OH_EffectFilterInfo_GetSupportedFormats(OH_EffectFilterInf */ ImageEffect_ErrorCode OH_EffectFilterInfo_Release(OH_EffectFilterInfo *info); +#ifdef __cplusplus /** * @brief EffectFilter names information * @@ -327,6 +344,20 @@ typedef struct ImageEffect_FilterNames { /** EffectFilter names memory block */ const char **nameList = nullptr; } ImageEffect_FilterNames; +#else +/** + * @brief EffectFilter names information + * + * @syscap SystemCapability.Multimedia.ImageEffect.Core + * @since 12 + */ +typedef struct ImageEffect_FilterNames { + /** EffectFilter names array size */ + uint32_t size; + /** EffectFilter names memory block */ + const char **nameList; +} ImageEffect_FilterNames; +#endif /** * @brief Define the new type name OH_EffectBufferInfo for struct OH_EffectBufferInfo -- Gitee From 5b7d2123f3509b050abfc468d5321d9ed02b7a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=A0=E8=B6=85123?= Date: Wed, 23 Oct 2024 10:38:57 +0000 Subject: [PATCH 323/620] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E9=95=9C=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 章超123 --- multimedia/camera_framework/camera.h | 1 - 1 file changed, 1 deletion(-) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 03f0421c8..1a907e0f7 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -1002,7 +1002,6 @@ typedef enum Camera_FoldStatus { * @since 13 * @version 1.0 */ - typedef struct Camera_FoldStatusInfo { /** * Camera instance list. -- Gitee From e7a2d4d7ad29eb7c5413dfafd4b1f7c0920ff884 Mon Sep 17 00:00:00 2001 From: xiaye Date: Fri, 25 Oct 2024 06:54:52 +0800 Subject: [PATCH 324/620] =?UTF-8?q?=E6=B7=BB=E5=8A=A0interface=5Fsdk=5Fc?= =?UTF-8?q?=20getLastJavascriptProxyCallingFrameUrl=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiaye --- web/webview/interfaces/native/arkweb_type.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web/webview/interfaces/native/arkweb_type.h b/web/webview/interfaces/native/arkweb_type.h index d626371eb..37c8ca978 100644 --- a/web/webview/interfaces/native/arkweb_type.h +++ b/web/webview/interfaces/native/arkweb_type.h @@ -214,6 +214,15 @@ typedef struct { */ ArkWeb_ErrorCode (*postWebMessage)( const char* webTag, const char* name, ArkWeb_WebMessagePortPtr* webMessagePorts, size_t size, const char* url); + /** + * @brief Get the url of the last frame that calls the JavaScriptProxy. + * This should be call on the thread which JavaScriptProxy called. + * + * @param webTag The name of the web component. + * @return The url of the last frame that calls the JavaScriptProxy. + * @since 14 + */ + const char* (*getLastJavascriptProxyCallingFrameUrl)(); } ArkWeb_ControllerAPI; /** @@ -417,4 +426,4 @@ typedef struct { #ifdef __cplusplus } #endif -#endif // ARKWEB_TYPE_H \ No newline at end of file +#endif // ARKWEB_TYPE_H -- Gitee From 3228b541e3e17c2110592f9b2b1b2a23d3698c68 Mon Sep 17 00:00:00 2001 From: zyx0121 Date: Fri, 25 Oct 2024 14:19:18 +0800 Subject: [PATCH 325/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=BA=8F=E5=88=97=E5=8C=96=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zyx0121 --- arkui/ace_engine/native/styled_string.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/arkui/ace_engine/native/styled_string.h b/arkui/ace_engine/native/styled_string.h index 49b4d39d3..b3f2db163 100644 --- a/arkui/ace_engine/native/styled_string.h +++ b/arkui/ace_engine/native/styled_string.h @@ -120,29 +120,30 @@ OH_Drawing_Typography* OH_ArkUI_StyledString_CreateTypography(ArkUI_StyledString void OH_ArkUI_StyledString_AddPlaceholder(ArkUI_StyledString* handle, OH_Drawing_PlaceholderSpan* placeholder); /** - * @brief Create a ArkUI_StyledString_Descriptor object. + * @brief Creates an ArkUI_StyledString_Descriptor object. * - * @return Pointer to the ArkUI_StyledString_Descriptor object.。 + * @return Returns the pointer to the ArkUI_StyledString_Descriptor object created. * @since 14 */ -ArkUI_StyledString_Descriptor* OH_ArkUI_StyledString_Descriptor_Create(); +ArkUI_StyledString_Descriptor* OH_ArkUI_StyledString_Descriptor_Create(void); /** - * @brief Release the memory occupied by the ArkUI_StyledString_Descriptor object. + * @brief Destroys an ArkUI_StyledString_Descriptor object and reclaims the memory occupied by the object. * - * @param str Pointer to the ArkUI_StyledString_Descriptor object. + * @param descriptor Pointer to an ArkUI_StyledString_Descriptor object. * @since 14 */ -void OH_ArkUI_StyledString_Descriptor_Destroy(ArkUI_StyledString_Descriptor* str); +void OH_ArkUI_StyledString_Descriptor_Destroy(ArkUI_StyledString_Descriptor* descriptor); /** - * @brief Convert the styled string into html. + * @brief Converts styled string information into HTML. * - * @param str Pointer to the ArkUI_StyledString_Descriptor object. - * @return The converted html. + * @param descriptor Pointer to an ArkUI_StyledString_Descriptor object. + * @return Returns the pointer to the resulting HTML string. This pointer is managed internally and should be destroyed + * by calling OH_ArkUI_StyledString_Descriptor_Destroy() when no longer needed to free the memory. * @since 14 */ -const char* OH_ArkUI_ConvertToHtml(ArkUI_StyledString_Descriptor* str); +const char* OH_ArkUI_ConvertToHtml(ArkUI_StyledString_Descriptor* descriptor); /** * @brief Deserializes a byte array containing styled string information into a styled string. -- Gitee From c9b701de19e600cb53aa44702684251e7b796a1b Mon Sep 17 00:00:00 2001 From: xiaye Date: Fri, 25 Oct 2024 17:37:23 +0800 Subject: [PATCH 326/620] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiaye --- web/webview/interfaces/native/arkweb_type.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/webview/interfaces/native/arkweb_type.h b/web/webview/interfaces/native/arkweb_type.h index 37c8ca978..d078b46fc 100644 --- a/web/webview/interfaces/native/arkweb_type.h +++ b/web/webview/interfaces/native/arkweb_type.h @@ -214,11 +214,11 @@ typedef struct { */ ArkWeb_ErrorCode (*postWebMessage)( const char* webTag, const char* name, ArkWeb_WebMessagePortPtr* webMessagePorts, size_t size, const char* url); + /** * @brief Get the url of the last frame that calls the JavaScriptProxy. * This should be call on the thread which JavaScriptProxy called. * - * @param webTag The name of the web component. * @return The url of the last frame that calls the JavaScriptProxy. * @since 14 */ @@ -427,3 +427,4 @@ typedef struct { } #endif #endif // ARKWEB_TYPE_H + -- Gitee From b6e499e0c19cf2d4f18557c27c67f2964312b820 Mon Sep 17 00:00:00 2001 From: xiaye Date: Fri, 25 Oct 2024 17:48:07 +0800 Subject: [PATCH 327/620] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=A9=BA=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiaye --- web/webview/interfaces/native/arkweb_type.h | 1 - 1 file changed, 1 deletion(-) diff --git a/web/webview/interfaces/native/arkweb_type.h b/web/webview/interfaces/native/arkweb_type.h index d078b46fc..f5e79c287 100644 --- a/web/webview/interfaces/native/arkweb_type.h +++ b/web/webview/interfaces/native/arkweb_type.h @@ -427,4 +427,3 @@ typedef struct { } #endif #endif // ARKWEB_TYPE_H - -- Gitee From dee2145ac1992294d1a9b65b9cb86b1fdfd31503 Mon Sep 17 00:00:00 2001 From: xiaye Date: Fri, 25 Oct 2024 18:02:03 +0800 Subject: [PATCH 328/620] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiaye --- web/webview/interfaces/native/arkweb_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/webview/interfaces/native/arkweb_type.h b/web/webview/interfaces/native/arkweb_type.h index f5e79c287..f449d8e65 100644 --- a/web/webview/interfaces/native/arkweb_type.h +++ b/web/webview/interfaces/native/arkweb_type.h @@ -214,7 +214,7 @@ typedef struct { */ ArkWeb_ErrorCode (*postWebMessage)( const char* webTag, const char* name, ArkWeb_WebMessagePortPtr* webMessagePorts, size_t size, const char* url); - + /** * @brief Get the url of the last frame that calls the JavaScriptProxy. * This should be call on the thread which JavaScriptProxy called. -- Gitee From 9ed5284c8c18e98914c2945dfbfbeb00ddcc5677 Mon Sep 17 00:00:00 2001 From: xiaye Date: Fri, 25 Oct 2024 18:48:39 +0800 Subject: [PATCH 329/620] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiaye --- web/webview/interfaces/native/arkweb_type.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/webview/interfaces/native/arkweb_type.h b/web/webview/interfaces/native/arkweb_type.h index f449d8e65..3fa63b91b 100644 --- a/web/webview/interfaces/native/arkweb_type.h +++ b/web/webview/interfaces/native/arkweb_type.h @@ -214,7 +214,6 @@ typedef struct { */ ArkWeb_ErrorCode (*postWebMessage)( const char* webTag, const char* name, ArkWeb_WebMessagePortPtr* webMessagePorts, size_t size, const char* url); - /** * @brief Get the url of the last frame that calls the JavaScriptProxy. * This should be call on the thread which JavaScriptProxy called. @@ -426,4 +425,4 @@ typedef struct { #ifdef __cplusplus } #endif -#endif // ARKWEB_TYPE_H +#endif // ARKWEB_TYPE_H \ No newline at end of file -- Gitee From 7943840d485b935c2c2d392297e684ce0ed6bff3 Mon Sep 17 00:00:00 2001 From: liuchungang Date: Sat, 26 Oct 2024 15:47:17 +0800 Subject: [PATCH 330/620] add kit name Signed-off-by: liuchungang --- resourceschedule/qos_manager/c/qos.h | 1 + 1 file changed, 1 insertion(+) diff --git a/resourceschedule/qos_manager/c/qos.h b/resourceschedule/qos_manager/c/qos.h index b264a23d9..e7bd4183a 100644 --- a/resourceschedule/qos_manager/c/qos.h +++ b/resourceschedule/qos_manager/c/qos.h @@ -35,6 +35,7 @@ * schedule the time and running order of tasks according to the QoS set by the tasks. * * @library libqos.so + * @kit KernelEnhanceKit * @syscap SystemCapability.Resourceschedule.QoS.Core * @since 12 */ -- Gitee From acc773ff51cc46f8fd31a9776e01672c8a4a62f9 Mon Sep 17 00:00:00 2001 From: sd_wu Date: Tue, 15 Oct 2024 15:00:38 +0800 Subject: [PATCH 331/620] add key callback with ret Signed-off-by: sd_wu --- arkui/ace_engine/native/libace.ndk.json | 4 ++++ .../native/native_interface_xcomponent.h | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index dbae1db8b..38a5c545b 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2374,5 +2374,9 @@ { "first_introduced": "14", "name": "OH_ArkUI_ConvertToHtml" + }, + { + "first_introduced": "14", + "name": "OH_NativeXComponent_RegisterKeyEventCallbackWithResult" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_interface_xcomponent.h b/arkui/ace_engine/native/native_interface_xcomponent.h index 1e427d91e..301d2a6b9 100644 --- a/arkui/ace_engine/native/native_interface_xcomponent.h +++ b/arkui/ace_engine/native/native_interface_xcomponent.h @@ -830,6 +830,20 @@ OH_NativeXComponent* OH_NativeXComponent_GetNativeXComponent(ArkUI_NodeHandle no int32_t OH_NativeXComponent_GetNativeAccessibilityProvider( OH_NativeXComponent* component, ArkUI_AccessibilityProvider** handle); +/** + * @brief Registers a callback for this OH_NativeXComponent instance. + * + * @param component Indicates the pointer to this OH_NativeXComponent instance. + * @param callback Indicates the pointer to a key event callback with result. + * @return Returns the status code of the execution. + * {@link OH_NATIVEXCOMPONENT_RESULT_SUCCESS} the callback function is successfully registered.\n + * {@link OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER} component is nullptr or callback is nullptr.\n + * @since 14 + * @version 1.0 + */ +int32_t OH_NativeXComponent_RegisterKeyEventCallbackWithResult( + OH_NativeXComponent* component, bool (*callback)(OH_NativeXComponent* component, void* window)); + #ifdef __cplusplus }; #endif -- Gitee From 7f076e20db4573af381f752c320a2f4cd0b0f058 Mon Sep 17 00:00:00 2001 From: xiaye Date: Tue, 29 Oct 2024 10:56:25 +0800 Subject: [PATCH 332/620] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A9=BA=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiaye --- web/webview/interfaces/native/arkweb_type.h | 1 + 1 file changed, 1 insertion(+) diff --git a/web/webview/interfaces/native/arkweb_type.h b/web/webview/interfaces/native/arkweb_type.h index 3fa63b91b..449897312 100644 --- a/web/webview/interfaces/native/arkweb_type.h +++ b/web/webview/interfaces/native/arkweb_type.h @@ -214,6 +214,7 @@ typedef struct { */ ArkWeb_ErrorCode (*postWebMessage)( const char* webTag, const char* name, ArkWeb_WebMessagePortPtr* webMessagePorts, size_t size, const char* url); + /** * @brief Get the url of the last frame that calls the JavaScriptProxy. * This should be call on the thread which JavaScriptProxy called. -- Gitee From 55d94d87ef1f204f23c68b4f1f88dca9c23e01c2 Mon Sep 17 00:00:00 2001 From: liumingyue Date: Fri, 18 Oct 2024 16:09:21 +0800 Subject: [PATCH 333/620] add OH_NativeBundle_GetCompatibleDeviceType Signed-off-by: liumingyue --- .../bundle/include/native_interface_bundle.h | 14 ++++++++++++++ .../bundle_framework/bundle/libbundle.ndk.json | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h index 2cc076408..04bb5d331 100644 --- a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h +++ b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h @@ -145,6 +145,20 @@ char* OH_NativeBundle_GetAppIdentifier(); * @since 13 */ OH_NativeBundle_ElementName OH_NativeBundle_GetMainElementName(); + +/** + * @brief Obtains the compatible device type of the current application. + * After utilizing this interface, to prevent memory leaks, + * it is necessary to manually release the pointer returned by the interface. + * + * @return Returns the newly created string that indicates the compatible device type, + * if the returned object is NULL, it indicates creation failure. + * The possible cause of failure could be that the application address space is full, + * leading to space allocation failure. + * @since 14 + * @version 1.0 + */ +char* OH_NativeBundle_GetCompatibleDeviceType(); #ifdef __cplusplus }; #endif diff --git a/bundlemanager/bundle_framework/bundle/libbundle.ndk.json b/bundlemanager/bundle_framework/bundle/libbundle.ndk.json index a9db17ede..f61863508 100644 --- a/bundlemanager/bundle_framework/bundle/libbundle.ndk.json +++ b/bundlemanager/bundle_framework/bundle/libbundle.ndk.json @@ -14,5 +14,9 @@ { "first_introduced": "13", "name": "OH_NativeBundle_GetMainElementName" + }, + { + "first_introduced": "14", + "name": "OH_NativeBundle_GetCompatibleDeviceType" } ] -- Gitee From b479fd442812f2aaebe78fb4bd23f6d65d67fbe0 Mon Sep 17 00:00:00 2001 From: xxb-wzy Date: Thu, 31 Oct 2024 17:06:45 +0800 Subject: [PATCH 334/620] Signed-off-by: xxb-wzy Change-Id: I237236331668aa6f3304bce91b9eb59750710b4f --- graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json b/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json index 7c0511407..28ff64c27 100644 --- a/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json +++ b/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json @@ -4,5 +4,8 @@ { "name": "OH_NativeVSync_RequestFrame" }, { "name": "OH_NativeVSync_RequestFrameWithMultiCallback" }, { "name": "OH_NativeVSync_GetPeriod" }, - { "name": "OH_NativeVSync_DVSyncSwitch" } + { + "first_introduced": "14", + "name": "OH_NativeVSync_DVSyncSwitch" + } ] \ No newline at end of file -- Gitee From 26f6793805df481e62ccc8ae6d32d594a0ef5ab4 Mon Sep 17 00:00:00 2001 From: Cai Xincheng Date: Thu, 31 Oct 2024 17:37:54 +0800 Subject: [PATCH 335/620] change RequireAttrEncrypted to since 14 Signed-off-by: Cai Xincheng Change-Id: I1438c1ec6f9c9c73484b3b281c8b397a698e4db1 --- security/asset/inc/asset_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/asset/inc/asset_type.h b/security/asset/inc/asset_type.h index 8d64e56d5..a214c1928 100755 --- a/security/asset/inc/asset_type.h +++ b/security/asset/inc/asset_type.h @@ -208,7 +208,7 @@ typedef enum { /** * A tag whose value is a bool indicating whether the attributes of an asset are required to be encrypted. * - * @since 13 + * @since 14 */ ASSET_TAG_REQUIRE_ATTR_ENCRYPTED = ASSET_TYPE_BOOL | 0x47, } Asset_Tag; -- Gitee From 74c8fe98637ec2f5cbfd613805d2df564c3bd15d Mon Sep 17 00:00:00 2001 From: yuhaoqiang Date: Fri, 1 Nov 2024 09:58:36 +0800 Subject: [PATCH 336/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9api=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuhaoqiang --- hiviewdfx/hidebug/include/hidebug/hidebug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug.h b/hiviewdfx/hidebug/include/hidebug/hidebug.h index cd9eaa828..7f234b359 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug.h @@ -146,7 +146,7 @@ HiDebug_ErrorCode OH_HiDebug_StopAppTraceCapture(); * {@link HIDEBUG_SUCCESS} Get graphics memory success. * {@link HIDEBUG_INVALID_ARGUMENT} Invalid argument,value is null. * {@link HIDEBUG_TRACE_ABNORMAL} Failed to get the application memory due to a remote exception. - * @since 13 + * @since 14 */ HiDebug_ErrorCode OH_HiDebug_GetGraphicsMemory(uint32_t *value); -- Gitee From d93a226ebe110d789550729f966133c8dd70b3cf Mon Sep 17 00:00:00 2001 From: j00466033 Date: Mon, 28 Oct 2024 19:42:28 +0800 Subject: [PATCH 337/620] JD ndk jsb Signed-off-by: j00466033 --- .../interfaces/native/arkweb_interface.h | 6 + web/webview/interfaces/native/arkweb_type.h | 114 +++++++++++++++++- 2 files changed, 119 insertions(+), 1 deletion(-) diff --git a/web/webview/interfaces/native/arkweb_interface.h b/web/webview/interfaces/native/arkweb_interface.h index b610729ed..f204dab32 100644 --- a/web/webview/interfaces/native/arkweb_interface.h +++ b/web/webview/interfaces/native/arkweb_interface.h @@ -65,6 +65,12 @@ typedef enum { ARKWEB_NATIVE_WEB_MESSAGE, /** API type related to ArkWeb cookie manager. */ ARKWEB_NATIVE_COOKIE_MANAGER, + /** + * @brief API type related to ArkWeb JavaScript value. + * + * @since 14 + */ + ARKWEB_NATIVE_JAVASCRIPT_VALUE, } ArkWeb_NativeAPIVariantKind; /* diff --git a/web/webview/interfaces/native/arkweb_type.h b/web/webview/interfaces/native/arkweb_type.h index 449897312..e6738810a 100644 --- a/web/webview/interfaces/native/arkweb_type.h +++ b/web/webview/interfaces/native/arkweb_type.h @@ -68,6 +68,20 @@ typedef enum ArkWeb_WebMessageType { ARKWEB_BUFFER } ArkWeb_WebMessageType; +/** + * @brief Defines the data type carried in a ArkWeb_JavaScriptValue. + * + * @since 14 + */ +typedef enum ArkWeb_JavaScriptValueType { + /** Represent error data */ + ARKWEB_JAVASCRIPT_NONE = 0, + /** The data carried in the ArkWeb_JavaScriptValue is string. */ + ARKWEB_JAVASCRIPT_STRING, + /** The data carried in the ArkWeb_JavaScriptValue is bool. */ + ARKWEB_JAVASCRIPT_BOOL +} ArkWeb_JavaScriptValueType; + /** * @brief Defines the ArkWeb_WebMessage. * @@ -75,6 +89,13 @@ typedef enum ArkWeb_WebMessageType { */ typedef struct ArkWeb_WebMessage* ArkWeb_WebMessagePtr; +/** + * @brief Defines the ArkWeb_JavaScriptValuePtr. + * + * @since 14 + */ +typedef struct ArkWeb_JavaScriptValue* ArkWeb_JavaScriptValuePtr; + /** * @brief Defines the javascript callback of the native ArkWeb. * @@ -91,6 +112,19 @@ typedef void (*ArkWeb_OnJavaScriptCallback)( typedef void (*ArkWeb_OnJavaScriptProxyCallback)( const char* webTag, const ArkWeb_JavaScriptBridgeData* dataArray, size_t arraySize, void* userData); +/** + * @brief Defines the JavaScript proxy callback of the native ArkWeb. + * + * @param webTag The name of the web component. + * @param dataArray The JavaScript bridge data array from HTML. + * @param arraySize The number of elements in the array. + * @param userData The data set by user. + * + * @since 14 + */ +typedef ArkWeb_JavaScriptValuePtr (*ArkWeb_OnJavaScriptProxyCallbackWithResult)( + const char* webTag, const ArkWeb_JavaScriptBridgeData* dataArray, size_t arraySize, void* userData); + /** * @brief Defines the component callback of the native ArkWeb. * @@ -148,6 +182,20 @@ typedef struct { void* userData; } ArkWeb_ProxyMethod; +/** + * @brief Defines the JavaScript proxy method with a return value. + * + * @since 14 + */ +typedef struct { + /** The method of the application side JavaScript object participating in the registration. */ + const char* methodName; + /** The callback function with a return value registered by developer is called back when HTML side uses. */ + ArkWeb_OnJavaScriptProxyCallbackWithResult callback; + /** The user data to set. */ + void* userData; +} ArkWeb_ProxyMethodWithResult; + /** * @brief Defines the javascript proxy registered object. * @@ -162,6 +210,20 @@ typedef struct { size_t size; } ArkWeb_ProxyObject; +/** + * @brief Defines the JavaScript proxy registered object with methodList that has a return value. + * + * @since 14 + */ +typedef struct { + /** The name of the registered object. */ + const char* objName; + /** The JavaScript proxy registered method object list with a callback function that has a return value */ + const ArkWeb_ProxyMethodWithResult* methodList; + /** The size of the methodList. */ + size_t size; +} ArkWeb_ProxyObjectWithResult; + /** * @brief Defines the controller API for native ArkWeb. * Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check @@ -223,6 +285,32 @@ typedef struct { * @since 14 */ const char* (*getLastJavascriptProxyCallingFrameUrl)(); + + /** + * @brief Register the JavaScript object and method list, the method is callback function that has a return value. + * + * @param webTag The name of the web component. + * @param proxyObject The JavaScript object to register, the object has callback functions with return value. + * @param permission The JSON string, which defaults to null, is used to configure the permission control for + * JSBridge, allowing for the definition of URL whitelists at the object and method levels. + * + * @since 14 + */ + void (*registerJavaScriptProxyEx)(const char* webTag, const ArkWeb_ProxyObjectWithResult* proxyObject, + const char* permission); + + /** + * @brief Register the JavaScript object and async method list. + * + * @param webTag The name of the web component. + * @param proxyObject The JavaScript object to register. + * @param permission The JSON string, which defaults to null, is used to configure the permission control + * for JSBridge, allowing for the definition of URL whitelists at the object and method levels. + * + * @since 14 + */ + void (*registerAsyncJavaScriptProxyEx)(const char* webTag, const ArkWeb_ProxyObject* proxyObject, + const char* permission); } ArkWeb_ControllerAPI; /** @@ -353,7 +441,7 @@ typedef struct { typedef struct { /** The ArkWeb_CookieManagerAPI struct size. */ size_t size; - + /** * @brief Obtains the cookie value corresponding to a specified URL. * @@ -408,6 +496,30 @@ typedef struct { void (*clearSessionCookiesSync)(); } ArkWeb_CookieManagerAPI; +/** + * @brief Defines the native JavaScriptValue API for ArkWeb. + * Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check + * whether the function structure has a corresponding function pointer to avoid crash + * caused by mismatch between the SDK and the device ROM. + * + * @since 14 + */ +typedef struct { + /** The ArkWeb_JavaScriptValueAPI struct size. */ + size_t size; + + /** + * @brief Create the JavaScript value responding to HTML. + * + * @param type The type of ArkWeb_JavaScriptValue. + * @param data The data buffer of ArkWeb_JavaScriptValue. + * @param dataLength The length of data buffer. + * @return ArkWeb_JavaScriptValuePtr created by ArkWeb, the memory of ArkWeb_JavaScriptValue + * is managed by ArkWeb itself. + */ + ArkWeb_JavaScriptValuePtr (*createJavaScriptValue)(ArkWeb_JavaScriptValueType type, void* data, size_t dataLength); +} ArkWeb_JavaScriptValueAPI; + /** * @brief Check whether the member variables of the current struct exist. * -- Gitee From 7d421a0aa5687bad8995075bcb12d2b9fa36fdcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=9E=E8=B6=85=E9=BA=92?= Date: Fri, 1 Nov 2024 11:42:06 +0800 Subject: [PATCH 338/620] add kit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 俞超麒 --- .../native_color_space_manager/native_color_space_manager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/graphic/graphic_2d/native_color_space_manager/native_color_space_manager.h b/graphic/graphic_2d/native_color_space_manager/native_color_space_manager.h index e4634b474..a2528fcb9 100644 --- a/graphic/graphic_2d/native_color_space_manager/native_color_space_manager.h +++ b/graphic/graphic_2d/native_color_space_manager/native_color_space_manager.h @@ -29,6 +29,7 @@ * * @brief Defines the functions for obtaining and using a native colorSpaceManager. * + * @kit ArkGraphics2D * @library libnative_color_space_manager.so * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core * @since 13 -- Gitee From f41656beb8aeb7b4f61d540fe82ec3cfc58886c8 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Fri, 1 Nov 2024 15:45:59 +0800 Subject: [PATCH 339/620] add kit Signed-off-by: changleipeng --- graphic/graphic_2d/native_drawing/drawing_text_line.h | 3 +++ graphic/graphic_2d/native_drawing/drawing_text_run.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_line.h b/graphic/graphic_2d/native_drawing/drawing_text_line.h index 760769b4b..256251146 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_line.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_line.h @@ -30,6 +30,9 @@ * * @brief Declares functions related to textLine in the drawing module. * + * @kit ArkGraphics2D + * @library libnative_drawing.so + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @since 14 * @version 1.0 */ diff --git a/graphic/graphic_2d/native_drawing/drawing_text_run.h b/graphic/graphic_2d/native_drawing/drawing_text_run.h index b71a197dd..7237fd88c 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_run.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_run.h @@ -30,6 +30,9 @@ * * @brief Declares functions related to run in the drawing module. * + * @kit ArkGraphics2D + * @library libnative_drawing.so + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @since 14 * @version 1.0 */ -- Gitee From e8c8289f312c59f46efa8b6c438060683990b4d9 Mon Sep 17 00:00:00 2001 From: lihui Date: Sat, 2 Nov 2024 15:07:53 +0800 Subject: [PATCH 340/620] =?UTF-8?q?pts=20api=20=E5=9B=9E=E9=80=8013?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lihui --- graphic/graphic_2d/native_window/external_window.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/graphic/graphic_2d/native_window/external_window.h b/graphic/graphic_2d/native_window/external_window.h index f2b57576e..47a407ff0 100644 --- a/graphic/graphic_2d/native_window/external_window.h +++ b/graphic/graphic_2d/native_window/external_window.h @@ -163,15 +163,17 @@ typedef enum NativeWindowOperation { */ GET_SWAP_INTERVAL, /** - * set native window buffer timeout, + * set the timeout in milliseconds when the native window requests a buffer, + * the default value is 3000 milliseconds when not set, * variable parameter in function is - * [in] int32_t timeout. + * [in] int32_t timeout, in milliseconds. */ SET_TIMEOUT, /** - * get native window buffer timeout, + * get the timeout in milliseconds when the native window requests a buffer, + * the default value is 3000 milliseconds when not set, * variable parameter in function is - * [out] int32_t *timeout. + * [out] int32_t *timeout, in milliseconds. */ GET_TIMEOUT, /** @@ -264,7 +266,7 @@ typedef enum NativeWindowOperation { * the desiredPresentTimestamp will be ignored.\n * Variable parameter in function is * [in] int64_t desiredPresentTimestamp. - * @since 14 + * @since 13 */ SET_DESIRED_PRESENT_TIMESTAMP = 24, } NativeWindowOperation; -- Gitee From 8e664635f31976568137e514bb2ae6345a0f3b87 Mon Sep 17 00:00:00 2001 From: Gavin Date: Fri, 1 Nov 2024 17:38:26 +0800 Subject: [PATCH 341/620] feature: pasteboard add interface getMimeTypes Signed-off-by: Gavin --- .../pasteboard/include/oh_pasteboard.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/distributeddatamgr/pasteboard/include/oh_pasteboard.h b/distributeddatamgr/pasteboard/include/oh_pasteboard.h index 6ac4336a2..15d489623 100644 --- a/distributeddatamgr/pasteboard/include/oh_pasteboard.h +++ b/distributeddatamgr/pasteboard/include/oh_pasteboard.h @@ -267,6 +267,18 @@ int OH_Pasteboard_SetData(OH_Pasteboard* pasteboard, OH_UdmfData* data); * @since 13 */ int OH_Pasteboard_ClearData(OH_Pasteboard* pasteboard); + +/** + * @brief Obtains all MIME types of Pasteboard data. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param count Poniter to the count of MIME types. + * @return Returns char array of MIME types in the Pasteboard. + * Returns nullptr if the operation is failed. + * @see OH_Pasteboard. + * @since 14 + */ +char **OH_Pasteboard_GetMimeTypes(OH_Pasteboard *pasteboard, unsigned int *count); #ifdef __cplusplus }; #endif -- Gitee From 4b7a102b3ca7218efbbf7923b48326ee7862809e Mon Sep 17 00:00:00 2001 From: huangji731 Date: Sat, 2 Nov 2024 17:03:23 +0800 Subject: [PATCH 342/620] https://gitee.com/openharmony/interface_sdk_c/issues/IB053U Signed-off-by: huangji731 --- arkui/display_manager/BUILD.gn | 2 + arkui/display_manager/libdm.ndk.json | 24 ++++ arkui/display_manager/oh_display_capture.h | 69 ++++++++++ arkui/display_manager/oh_display_info.h | 145 +++++++++++++++++++++ arkui/display_manager/oh_display_manager.h | 58 +++++++++ 5 files changed, 298 insertions(+) create mode 100644 arkui/display_manager/oh_display_capture.h diff --git a/arkui/display_manager/BUILD.gn b/arkui/display_manager/BUILD.gn index bfdc284ac..ba052e0a3 100644 --- a/arkui/display_manager/BUILD.gn +++ b/arkui/display_manager/BUILD.gn @@ -17,6 +17,7 @@ import("//build/ohos/ndk/ndk.gni") ohos_ndk_headers("display_manager_header") { dest_dir = "$ndk_headers_out_dir/window_manager" sources = [ + "oh_display_capture.h", "oh_display_info.h", "oh_display_manager.h", ] @@ -28,6 +29,7 @@ ohos_ndk_library("native_display_manager") { ndk_description_file = "./libdm.ndk.json" system_capability = "SystemCapability.Window.SessionManager" system_capability_headers = [ + "oh_display_capture.h", "oh_display_info.h", "oh_display_manager.h", ] diff --git a/arkui/display_manager/libdm.ndk.json b/arkui/display_manager/libdm.ndk.json index 5efd53561..c86ff6a93 100644 --- a/arkui/display_manager/libdm.ndk.json +++ b/arkui/display_manager/libdm.ndk.json @@ -78,5 +78,29 @@ { "first_instroduced":"12", "name":"OH_NativeDisplayManager_UnregisterDisplayChangeListener" + }, + { + "first_instroduced":"14", + "name":"OH_NativeDisplayManager_CreatePrimaryDisplay" + }, + { + "first_instroduced":"14", + "name":"OH_NativeDisplayManager_CreateDisplayById" + }, + { + "first_instroduced":"14", + "name":"OH_NativeDisplayManager_DestroyDisplay" + }, + { + "first_instroduced":"14", + "name":"OH_NativeDisplayManager_CreateAllDisplays" + }, + { + "first_instroduced":"14", + "name":"OH_NativeDisplayManager_DestroyAllDisplays" + }, + { + "first_instroduced":"14", + "name":"OH_NativeDisplayManager_CaptureScreenPixelmap" } ] \ No newline at end of file diff --git a/arkui/display_manager/oh_display_capture.h b/arkui/display_manager/oh_display_capture.h new file mode 100644 index 000000000..a9fd997b1 --- /dev/null +++ b/arkui/display_manager/oh_display_capture.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup OH_DisplayCapture + * @{ + * + * @brief Defines the data structures for the C APIs of the display module. + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 14 + * @version 1.0 + */ + +/** + * @file oh_display_capture.h + * + * @brief Defines the data structures for the C APIs of the display capture. + * + * @kit ArkUI + * @library libnative_display_manager.so + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 14 + * @version 1.0 + */ + +#ifndef OH_NATIVE_DISPLAY_CAPTURE_H +#define OH_NATIVE_DISPLAY_CAPTURE_H + +#include "multimedia/image_framework/image/pixelmap_native.h" +#include "oh_display_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Capture a screen pixelmap of the specified display. + * + * @param displayId The ID of the display to be captured. + * @param pixelMap The output pixel map of the captured display. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful. + * { @link DISPLAY_MANAGER_ERROR_NO_PERMISSION } If no permission. + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } If device not support. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager.Core + * @since 14 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CaptureScreenPixelmap(uint32_t displayId, + OH_PixelmapNative **pixelMap); + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif // OH_NATIVE_DISPLAY_CAPTURE_H diff --git a/arkui/display_manager/oh_display_info.h b/arkui/display_manager/oh_display_info.h index 3b6175884..2a4bda3fb 100644 --- a/arkui/display_manager/oh_display_info.h +++ b/arkui/display_manager/oh_display_info.h @@ -45,6 +45,12 @@ extern "C" { #endif +/** + * @brief display name length + * @since 14 + */ +#define OH_DISPLAY_NAME_LENGTH 32 + /** * @brief Enumerates rotations. * @@ -197,6 +203,145 @@ typedef struct { NativeDisplayManager_WaterfallDisplayAreaRects waterfallDisplayAreaRects; } NativeDisplayManager_CutoutInfo; +/** + * @brief Enumerates of the display state. + * + * @since 14 + * @version 1.0 + */ +typedef enum { + /** display state unknown */ + DISPLAY_MANAGER_DISPLAY_STATE_UNKNOWN = 0, + + /** display state off */ + DISPLAY_MANAGER_DISPLAY_STATE_OFF = 1, + + /** display state on */ + DISPLAY_MANAGER_DISPLAY_STATE_ON = 2, + + /** display state doze */ + DISPLAY_MANAGER_DISPLAY_STATE_DOZE = 3, + + /** display state doze suspend */ + DISPLAY_MANAGER_DISPLAY_STATE_DOZE_SUSPEND = 4, + + /** display state vr */ + DISPLAY_MANAGER_DISPLAY_STATE_VR = 5, + + /** display state on suspend */ + DISPLAY_MANAGER_DISPLAY_STATE_ON_SUSPEND = 6, +} NativeDisplayManager_DisplayState; + +/** + * @brief Defines the display hdr structure. + * + * @since 14 + * @version 1.0 + */ +typedef struct { + /** hdrFormat length */ + uint32_t hdrFormatLength; + + /** hdrFormat pointer */ + uint32_t *hdrFormats; +} NativeDisplayManager_DisplayHdrFormat; + +/** + * @brief Defines the display color space structure. + * + * @since 14 + * @version 1.0 + */ +typedef struct { + /** color space length */ + uint32_t colorSpaceLength; + + /** color space pointer */ + uint32_t *colorSpaces; +} NativeDisplayManager_DisplayColorSpace; + +/** + * @brief Defines the display structure. + * + * @since 14 + * @version 1.0 + */ +typedef struct { + /** display id */ + uint32_t id; + + /** display name */ + char name[OH_DISPLAY_NAME_LENGTH + 1]; + + /** display is alive */ + bool isAlive; + + /** display width */ + int32_t width; + + /** display height */ + int32_t height; + + /** display physical width */ + int32_t physicalWidth; + + /** display physical height */ + int32_t physicalHeight; + + /** display refresh rate */ + uint32_t refreshRate; + + /** display available width */ + uint32_t availableWidth; + + /** display available height */ + uint32_t availableHeight; + + /** display density dpi */ + float densityDPI; + + /** display density pixels */ + float densityPixels; + + /** display scale density */ + float scaledDensity; + + /** display xdpi*/ + float xDPI; + + /** display ydpi */ + float yDPI; + + /** display rotation */ + NativeDisplayManager_Rotation rotation; + + /** display state */ + NativeDisplayManager_DisplayState state; + + /** display orientation */ + NativeDisplayManager_Orientation orientation; + + /** display hdr format */ + NativeDisplayManager_DisplayHdrFormat *hdrFormat; + + /** display color space */ + NativeDisplayManager_DisplayColorSpace *colorSpace; +} NativeDisplayManager_DisplayInfo; + +/** + * @brief Defines the displays structure. + * + * @since 14 + * @version 1.0 + */ +typedef struct { + /** displays length */ + uint32_t displaysLength; + + /** displays pointer */ + NativeDisplayManager_DisplayInfo *displaysInfo; +} NativeDisplayManager_DisplaysInfo; + #ifdef __cplusplus } #endif diff --git a/arkui/display_manager/oh_display_manager.h b/arkui/display_manager/oh_display_manager.h index a3b9f3444..caf6480af 100644 --- a/arkui/display_manager/oh_display_manager.h +++ b/arkui/display_manager/oh_display_manager.h @@ -311,6 +311,64 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterFoldDisplayModeCh */ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterFoldDisplayModeChangeListener(uint32_t listenerIndex); +/** + * @brief Create all displays. + * + * @param allDisplays Output parameter for all displays information. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful. + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager.Core + * @since 14 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateAllDisplays( + NativeDisplayManager_DisplaysInfo **allDisplays); + +/** + * @brief Destroy all displays. + * + * @param allDisplays all displays to be free. + * @syscap SystemCapability.Window.SessionManager.Core + * @since 14 + */ +void OH_NativeDisplayManager_DestroyAllDisplays(NativeDisplayManager_DisplaysInfo *allDisplays); + +/** + * @brief Create display information by display id. + * + * @param displayId The display id. + * @param displayInfo The pointer to the display information. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful. + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager.Core + * @since 14 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateDisplayById(uint32_t displayId, + NativeDisplayManager_DisplayInfo **displayInfo); + +/** + * @brief Destroy the display information. + * + * @param displayInfo the target display to be free. + * @syscap SystemCapability.Window.SessionManager.Core + * @since 14 + */ +void OH_NativeDisplayManager_DestroyDisplay(NativeDisplayManager_DisplayInfo *displayInfo); + +/** + * @brief Create a primary display. + * + * @param displayInfo The information of the created display. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful. + * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager.Core + * @since 14 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreatePrimaryDisplay( + NativeDisplayManager_DisplayInfo **displayInfo); + #ifdef __cplusplus } #endif -- Gitee From c4baca0f0dbf3fb4527b4d4be73c135f59c52663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=9C=AA=E6=9D=A5?= Date: Mon, 4 Nov 2024 11:34:54 +0800 Subject: [PATCH 343/620] =?UTF-8?q?=E8=A1=A5=E5=85=85kit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 徐未来 --- BasicServicesKit/time_service.h | 1 + 1 file changed, 1 insertion(+) diff --git a/BasicServicesKit/time_service.h b/BasicServicesKit/time_service.h index c7194a406..b33159e86 100644 --- a/BasicServicesKit/time_service.h +++ b/BasicServicesKit/time_service.h @@ -28,6 +28,7 @@ * * @brief Declares the APIs for obtaining the time zone information. * @library libtime_service_ndk.so + * @kit BasicServicesKit * @syscap SystemCapability.MiscServices.Time * @since 12 */ -- Gitee From de0ab9ff601762b8f9951fed01cdda8626a72017 Mon Sep 17 00:00:00 2001 From: wangcaoyu Date: Mon, 4 Nov 2024 17:19:36 +0800 Subject: [PATCH 344/620] delete README.OpenSource in third_party Signed-off-by: wangcaoyu --- README.OpenSource | 83 -------------------- third_party/egl/README.OpenSource | 11 --- third_party/icu4c/README.OpenSource | 10 --- third_party/libuv/README.OpenSource | 11 --- third_party/mindspore/README.OpenSource | 11 --- third_party/musl/README.OpenSource | 11 --- third_party/node/README.OpenSource | 11 --- third_party/openGLES/README.OpenSource | 11 --- third_party/openSLES/README.OpenSource | 11 --- third_party/vulkan-headers/README.OpenSource | 11 --- third_party/zlib/README.OpenSource | 11 --- 11 files changed, 192 deletions(-) delete mode 100644 README.OpenSource delete mode 100644 third_party/egl/README.OpenSource delete mode 100644 third_party/icu4c/README.OpenSource delete mode 100644 third_party/libuv/README.OpenSource delete mode 100644 third_party/mindspore/README.OpenSource delete mode 100644 third_party/musl/README.OpenSource delete mode 100644 third_party/node/README.OpenSource delete mode 100644 third_party/openGLES/README.OpenSource delete mode 100644 third_party/openSLES/README.OpenSource delete mode 100644 third_party/vulkan-headers/README.OpenSource delete mode 100644 third_party/zlib/README.OpenSource diff --git a/README.OpenSource b/README.OpenSource deleted file mode 100644 index 0b04b76a8..000000000 --- a/README.OpenSource +++ /dev/null @@ -1,83 +0,0 @@ -[ - { - "Name" : "zlib", - "License" : "zlib/libpng License", - "License File" : "LICENSE", - "Version Number" : "v1.2.12", - "Owner" : "gongjunsong@huawei.com", - "Upstream URL" : "https://github.com/madler/zlib/archive/refs/tags/v1.2.12.tar.gz", - "Description" : "zlib 1.2.12 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files" - }, - { - "Name": "libuv", - "License": "MIT License", - "License File": "LICENSE", - "Version Number": "v1.44.1", - "Owner": "sunbingxin@huawei.com", - "Upstream URL": "https://github.com/libuv/libuv", - "Description": "libuv is a multi-platform support library with a focus on asynchronous I/O." - }, - { - "Name": "MindSpore", - "License": "Apache License 2.0", - "License File": "LICENSE.txt", - "Version Number": "1.8.1", - "Owner": "zhuguodong0001@163.com", - "Upstream URL": "https://gitee.com/mindspore/mindspore/repository/archive/v1.8.1", - "Description": "MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios." - }, - { - "Name" : "musl", - "License" : "MIT License", - "License File" : "COPYRIGHT", - "Version Number" : "1.2.5", - "Owner" : "zhaoxinyuan9@huawei.com", - "Upstream URL" : "https://musl.libc.org", - "Description" : "musl is an MIT-licensed implementation of the standard C library" - }, - { - "Name": "node", - "License": "ISC License,Public Domain,MIT License,Free Software Foundation - MIT License,Apache License V2.0,ICU License,zlib/libpng License,BSD 2-Clause License,BSD 3-Clause License", - "License File": "LICENSE", - "Version Number": "14.21.2", - "Owner": "sunbingxin@huawei.com", - "Upstream URL": "http://www.nodejs.org/", - "Description": "Node.js is an open-source, cross-platform, JavaScript runtime environment. It executes JavaScript code outside of a browser." - }, - { - "Name": "Khronos Group - OpenSL ES", - "License": "null", - "License File": "NOTICE", - "Version Number": "1.0.1", - "Owner": "yangshuai67@huawei.com", - "Upstream URL": "https://github.com/KhronosGroup/OpenSL-ES-Registry.git", - "Description": "OpenSL ES™ is a royalty-free, cross-platform, hardware-accelerated audio API tuned for embedded systems." - }, - { - "Name": "EGL", - "License": "MIT License", - "License File": "LICENSE", - "Version Number": "1.5", - "Owner": "lizheng2@huawei.com", - "Upstream URL": "https://github.com/KhronosGroup/EGL-Registry.git", - "Description": "EGL is an interface between Khronos rendering APIs such as OpenGL ES or OpenVG and the underlying native platform window system." - }, - { - "Name": "openGLES", - "License": "Apache-2.0", - "License File": "NOTICE", - "Version Number": "a301c9b4600e4074008b93fba17744a859fb763b", - "Owner": "lizheng2@huawei.com", - "Upstream URL": "https://github.com/KhronosGroup/OpenGL-Registry.git", - "Description": "The OpenGL ES registry contains specifications of the core API and shading language; specifications of Khronos- and vendor-approved OpenGL ES extensions; header files corresponding to the specificatio" - }, - { - "Name": "Vulkan", - "License": "Apache-2.0", - "License File": "LICENSE", - "Version Number": "v1.3.231", - "Owner": "mengzhaobing@huawei.com", - "Upstream URL": "https://github.com/KhronosGroup/Vulkan-Headers.git", - "Description": "Vulkan header files and API registry" - } -] diff --git a/third_party/egl/README.OpenSource b/third_party/egl/README.OpenSource deleted file mode 100644 index 4693a6581..000000000 --- a/third_party/egl/README.OpenSource +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "Name": "EGL", - "License": "MIT License", - "License File": "LICENSE", - "Version Number": "1.5", - "Owner": "lizheng2@huawei.com", - "Upstream URL": "https://github.com/KhronosGroup/EGL-Registry.git", - "Description": "EGL is an interface between Khronos rendering APIs such as OpenGL ES or OpenVG and the underlying native platform window system." - } -] diff --git a/third_party/icu4c/README.OpenSource b/third_party/icu4c/README.OpenSource deleted file mode 100644 index ec3f8592f..000000000 --- a/third_party/icu4c/README.OpenSource +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "Name": "International Components for Unicode", - "License": "ICU License, BSD 3-Clause License", - "License File": "LICENSE", - "Version Number": "72.1", - "Upstream URL": "https://github.com/unicode-org/icu/archive/release-72-1.tar.gz", - "Description": "ICU is a mature, widely used set of portable C/C++ and Java libraries for Unicode support, software internationalization and globalization (i18n/g11n). The packages are mirrors of the main website." - } -] diff --git a/third_party/libuv/README.OpenSource b/third_party/libuv/README.OpenSource deleted file mode 100644 index 5b25fcf7c..000000000 --- a/third_party/libuv/README.OpenSource +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "Name": "libuv", - "License": "MIT License", - "License File": "LICENSE", - "Version Number": "v1.48.0", - "Owner": "sunbingxin@huawei.com", - "Upstream URL": "https://github.com/libuv/libuv", - "Description": "libuv is a multi-platform support library with a focus on asynchronous I/O." - } -] diff --git a/third_party/mindspore/README.OpenSource b/third_party/mindspore/README.OpenSource deleted file mode 100644 index bd6c7775a..000000000 --- a/third_party/mindspore/README.OpenSource +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "Name": "MindSpore", - "License": "Apache License 2.0", - "License File": "LICENSE.txt", - "Version Number": "2.1.0", - "Owner": "chengfeng27@huawei.com", - "Upstream URL": "https://gitee.com/mindspore/mindspore/repository/archive/v2.1.0", - "Description": "MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios." - } -] diff --git a/third_party/musl/README.OpenSource b/third_party/musl/README.OpenSource deleted file mode 100644 index ed40042f9..000000000 --- a/third_party/musl/README.OpenSource +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "Name" : "musl", - "License" : "MIT License", - "License File" : "COPYRIGHT", - "Version Number" : "1.2.5", - "Owner" : "zhaoxinyuan9@huawei.com", - "Upstream URL" : "https://musl.libc.org", - "Description" : "musl is an MIT-licensed implementation of the standard C library" - } -] diff --git a/third_party/node/README.OpenSource b/third_party/node/README.OpenSource deleted file mode 100644 index 28991b992..000000000 --- a/third_party/node/README.OpenSource +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "Name": "node", - "License": "ISC License,Public Domain,MIT License,Free Software Foundation - MIT License,Apache License V2.0,ICU License,zlib/libpng License,BSD 2-Clause License,BSD 3-Clause License", - "License File": "LICENSE", - "Version Number": "v18.20.1", - "Owner": "sunbingxin@huawei.com", - "Upstream URL": "http://www.nodejs.org/", - "Description": "Node.js is an open-source, cross-platform, JavaScript runtime environment. It executes JavaScript code outside of a browser." - } -] diff --git a/third_party/openGLES/README.OpenSource b/third_party/openGLES/README.OpenSource deleted file mode 100644 index 82565035b..000000000 --- a/third_party/openGLES/README.OpenSource +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "Name": "openGLES", - "License": "Apache-2.0", - "License File": "NOTICE", - "Version Number": "63161d674db04a96635c6ab300db793e83f6762c", - "Owner": "lizheng2@huawei.com", - "Upstream URL": "https://github.com/KhronosGroup/OpenGL-Registry.git", - "Description": "The OpenGL ES registry contains specifications of the core API and shading language; specifications of Khronos- and vendor-approved OpenGL ES extensions; header files corresponding to the specificatio" - } -] diff --git a/third_party/openSLES/README.OpenSource b/third_party/openSLES/README.OpenSource deleted file mode 100644 index 2eda1e4fd..000000000 --- a/third_party/openSLES/README.OpenSource +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "Name": "Khronos Group - OpenSL ES", - "License": "null", - "License File": "NOTICE", - "Version Number": "1.0.1", - "Owner": "yangshuai67@huawei.com", - "Upstream URL": "https://github.com/KhronosGroup/OpenSL-ES-Registry.git", - "Description": "OpenSL ES™ is a royalty-free, cross-platform, hardware-accelerated audio API tuned for embedded systems." - } -] \ No newline at end of file diff --git a/third_party/vulkan-headers/README.OpenSource b/third_party/vulkan-headers/README.OpenSource deleted file mode 100644 index 97fefa261..000000000 --- a/third_party/vulkan-headers/README.OpenSource +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "Name": "Vulkan", - "License": "Apache-2.0", - "License File": "LICENSE", - "Version Number": "v1.3.275", - "Owner": "mengzhaobing@huawei.com", - "Upstream URL": "https://github.com/KhronosGroup/Vulkan-Headers.git", - "Description": "Vulkan header files and API registry" - } -] diff --git a/third_party/zlib/README.OpenSource b/third_party/zlib/README.OpenSource deleted file mode 100644 index e3a0accc9..000000000 --- a/third_party/zlib/README.OpenSource +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "Name" : "zlib", - "License" : "zlib/libpng License", - "License File" : "LICENSE", - "Version Number" : "v1.3.1", - "Owner" : "gongjunsong@huawei.com", - "Upstream URL" : "https://github.com/madler/zlib/archive/refs/tags/v1.3.1.tar.gz", - "Description" : "zlib 1.3.1 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files" - } -] -- Gitee From 54e92c22c8b6fbb77965a0298db712ec2c71cc7a Mon Sep 17 00:00:00 2001 From: huaxin Date: Tue, 5 Nov 2024 09:26:43 +0800 Subject: [PATCH 345/620] bugfix: compilation failed due to lack of header file dependencies Signed-off-by: huaxin Change-Id: I69c59fde006ea263211e791fd2c5ef6930826451 --- network/netmanager/include/net_connection_type.h | 1 + 1 file changed, 1 insertion(+) diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index e52b40d06..40e80760b 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -38,6 +38,7 @@ * */ +#include #include #include -- Gitee From 0735173ea5019d0f3caed1d72d73ff86ca540299 Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Wed, 6 Nov 2024 06:42:22 +0000 Subject: [PATCH 346/620] add sdk c Signed-off-by: Feng Lin --- multimedia/media_foundation/native_averrors.h | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) diff --git a/multimedia/media_foundation/native_averrors.h b/multimedia/media_foundation/native_averrors.h index edecfa2a8..546aff716 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -107,6 +107,173 @@ typedef enum OH_AVErrCode { * @since 12 */ AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION = 301, + /** + * @the address of server is incorrect, and IO can not find host. + * @since 14 + */ + AV_ERR_IO_CANNOT_FIND_HOST = 5411001, + /** + * @network connection timeout. + * @since 14 + */ + AV_ERR_IO_CONNECTION_TIMEOUT = 5411002, + /** + * @failed link due to abnormal network. + * @since 14 + */ + AV_ERR_IO_NETWORK_ABNORMAL = 5411003, + /** + * @failed link due to unavailable network. + * @since 14 + */ + AV_ERR_IO_NETWORK_UNAVAILABLE = 5411004, + /** + * @network permission dennied. + * @since 14 + */ + AV_ERR_IO_NO_PERMISSION = 5411005, + /** + * @the client request parameters are incorrect or exceed the processing capacity. + * @since 14 + */ + AV_ERR_IO_NETWORK_ACCESS_DENIED = 5411006, + /** + * @cannot find available network resources. + * @since 14 + */ + AV_ERR_IO_RESOURE_NOT_FOUND = 5411007, + /** + * @the server failS to verify the client certificate because the certificate is not carried, + * the certificate is invalid, or the certificate is expired. + * @since 14 + */ + AV_ERR_IO_SSL_CLIENT_CERT_NEEDED = 5411008, + /** + * @the client fails to verify the server certificate because the certificate is not carried, + * the certificate is invalid, or the certificate is expired. + * @since 14 + */ + AV_ERR_IO_SSL_CONNECT_FAIL = 5411009, + /** + * @IO SSL server cert untrusted. + * @since 14 + */ + AV_ERR_IO_SSL_SERVER_CERT_UNTRUSTED = 5411010, + /** + * @unsupported request due to network protocols. + * @since 14 + */ + AV_ERR_IO_UNSUPPORTTED_REQUEST = 5411011, + /** + * @file data is incorrect, and no specific data can be provided. + * @since 14 + */ + AV_ERR_IO_DATA_ABNORMAL = 5411012, + /** + * @file is occupied by other processes and cannot be accessed. + * @since 14 + */ + AV_ERR_IO_FILE_ACCESS_DENIED = 5411013, + /** + * @the file handle is incorrect. + * @since 14 + */ + AV_ERR_IO_FILE_BAD_HANDLE = 5411014, + /** + * @IO file not found. + * @since 14 + */ + AV_ERR_IO_FILE_NOT_FOUND = 5411015, + /** + * @IO file permission denied because API does not have permissions. + * @since 14 + */ + AV_ERR_IO_FILE_PERMISSION_DENIED = 5411016, + /** + * @fail to decode the audio data. + * @since 14 + */ + AV_ERR_IO_AUDIO_DEC_FAILED = 5411017, + /** + * @fail to init the audio decoder. + * @since 14 + */ + AV_ERR_IO_AUDIO_DEC_INIT_FAILED = 5411018, + /** + * @the audio decoder is unavailable for handler incurrupt, or audio decoder subsystem abnormal. + * @since 14 + */ + AV_ERR_IO_AUDIO_DEC_UNAVAILABLE = 5411019, + /** + * @audio device error. + * @since 14 + */ + AV_ERR_IO_AUDIO_DEVICE_ERROR = 5411020, + /** + * @audio device state does not support the current operation. + * @since 14 + */ + AV_ERR_IO_AUDIO_DEVICE_INVALID_STATE = 5411021, + /** + * @audio device timeout when calling audio render interface. + * @since 14 + */ + AV_ERR_IO_AUDIO_DEVICE_TIMEOUT = 5411022, + /** + * @audio device unavailable, unable to create an audio device. + * @since 14 + */ + AV_ERR_IO_AUDIO_DEVICE_UNAVAILABLE = 5411023, + /** + * @fail to encode the audio data. + * @since 14 + */ + AV_ERR_IO_AUDIO_ENC_FAILED = 5411024, + /** + * @fail to init the audio encoder. + * @since 14 + */ + AV_ERR_IO_AUDIO_ENC_INIT_FAILED = 5411025, + /** + * @audio encoder is unavailable for handler incurrupt, or audio encoder subsystem abnormal. + * @since 14 + */ + AV_ERR_IO_AUDIO_ENC_UNAVAILABLE = 5411026, + /** + * @fail to decode the video data. + * @since 14 + */ + AV_ERR_IO_VIDEO_DEC_FAILED = 5411027, + /** + * @fail to init the video decoder. + * @since 14 + */ + AV_ERR_IO_VIDEO_DEC_INIT_FAILED = 5411028, + /** + * @video decoder is unavailable for handler incurrupt, or video decoder subsystem abnormal. + * @since 14 + */ + AV_ERR_IO_VIDEO_DEC_UNAVAILABLE = 5411029, + /** + * @video device error. + * @since 14 + */ + AV_ERR_IO_VIDEO_DEVICE_ERROR = 5411030, + /** + * @fail to encode the video data. + * @since 14 + */ + AV_ERR_IO_VIDEO_ENC_FAILED = 5411031, + /** + * @fail to init the video encoder. + * @since 14 + */ + AV_ERR_IO_VIDEO_ENC_INIT_FAILED = 5411032, + /** + * @video encoder is unavailable for handler incurrupt, or video encoder subsystem abnormal. + * @since 14 + */ + AV_ERR_IO_VIDEO_ENC_UNAVAILABLE = 5411033, } OH_AVErrCode; #ifdef __cplusplus -- Gitee From 40db0c8517ebafcd5e0ecffc027ec3a08671a856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B0=B8=E5=BF=A0?= Date: Wed, 6 Nov 2024 10:42:19 +0000 Subject: [PATCH 347/620] update api MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王永忠 --- DataProtectionKit/dlp_permission_api.h | 20 ++++++++++---------- DataProtectionKit/libdlppermission.ndk.json | 12 ++++++------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/DataProtectionKit/dlp_permission_api.h b/DataProtectionKit/dlp_permission_api.h index 057c0fd32..40ec9c347 100644 --- a/DataProtectionKit/dlp_permission_api.h +++ b/DataProtectionKit/dlp_permission_api.h @@ -19,7 +19,7 @@ * * @brief Provides the capability to access the data loss prevention (DLP) files. * - * @since 13 + * @since 14 */ /** @@ -30,7 +30,7 @@ * @library libohdlp_permission.so * @kit DataProtectionKit * @syscap SystemCapability.Security.DataLossPrevention - * @since 13 + * @since 14 */ #ifndef DLP_PERMISSION_API_H @@ -46,7 +46,7 @@ extern "C" { /** * @brief Enumerates the error codes. * - * @since 13 + * @since 14 */ typedef enum { /** @error The operation is successful. */ @@ -68,7 +68,7 @@ typedef enum { /** * @brief Enumerates the access permissions for a DLP file. * - * @since 13 + * @since 14 */ typedef enum { /** No permission. */ @@ -93,7 +93,7 @@ typedef enum { * {@link DLP_ErrCode#ERR_OH_SYSTEM_SERVICE_EXCEPTION} 19100011 - If the system ability * works abnormally. * {@link DLP_ErrCode#ERR_OH_OUT_OF_MEMORY} 19100012 - If the memory error. - * @since 13 + * @since 14 */ DLP_ErrCode OH_DLP_GetDlpPermissionInfo(DLP_FileAccess *dlpFileAccess, uint32_t *flags); @@ -106,7 +106,7 @@ DLP_ErrCode OH_DLP_GetDlpPermissionInfo(DLP_FileAccess *dlpFileAccess, uint32_t * @return {@link DLP_ErrCode#ERR_OH_SUCCESS} 0 - If the operation is successful. * {@link DLP_ErrCode#ERR_OH_INVALID_PARAMS} 19100001 - If the parameter value is invalid. * {@link DLP_ErrCode#ERR_OH_OUT_OF_MEMORY} 19100012 - If the memory error. - * @since 13 + * @since 14 */ DLP_ErrCode OH_DLP_GetOriginalFileName(const char *fileName, char **originalFileName); @@ -119,7 +119,7 @@ DLP_ErrCode OH_DLP_GetOriginalFileName(const char *fileName, char **originalFile * {@link DLP_ErrCode#ERR_OH_SYSTEM_SERVICE_EXCEPTION} 19100011 - If the system ability * works abnormally. * {@link DLP_ErrCode#ERR_OH_OUT_OF_MEMORY} 19100012 - If the memory error. - * @since 13 + * @since 14 */ DLP_ErrCode OH_DLP_IsInSandbox(bool *isInSandbox); @@ -134,7 +134,7 @@ DLP_ErrCode OH_DLP_IsInSandbox(bool *isInSandbox); * {@link DLP_ErrCode#ERR_OH_SYSTEM_SERVICE_EXCEPTION} 19100011 - If the system ability * works abnormally. * {@link DLP_ErrCode#ERR_OH_APPLICATION_NOT_AUTHORIZED} 19100018 - If not authorized application. - * @since 13 + * @since 14 */ DLP_ErrCode OH_DLP_SetSandboxAppConfig(const char *configInfo); @@ -147,7 +147,7 @@ DLP_ErrCode OH_DLP_SetSandboxAppConfig(const char *configInfo); * works abnormally. * {@link DLP_ErrCode#ERR_OH_OUT_OF_MEMORY} 19100012 - If the memory error. * {@link DLP_ErrCode#ERR_OH_APPLICATION_NOT_AUTHORIZED} 19100018 - If not authorized application. - * @since 13 + * @since 14 */ DLP_ErrCode OH_DLP_GetSandboxAppConfig(char **configInfo); @@ -160,7 +160,7 @@ DLP_ErrCode OH_DLP_GetSandboxAppConfig(char **configInfo); * {@link DLP_ErrCode#ERR_OH_SYSTEM_SERVICE_EXCEPTION} 19100011 - If the system ability * works abnormally. * {@link DLP_ErrCode#ERR_OH_APPLICATION_NOT_AUTHORIZED} 19100018 - If not authorized application. - * @since 13 + * @since 14 */ DLP_ErrCode OH_DLP_CleanSandboxAppConfig(); diff --git a/DataProtectionKit/libdlppermission.ndk.json b/DataProtectionKit/libdlppermission.ndk.json index 6de2fcd87..613734f7d 100644 --- a/DataProtectionKit/libdlppermission.ndk.json +++ b/DataProtectionKit/libdlppermission.ndk.json @@ -1,26 +1,26 @@ [ { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_DLP_GetDlpPermissionInfo" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_DLP_GetOriginalFileName" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_DLP_IsInSandbox" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_DLP_SetSandboxAppConfig" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_DLP_GetSandboxAppConfig" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_DLP_CleanSandboxAppConfig" } ] \ No newline at end of file -- Gitee From 281a45dd3c72bdf7edb1df0c444bc7656d62a776 Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Wed, 6 Nov 2024 13:22:12 +0000 Subject: [PATCH 348/620] ad Signed-off-by: Feng Lin --- multimedia/player_framework/avplayer.h | 37 +++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h index ce355909a..44df386ea 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -587,7 +587,42 @@ OH_AVErrCode OH_AVPlayer_SetOnInfoCallback(OH_AVPlayer *player, OH_AVPlayerOnInf * @return Function result code. * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INVALID_VAL} if input player is null or player SetOnErrorCallback failed. - * @since 12 + * {@link AV_ERR_IO_CANNOT_FIND_HOST} if the address of server is incorrect, and IO can not find host. + * {@link AV_ERR_IO_CONNECTION_TIMEOUT} if network connection timeout. + * {@link AV_ERR_IO_NETWORK_ABNORMAL} if link failed due to abnormal network. + * {@link AV_ERR_IO_NETWORK_UNAVAILABLE} if link failed due to unavailable network. + * {@link AV_ERR_IO_NO_PERMISSION} if network permission dennied. + * {@link AV_ERR_IO_NETWORK_ACCESS_DENIED} if the client request parameters are incorrect or exceed the processing capacity. + * {@link AV_ERR_IO_RESOURE_NOT_FOUND} cannot find available network resources. + * {@link AV_ERR_IO_SSL_CLIENT_CERT_NEEDED} if the server failS to verify the client certificate because the certificate is not carried, + * the certificate is invalid, or the certificate is expired. + * {@link AV_ERR_IO_SSL_CONNECT_FAIL} if the client fails to verify the server certificate because the certificate is not carried, + * the certificate is invalid, or the certificate is expired. + * {@link AV_ERR_IO_SSL_SERVER_CERT_UNTRUSTED} if IO SSL server cert untrusted. + * {@link AV_ERR_IO_UNSUPPORTTED_REQUEST} if unsupported request due to network protocols. + * {@link AV_ERR_IO_DATA_ABNORMAL} if file data is incorrect, and no specific data can be provided. + * {@link AV_ERR_IO_FILE_ACCESS_DENIED} if file is occupied by other processes and cannot be accessed. + * {@link AV_ERR_IO_FILE_BAD_HANDLE} if the file handle is incorrect. + * {@link AV_ERR_IO_FILE_NOT_FOUND} if IO file not found. + * {@link AV_ERR_IO_FILE_PERMISSION_DENIED} if IO file permission denied because API does not have permissions. + * {@link AV_ERR_IO_AUDIO_DEC_FAILED} if player fails to decode the audio data. + * {@link AV_ERR_IO_AUDIO_DEC_INIT_FAILED} if player fail to init the audio decoder. + * {@link AV_ERR_IO_AUDIO_DEC_UNAVAILABLE} if the audio decoder is unavailable for handler incurrupt, or audio decoder subsystem abnormal. + * {@link AV_ERR_IO_AUDIO_DEVICE_ERROR} if audio device error. + * {@link AV_ERR_IO_AUDIO_DEVICE_INVALID_STATE} if audio device state does not support the current operation. + * {@link AV_ERR_IO_AUDIO_DEVICE_TIMEOUT} if audio device timeout when calling audio render interface. + * {@link AV_ERR_IO_AUDIO_DEVICE_UNAVAILABLE} if audio device unavailable, unable to create an audio device. + * {@link AV_ERR_IO_AUDIO_ENC_FAILED} if player fails to encode the audio data. + * {@link AV_ERR_IO_AUDIO_ENC_INIT_FAILED} if player fails to init the video decoder. + * {@link AV_ERR_IO_AUDIO_ENC_UNAVAILABLE} if video decoder is unavailable for handler incurrupt, or video decoder subsystem abnormal. + * {@link AV_ERR_IO_VIDEO_DEC_FAILED} if player fails to decode the video data. + * {@link AV_ERR_IO_VIDEO_DEC_INIT_FAILED} if player fails to init the video decoder. + * {@link AV_ERR_IO_VIDEO_DEC_UNAVAILABLE} if video decoder is unavailable for handler incurrupt, or video decoder subsystem abnormal. + * {@link AV_ERR_IO_VIDEO_DEVICE_ERROR} if video device error. + * {@link AV_ERR_IO_VIDEO_ENC_FAILED} if player fails to encode the video data. + * {@link AV_ERR_IO_VIDEO_ENC_INIT_FAILED} if player fails to init the video encoder. + * {@link AV_ERR_IO_VIDEO_ENC_UNAVAILABLE} if video encoder is unavailable for handler incurrupt, or video encoder subsystem abnormal. + * @since 14 */ OH_AVErrCode OH_AVPlayer_SetOnErrorCallback(OH_AVPlayer *player, OH_AVPlayerOnErrorCallback callback, void *userData); -- Gitee From 6aa9a2a3151dc7a973e2a0c8b9d6507859fccf1b Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Thu, 7 Nov 2024 02:33:15 +0000 Subject: [PATCH 349/620] ad Signed-off-by: Feng Lin --- multimedia/player_framework/avplayer.h | 37 +----------------- multimedia/player_framework/avplayer_base.h | 42 +++++++++++++++++++++ 2 files changed, 43 insertions(+), 36 deletions(-) diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h index 44df386ea..ce355909a 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -587,42 +587,7 @@ OH_AVErrCode OH_AVPlayer_SetOnInfoCallback(OH_AVPlayer *player, OH_AVPlayerOnInf * @return Function result code. * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INVALID_VAL} if input player is null or player SetOnErrorCallback failed. - * {@link AV_ERR_IO_CANNOT_FIND_HOST} if the address of server is incorrect, and IO can not find host. - * {@link AV_ERR_IO_CONNECTION_TIMEOUT} if network connection timeout. - * {@link AV_ERR_IO_NETWORK_ABNORMAL} if link failed due to abnormal network. - * {@link AV_ERR_IO_NETWORK_UNAVAILABLE} if link failed due to unavailable network. - * {@link AV_ERR_IO_NO_PERMISSION} if network permission dennied. - * {@link AV_ERR_IO_NETWORK_ACCESS_DENIED} if the client request parameters are incorrect or exceed the processing capacity. - * {@link AV_ERR_IO_RESOURE_NOT_FOUND} cannot find available network resources. - * {@link AV_ERR_IO_SSL_CLIENT_CERT_NEEDED} if the server failS to verify the client certificate because the certificate is not carried, - * the certificate is invalid, or the certificate is expired. - * {@link AV_ERR_IO_SSL_CONNECT_FAIL} if the client fails to verify the server certificate because the certificate is not carried, - * the certificate is invalid, or the certificate is expired. - * {@link AV_ERR_IO_SSL_SERVER_CERT_UNTRUSTED} if IO SSL server cert untrusted. - * {@link AV_ERR_IO_UNSUPPORTTED_REQUEST} if unsupported request due to network protocols. - * {@link AV_ERR_IO_DATA_ABNORMAL} if file data is incorrect, and no specific data can be provided. - * {@link AV_ERR_IO_FILE_ACCESS_DENIED} if file is occupied by other processes and cannot be accessed. - * {@link AV_ERR_IO_FILE_BAD_HANDLE} if the file handle is incorrect. - * {@link AV_ERR_IO_FILE_NOT_FOUND} if IO file not found. - * {@link AV_ERR_IO_FILE_PERMISSION_DENIED} if IO file permission denied because API does not have permissions. - * {@link AV_ERR_IO_AUDIO_DEC_FAILED} if player fails to decode the audio data. - * {@link AV_ERR_IO_AUDIO_DEC_INIT_FAILED} if player fail to init the audio decoder. - * {@link AV_ERR_IO_AUDIO_DEC_UNAVAILABLE} if the audio decoder is unavailable for handler incurrupt, or audio decoder subsystem abnormal. - * {@link AV_ERR_IO_AUDIO_DEVICE_ERROR} if audio device error. - * {@link AV_ERR_IO_AUDIO_DEVICE_INVALID_STATE} if audio device state does not support the current operation. - * {@link AV_ERR_IO_AUDIO_DEVICE_TIMEOUT} if audio device timeout when calling audio render interface. - * {@link AV_ERR_IO_AUDIO_DEVICE_UNAVAILABLE} if audio device unavailable, unable to create an audio device. - * {@link AV_ERR_IO_AUDIO_ENC_FAILED} if player fails to encode the audio data. - * {@link AV_ERR_IO_AUDIO_ENC_INIT_FAILED} if player fails to init the video decoder. - * {@link AV_ERR_IO_AUDIO_ENC_UNAVAILABLE} if video decoder is unavailable for handler incurrupt, or video decoder subsystem abnormal. - * {@link AV_ERR_IO_VIDEO_DEC_FAILED} if player fails to decode the video data. - * {@link AV_ERR_IO_VIDEO_DEC_INIT_FAILED} if player fails to init the video decoder. - * {@link AV_ERR_IO_VIDEO_DEC_UNAVAILABLE} if video decoder is unavailable for handler incurrupt, or video decoder subsystem abnormal. - * {@link AV_ERR_IO_VIDEO_DEVICE_ERROR} if video device error. - * {@link AV_ERR_IO_VIDEO_ENC_FAILED} if player fails to encode the video data. - * {@link AV_ERR_IO_VIDEO_ENC_INIT_FAILED} if player fails to init the video encoder. - * {@link AV_ERR_IO_VIDEO_ENC_UNAVAILABLE} if video encoder is unavailable for handler incurrupt, or video encoder subsystem abnormal. - * @since 14 + * @since 12 */ OH_AVErrCode OH_AVPlayer_SetOnErrorCallback(OH_AVPlayer *player, OH_AVPlayerOnErrorCallback callback, void *userData); diff --git a/multimedia/player_framework/avplayer_base.h b/multimedia/player_framework/avplayer_base.h index 8a3b311fc..8f85acae3 100644 --- a/multimedia/player_framework/avplayer_base.h +++ b/multimedia/player_framework/avplayer_base.h @@ -398,6 +398,48 @@ typedef void (*OH_AVPlayerOnError)(OH_AVPlayer *player, int32_t errorCode, const * @syscap SystemCapability.Multimedia.Media.AVPlayer * @param player The pointer to an OH_AVPlayer instance. * @param errorCode Error code. + * {@link AV_ERR_IO_CANNOT_FIND_HOST} if the address of server is incorrect, and IO can not find host. + * {@link AV_ERR_IO_CONNECTION_TIMEOUT} if network connection timeout. + * {@link AV_ERR_IO_NETWORK_ABNORMAL} if link failed due to abnormal network. + * {@link AV_ERR_IO_NETWORK_UNAVAILABLE} if link failed due to unavailable network. + * {@link AV_ERR_IO_NO_PERMISSION} if network permission dennied. + * {@link AV_ERR_IO_NETWORK_ACCESS_DENIED} if the client request parameters are incorrect or exceed + * the processing capacity. + * {@link AV_ERR_IO_RESOURE_NOT_FOUND} cannot find available network resources. + * {@link AV_ERR_IO_SSL_CLIENT_CERT_NEEDED} if the server failS to verify the client certificate + * because the certificate is not carried, + * the certificate is invalid, or the certificate is expired. + * {@link AV_ERR_IO_SSL_CONNECT_FAIL} if the client fails to verify the server certificate because the + * certificate is not carried, + * the certificate is invalid, or the certificate is expired. + * {@link AV_ERR_IO_SSL_SERVER_CERT_UNTRUSTED} if IO SSL server cert untrusted. + * {@link AV_ERR_IO_UNSUPPORTTED_REQUEST} if unsupported request due to network protocols. + * {@link AV_ERR_IO_DATA_ABNORMAL} if file data is incorrect, and no specific data can be provided. + * {@link AV_ERR_IO_FILE_ACCESS_DENIED} if file is occupied by other processes and cannot be accessed. + * {@link AV_ERR_IO_FILE_BAD_HANDLE} if the file handle is incorrect. + * {@link AV_ERR_IO_FILE_NOT_FOUND} if IO file not found. + * {@link AV_ERR_IO_FILE_PERMISSION_DENIED} if IO file permission denied because API does not have permissions. + * {@link AV_ERR_IO_AUDIO_DEC_FAILED} if player fails to decode the audio data. + * {@link AV_ERR_IO_AUDIO_DEC_INIT_FAILED} if player fail to init the audio decoder. + * {@link AV_ERR_IO_AUDIO_DEC_UNAVAILABLE} if the audio decoder is unavailable for handler incurrupt, + * or audio decoder subsystem abnormal. + * {@link AV_ERR_IO_AUDIO_DEVICE_ERROR} if audio device error. + * {@link AV_ERR_IO_AUDIO_DEVICE_INVALID_STATE} if audio device state does not support the current operation. + * {@link AV_ERR_IO_AUDIO_DEVICE_TIMEOUT} if audio device timeout when calling audio render interface. + * {@link AV_ERR_IO_AUDIO_DEVICE_UNAVAILABLE} if audio device unavailable, unable to create an audio device. + * {@link AV_ERR_IO_AUDIO_ENC_FAILED} if player fails to encode the audio data. + * {@link AV_ERR_IO_AUDIO_ENC_INIT_FAILED} if player fails to init the video decoder. + * {@link AV_ERR_IO_AUDIO_ENC_UNAVAILABLE} if video decoder is unavailable for handler incurrupt, + * or video decoder subsystem abnormal. + * {@link AV_ERR_IO_VIDEO_DEC_FAILED} if player fails to decode the video data. + * {@link AV_ERR_IO_VIDEO_DEC_INIT_FAILED} if player fails to init the video decoder. + * {@link AV_ERR_IO_VIDEO_DEC_UNAVAILABLE} if video decoder is unavailable for handler incurrupt, + * or video decoder subsystem abnormal. + * {@link AV_ERR_IO_VIDEO_DEVICE_ERROR} if video device error. + * {@link AV_ERR_IO_VIDEO_ENC_FAILED} if player fails to encode the video data. + * {@link AV_ERR_IO_VIDEO_ENC_INIT_FAILED} if player fails to init the video encoder. + * {@link AV_ERR_IO_VIDEO_ENC_UNAVAILABLE} if video encoder is unavailable for handler incurrupt, + * or video encoder subsystem abnormal. * @param errorMsg Error message, only valid in callback function. * @param userData Pointer to user specific data. * @since 12 -- Gitee From 479b9919058a4c081f7a514c0f83726952af3cb5 Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Thu, 7 Nov 2024 02:40:56 +0000 Subject: [PATCH 350/620] prove codecheck Signed-off-by: Feng Lin --- multimedia/player_framework/avplayer_base.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multimedia/player_framework/avplayer_base.h b/multimedia/player_framework/avplayer_base.h index 8f85acae3..d9c66ec53 100644 --- a/multimedia/player_framework/avplayer_base.h +++ b/multimedia/player_framework/avplayer_base.h @@ -418,7 +418,8 @@ typedef void (*OH_AVPlayerOnError)(OH_AVPlayer *player, int32_t errorCode, const * {@link AV_ERR_IO_FILE_ACCESS_DENIED} if file is occupied by other processes and cannot be accessed. * {@link AV_ERR_IO_FILE_BAD_HANDLE} if the file handle is incorrect. * {@link AV_ERR_IO_FILE_NOT_FOUND} if IO file not found. - * {@link AV_ERR_IO_FILE_PERMISSION_DENIED} if IO file permission denied because API does not have permissions. + * {@link AV_ERR_IO_FILE_PERMISSION_DENIED} if IO file permission denied because API does not + * have permissions. * {@link AV_ERR_IO_AUDIO_DEC_FAILED} if player fails to decode the audio data. * {@link AV_ERR_IO_AUDIO_DEC_INIT_FAILED} if player fail to init the audio decoder. * {@link AV_ERR_IO_AUDIO_DEC_UNAVAILABLE} if the audio decoder is unavailable for handler incurrupt, -- Gitee From f02768b791e6dd2b1649424af571ebb399b9b74e Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Thu, 7 Nov 2024 02:46:24 +0000 Subject: [PATCH 351/620] ad change Signed-off-by: Feng Lin --- multimedia/player_framework/avplayer_base.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/multimedia/player_framework/avplayer_base.h b/multimedia/player_framework/avplayer_base.h index d9c66ec53..02a121290 100644 --- a/multimedia/player_framework/avplayer_base.h +++ b/multimedia/player_framework/avplayer_base.h @@ -425,9 +425,10 @@ typedef void (*OH_AVPlayerOnError)(OH_AVPlayer *player, int32_t errorCode, const * {@link AV_ERR_IO_AUDIO_DEC_UNAVAILABLE} if the audio decoder is unavailable for handler incurrupt, * or audio decoder subsystem abnormal. * {@link AV_ERR_IO_AUDIO_DEVICE_ERROR} if audio device error. - * {@link AV_ERR_IO_AUDIO_DEVICE_INVALID_STATE} if audio device state does not support the current operation. + * {@link AV_ERR_IO_AUDIO_DEVICE_INVALID_STATE} if audio device state does not support current operation. * {@link AV_ERR_IO_AUDIO_DEVICE_TIMEOUT} if audio device timeout when calling audio render interface. - * {@link AV_ERR_IO_AUDIO_DEVICE_UNAVAILABLE} if audio device unavailable, unable to create an audio device. + * {@link AV_ERR_IO_AUDIO_DEVICE_UNAVAILABLE} if audio device unavailable, unable to + * create an audio device. * {@link AV_ERR_IO_AUDIO_ENC_FAILED} if player fails to encode the audio data. * {@link AV_ERR_IO_AUDIO_ENC_INIT_FAILED} if player fails to init the video decoder. * {@link AV_ERR_IO_AUDIO_ENC_UNAVAILABLE} if video decoder is unavailable for handler incurrupt, -- Gitee From b0dd1edc147cdbffe873b9b5a3903513143dbed1 Mon Sep 17 00:00:00 2001 From: zhanghongran Date: Thu, 7 Nov 2024 14:01:07 +0800 Subject: [PATCH 352/620] add VVC Profile and Level Signed-off-by: zhanghongran --- multimedia/av_codec/native_avcodec_base.h | 79 +++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 147a7268e..1dde8479d 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1015,6 +1015,45 @@ typedef enum OH_HEVCProfile { HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4, } OH_HEVCProfile; +/** + * @brief Profile: A specified subset of the syntax of VVC. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 14 + */ +typedef enum OH_VVCProfile { + /** Main 10 profile */ + VVC_PROFILE_MAIN_10 = 1, // 1 << 0 + /** Main 12 profile */ + VVC_PROFILE_MAIN_12 = 2, // 1 << 1 + /** Main 12 Intra profile */ + VVC_PROFILE_MAIN_12_INTRA = 10, // MAIN12 | INTRA + /** Multilayer Main 10 profile */ + VVC_PROFILE_MULTI_MAIN_10 = 17, // MULTILAYER | MAIN_10 + /** Main 10 4:4:4 profile */ + VVC_PROFILE_MAIN_10_444 = 33, // YUV444 | MAIN_10 + /** Main 12 4:4:4 profile */ + VVC_PROFILE_MAIN_12_444 = 34, // YUV444 | MAIN_12 + /** Main 16 4:4:4 profile */ + VVC_PROFILE_MAIN_16_444 = 36, // YUV444 | MAIN_16 + /** Main 12 4:4:4 Intra profile */ + VVC_PROFILE_MAIN_12_444_INTRA = 42, // MAIN_12_444 | INTRA + /** Main 16 4:4:4 Intra profile */ + VVC_PROFILE_MAIN_16_444_INTRA = 44, // MAIN_16_444 | INTRA + /** Multilayer Main 10 4:4:4 profile */ + VVC_PROFILE_MULTI_MAIN_10_444 = 49, // YUV444 | MAIN_10 | MULTILAYER + /** Main 10 Still Picture profile */ + VVC_PROFILE_MAIN_10_STILL = 65, // MAIN_10 | STILL_PICTURE + /** Main 12 Still Picture profile */ + VVC_PROFILE_MAIN_12_STILL = 68, // MAIN_12 | STILL_PICTURE + /** Main 10 4:4:4 Still Picture profile */ + VVC_PROFILE_MAIN_10_444_STILL = 97, // MAIN_10_444 | STILL_PICTURE + /** Main 12 4:4:4 Still Picture profile */ + VVC_PROFILE_MAIN_12_444_STILL = 98, // MAIN_12_444 | STILL_PICTURE + /** Main 16 4:4:4 Still Picture profile */ + VVC_PROFILE_MAIN_16_444_STILL = 100, // MAIN_16_444 | STILL_PICTURE +} OH_VVCProfile; + /** * @brief Enumerates the muxer output file format * @@ -1208,6 +1247,46 @@ typedef enum OH_HEVCLevel { HEVC_LEVEL_62 = 12, } OH_HEVCLevel; +/** + * @brief VVC Level: A defined set of constraints on the values that may be taken by the syntax elements and variables + * of VVC, or the value of a transform coefficient prior to scaling; code = (major_level * 16 + minor_level * 3). + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 14 + */ +typedef enum OH_VVCLevel { + /** VVC level 1.0 */ + VVC_LEVEL_1 = 16, + /** VVC level 2.0 */ + VVC_LEVEL_2 = 32, + /** VVC level 2.1 */ + VVC_LEVEL_21 = 35, + /** VVC level 3.0 */ + VVC_LEVEL_3 = 48, + /** VVC level 3.1 */ + VVC_LEVEL_31 = 51, + /** VVC level 4.0 */ + VVC_LEVEL_4 = 64, + /** VVC level 4.1 */ + VVC_LEVEL_41 = 67, + /** VVC level 5.0 */ + VVC_LEVEL_5 = 80, + /** VVC level 5.1 */ + VVC_LEVEL_51 = 83, + /** VVC level 5.2 */ + VVC_LEVEL_52 = 86, + /** VVC level 6.0 */ + VVC_LEVEL_6 = 96, + /** VVC level 6.1 */ + VVC_LEVEL_61 = 99, + /** VVC level 6.2 */ + VVC_LEVEL_62 = 102, + /** VVC level 6.3 */ + VVC_LEVEL_63 = 103, + /** VVC level 15.5 */ + VVC_LEVEL_155 = 255, +} OH_VVCLevel; + /** * @brief The reference mode in temporal group of picture. * -- Gitee From f185a886df7223b2b0fff2b525ff3587913c2655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E4=B8=80=E9=B8=A3?= Date: Tue, 29 Oct 2024 02:33:25 +0000 Subject: [PATCH 353/620] 1029 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 蔡一鸣 --- commonlibrary/memory_utils/libpurgeablemem/purgeable_memory.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commonlibrary/memory_utils/libpurgeablemem/purgeable_memory.h b/commonlibrary/memory_utils/libpurgeablemem/purgeable_memory.h index a22804434..f8510ba94 100644 --- a/commonlibrary/memory_utils/libpurgeablemem/purgeable_memory.h +++ b/commonlibrary/memory_utils/libpurgeablemem/purgeable_memory.h @@ -32,6 +32,9 @@ * provides features include create, begin read ,end read, begin write, end write, rebuild, and so on. * when using, it is necessary to link libpurgeable_memory_ndk.z.so * + * @library libpurgeablemem.so + * @syscap SystemCapability.Kernel.Memory + * @kit KernelEnhanceKit * @since 10 * @version 1.0 */ -- Gitee From 5961478627d6fb99662c460815732c5bffce9852 Mon Sep 17 00:00:00 2001 From: zhanghongran Date: Thu, 7 Nov 2024 14:59:49 +0800 Subject: [PATCH 354/620] add VVC profile and level Signed-off-by: zhanghongran --- multimedia/av_codec/native_avcodec_base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 1dde8479d..e78bd5d82 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1027,7 +1027,7 @@ typedef enum OH_VVCProfile { /** Main 12 profile */ VVC_PROFILE_MAIN_12 = 2, // 1 << 1 /** Main 12 Intra profile */ - VVC_PROFILE_MAIN_12_INTRA = 10, // MAIN12 | INTRA + VVC_PROFILE_MAIN_12_INTRA = 10, // MAIN_12 | INTRA /** Multilayer Main 10 profile */ VVC_PROFILE_MULTI_MAIN_10 = 17, // MULTILAYER | MAIN_10 /** Main 10 4:4:4 profile */ -- Gitee From f01396515100b815010f32b665fb1bc56abb2ebf Mon Sep 17 00:00:00 2001 From: zhanghongran Date: Thu, 7 Nov 2024 15:49:26 +0800 Subject: [PATCH 355/620] add profile and level Signed-off-by: zhanghongran --- multimedia/av_codec/native_avcodec_base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index e78bd5d82..592bbcf00 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1282,7 +1282,7 @@ typedef enum OH_VVCLevel { /** VVC level 6.2 */ VVC_LEVEL_62 = 102, /** VVC level 6.3 */ - VVC_LEVEL_63 = 103, + VVC_LEVEL_63 = 105, /** VVC level 15.5 */ VVC_LEVEL_155 = 255, } OH_VVCLevel; -- Gitee From 6c9b1e025dd3d1dea06ef721c25cb2f58452d12f Mon Sep 17 00:00:00 2001 From: zhanghongran Date: Thu, 7 Nov 2024 17:33:44 +0800 Subject: [PATCH 356/620] add vvc profile and level Signed-off-by: zhanghongran --- multimedia/av_codec/native_avcodec_base.h | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 592bbcf00..a4979f187 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1023,35 +1023,35 @@ typedef enum OH_HEVCProfile { */ typedef enum OH_VVCProfile { /** Main 10 profile */ - VVC_PROFILE_MAIN_10 = 1, // 1 << 0 + VVC_PROFILE_MAIN_10 = 1, /** Main 12 profile */ - VVC_PROFILE_MAIN_12 = 2, // 1 << 1 + VVC_PROFILE_MAIN_12 = 2, /** Main 12 Intra profile */ - VVC_PROFILE_MAIN_12_INTRA = 10, // MAIN_12 | INTRA + VVC_PROFILE_MAIN_12_INTRA = 10, /** Multilayer Main 10 profile */ - VVC_PROFILE_MULTI_MAIN_10 = 17, // MULTILAYER | MAIN_10 + VVC_PROFILE_MULTI_MAIN_10 = 17, /** Main 10 4:4:4 profile */ - VVC_PROFILE_MAIN_10_444 = 33, // YUV444 | MAIN_10 + VVC_PROFILE_MAIN_10_444 = 33, /** Main 12 4:4:4 profile */ - VVC_PROFILE_MAIN_12_444 = 34, // YUV444 | MAIN_12 + VVC_PROFILE_MAIN_12_444 = 34, /** Main 16 4:4:4 profile */ - VVC_PROFILE_MAIN_16_444 = 36, // YUV444 | MAIN_16 + VVC_PROFILE_MAIN_16_444 = 36, /** Main 12 4:4:4 Intra profile */ - VVC_PROFILE_MAIN_12_444_INTRA = 42, // MAIN_12_444 | INTRA + VVC_PROFILE_MAIN_12_444_INTRA = 42, /** Main 16 4:4:4 Intra profile */ - VVC_PROFILE_MAIN_16_444_INTRA = 44, // MAIN_16_444 | INTRA + VVC_PROFILE_MAIN_16_444_INTRA = 44, /** Multilayer Main 10 4:4:4 profile */ - VVC_PROFILE_MULTI_MAIN_10_444 = 49, // YUV444 | MAIN_10 | MULTILAYER + VVC_PROFILE_MULTI_MAIN_10_444 = 49, /** Main 10 Still Picture profile */ - VVC_PROFILE_MAIN_10_STILL = 65, // MAIN_10 | STILL_PICTURE + VVC_PROFILE_MAIN_10_STILL = 65, /** Main 12 Still Picture profile */ - VVC_PROFILE_MAIN_12_STILL = 68, // MAIN_12 | STILL_PICTURE + VVC_PROFILE_MAIN_12_STILL = 68, /** Main 10 4:4:4 Still Picture profile */ - VVC_PROFILE_MAIN_10_444_STILL = 97, // MAIN_10_444 | STILL_PICTURE + VVC_PROFILE_MAIN_10_444_STILL = 97, /** Main 12 4:4:4 Still Picture profile */ - VVC_PROFILE_MAIN_12_444_STILL = 98, // MAIN_12_444 | STILL_PICTURE + VVC_PROFILE_MAIN_12_444_STILL = 98, /** Main 16 4:4:4 Still Picture profile */ - VVC_PROFILE_MAIN_16_444_STILL = 100, // MAIN_16_444 | STILL_PICTURE + VVC_PROFILE_MAIN_16_444_STILL = 100, } OH_VVCProfile; /** -- Gitee From b46ad8e4834ae43c50f4e6e14422ba92e6f5d81d Mon Sep 17 00:00:00 2001 From: zhanghongran Date: Thu, 7 Nov 2024 19:07:51 +0800 Subject: [PATCH 357/620] add VVC profile and level Signed-off-by: zhanghongran --- multimedia/av_codec/native_avcodec_base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index a4979f187..414bc41f5 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1249,7 +1249,7 @@ typedef enum OH_HEVCLevel { /** * @brief VVC Level: A defined set of constraints on the values that may be taken by the syntax elements and variables - * of VVC, or the value of a transform coefficient prior to scaling; code = (major_level * 16 + minor_level * 3). + * of VVC, or the value of a transform coefficient prior to scaling. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 14 -- Gitee From 7c77bbca785239aa78dbd7951a7342abc8619a9a Mon Sep 17 00:00:00 2001 From: zhanghongran Date: Thu, 7 Nov 2024 20:14:57 +0800 Subject: [PATCH 358/620] add VVC profile and level Signed-off-by: zhanghongran --- multimedia/av_codec/native_avcodec_base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 414bc41f5..3f38e0289 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1045,7 +1045,7 @@ typedef enum OH_VVCProfile { /** Main 10 Still Picture profile */ VVC_PROFILE_MAIN_10_STILL = 65, /** Main 12 Still Picture profile */ - VVC_PROFILE_MAIN_12_STILL = 68, + VVC_PROFILE_MAIN_12_STILL = 66, /** Main 10 4:4:4 Still Picture profile */ VVC_PROFILE_MAIN_10_444_STILL = 97, /** Main 12 4:4:4 Still Picture profile */ -- Gitee From 0343168ff6524c53c5de9b4a891f5e956d1edb16 Mon Sep 17 00:00:00 2001 From: xuzhangchi Date: Fri, 8 Nov 2024 09:33:47 +0800 Subject: [PATCH 359/620] =?UTF-8?q?OH=5FMD=5FKEY=5FVIDEO=5FDECODER=5FENABL?= =?UTF-8?q?E=5FVRR=20json=20=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuzhangchi --- .../av_codec/codec_base/libnative_media_codecbase.ndk.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json index 589823ef3..bf12ff2c9 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -391,6 +391,10 @@ "first_introduced": "12", "name": "OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE" }, + { + "first_introduced": "14", + "name": "OH_MD_KEY_VIDEO_DECODER_ENABLE_VRR" + }, { "first_introduced": "10", "name": "OH_AVCodec_GetCapability" -- Gitee From 03b3cd4237c7b6e3dbd9b36f6527fb2f0369cdee Mon Sep 17 00:00:00 2001 From: hongzexuan Date: Fri, 8 Nov 2024 10:01:04 +0800 Subject: [PATCH 360/620] scroll capi supports totalsize Signed-off-by: hongzexuan Change-Id: I5d97922132674c6f836530351306b2bd86147651 --- arkui/ace_engine/native/native_node.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index d57414dcc..fa551b515 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -4512,6 +4512,19 @@ typedef enum { */ NODE_SCROLL_FADING_EDGE, + /** + * @brief Obtains the total size of all child components when fully expanded in the scrollable component. + * + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: total width of all child components when fully expanded in the scrollable component. + * The default unit is vp. \n + * .value[1].f32: total height of all child components when fully expanded in the scrollable component. + * The default unit is vp. \n + * + * @since 14 + */ + NODE_SCROLL_SIZE, + /** * @brief Defines the direction in which the list items are arranged. This attribute can be set, reset, and * obtained as required through APIs. -- Gitee From 9beaa3ae99270ad9f8856f070d731c9f30465433 Mon Sep 17 00:00:00 2001 From: w30052974 Date: Fri, 8 Nov 2024 10:47:28 +0800 Subject: [PATCH 361/620] =?UTF-8?q?API=20Lint=20=E6=95=B4=E6=94=B9=20outpu?= =?UTF-8?q?tcount=E5=8F=82=E6=95=B0=E4=B8=8D=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: w30052974 --- ai/neural_network_runtime/neural_network_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ai/neural_network_runtime/neural_network_core.h b/ai/neural_network_runtime/neural_network_core.h index f4c156a99..8d0665738 100644 --- a/ai/neural_network_runtime/neural_network_core.h +++ b/ai/neural_network_runtime/neural_network_core.h @@ -918,7 +918,7 @@ OH_NN_ReturnCode OH_NNExecutor_GetInputCount(const OH_NNExecutor *executor, size * {@link OH_NNExecutor_CreateOutputTensorDesc}. \n * * @param executor Pointer to the {@link OH_NNExecutor} instance. - * @param OutputCount Output tensor count returned. + * @param outputCount Output tensor count returned. * @return Execution result of the function. * {@link OH_NN_SUCCESS} get output count successfully. The return value is saved in outputCount.\n * {@link OH_NN_INVALID_PARAMETER} fail to get output count. The possible reason for failure is that -- Gitee From 9c3a754aec14041faaa286716f6ded1eb47df679 Mon Sep 17 00:00:00 2001 From: zhangchao Date: Fri, 8 Nov 2024 10:56:25 +0800 Subject: [PATCH 362/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9camera.ndk.json?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=AD=E6=8E=A5=E5=8F=A3=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangchao --- multimedia/camera_framework/camera.ndk.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index 3495447cf..dd8d98bbc 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -625,10 +625,10 @@ }, { "first_introduced": "13", - "name": "OH_CaptureSession_IsAutoSwitchDeviceSupported" + "name": "OH_CaptureSession_IsAutoDeviceSwitchSupported" }, { "first_introduced": "13", - "name": "OH_CaptureSession_EnableAutoSwitchDevice" + "name": "OH_CaptureSession_EnableAutoDeviceSwitch" } ] -- Gitee From bbd070335433a2a1a799535f938cedf4c511ef7d Mon Sep 17 00:00:00 2001 From: Lee <18800203378@163.com> Date: Wed, 6 Nov 2024 16:34:41 +0800 Subject: [PATCH 363/620] fix function's brief and param Signed-off-by: Lee <18800203378@163.com> --- .../include/relational_store.h | 45 ++++++++++--------- .../relational_store/libnative_rdb.ndk.json | 34 +++++++------- 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index 50ff91164..b8be9a6aa 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -160,14 +160,14 @@ typedef struct { /** * @brief Define OH_Rdb_ConfigV2 type. * - * @since 13 + * @since 14 */ typedef struct OH_Rdb_ConfigV2 OH_Rdb_ConfigV2; /** * @brief Define Rdb_DBType type. * - * @since 13 + * @since 14 */ typedef enum Rdb_DBType { /** @@ -191,7 +191,7 @@ typedef enum Rdb_DBType { * The possible cause is that the address space of the application is full, As a result, the space * cannot be allocated. * @see OH_Rdb_ConfigV2 - * @since 13 + * @since 14 */ OH_Rdb_ConfigV2 *OH_Rdb_CreateConfig(); @@ -203,7 +203,7 @@ OH_Rdb_ConfigV2 *OH_Rdb_CreateConfig(); * @return Returns the status code of the execution. Successful execution returns RDB_OK, * {@link RDB_OK} - success. * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. - * @since 13 + * @since 14 */ int OH_Rdb_DestroyConfig(OH_Rdb_ConfigV2 *config); @@ -216,7 +216,7 @@ int OH_Rdb_DestroyConfig(OH_Rdb_ConfigV2 *config); * @return Returns the status code of the execution. Successful execution returns RDB_OK, * {@link RDB_OK} - success. * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. - * @since 13 + * @since 14 */ int OH_Rdb_SetDatabaseDir(OH_Rdb_ConfigV2 *config, const char *databaseDir); @@ -229,7 +229,7 @@ int OH_Rdb_SetDatabaseDir(OH_Rdb_ConfigV2 *config, const char *databaseDir); * @return Returns the status code of the execution. Successful execution returns RDB_OK, * {@link RDB_OK} - success. * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. - * @since 13 + * @since 14 */ int OH_Rdb_SetStoreName(OH_Rdb_ConfigV2 *config, const char *storeName); @@ -242,7 +242,7 @@ int OH_Rdb_SetStoreName(OH_Rdb_ConfigV2 *config, const char *storeName); * @return Returns the status code of the execution. Successful execution returns RDB_OK, * {@link RDB_OK} - success. * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. - * @since 13 + * @since 14 */ int OH_Rdb_SetBundleName(OH_Rdb_ConfigV2 *config, const char *bundleName); @@ -255,7 +255,7 @@ int OH_Rdb_SetBundleName(OH_Rdb_ConfigV2 *config, const char *bundleName); * @return Returns the status code of the execution. Successful execution returns RDB_OK, * {@link RDB_OK} - success. * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. - * @since 13 + * @since 14 */ int OH_Rdb_SetModuleName(OH_Rdb_ConfigV2 *config, const char *moduleName); @@ -264,11 +264,11 @@ int OH_Rdb_SetModuleName(OH_Rdb_ConfigV2 *config, const char *moduleName); * * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. * Indicates the configuration of the database related to this RDB store. - * @param isEncrypt Indicates whether the database is encrypted. + * @param isEncrypted Indicates whether the database is encrypted. * @return Returns the status code of the execution. Successful execution returns RDB_OK, * {@link RDB_OK} - success. * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. - * @since 13 + * @since 14 */ int OH_Rdb_SetEncrypted(OH_Rdb_ConfigV2 *config, bool isEncrypted); @@ -281,7 +281,7 @@ int OH_Rdb_SetEncrypted(OH_Rdb_ConfigV2 *config, bool isEncrypted); * @return Returns the status code of the execution. Successful execution returns RDB_OK, * {@link RDB_OK} - success. * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. - * @since 13 + * @since 14 */ int OH_Rdb_SetSecurityLevel(OH_Rdb_ConfigV2 *config, int securityLevel); @@ -290,10 +290,11 @@ int OH_Rdb_SetSecurityLevel(OH_Rdb_ConfigV2 *config, int securityLevel); * * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. * Indicates the configuration of the database related to this RDB store + * @param area Represents the security area of the database. * @return Returns the status code of the execution. Successful execution returns RDB_OK, * {@link RDB_OK} - success. * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. - * @since 13 + * @since 14 */ int OH_Rdb_SetArea(OH_Rdb_ConfigV2 *config, int area); @@ -305,15 +306,15 @@ int OH_Rdb_SetArea(OH_Rdb_ConfigV2 *config, int area); * {@link RDB_OK} - success. * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. * {@link RDB_E_NOT_SUPPORTED} - The error code for not support db types. - * @since 13 + * @since 14 */ int OH_Rdb_SetDbType(OH_Rdb_ConfigV2 *config, int dbType); /** * @brief Get support db type list - * @param numType The output parameter, which is used to recieve the length of the support db type array. + * @param typeCount The output parameter, which is used to recieve the length of the support db type array. * @return Return Rdb_DBType array contains supported db type, array length is number of support type - * @since 13 + * @since 14 */ const int *OH_Rdb_GetSupportedDbType(int *typeCount); @@ -380,7 +381,7 @@ OH_Rdb_Store *OH_Rdb_GetOrOpen(const OH_Rdb_Config *config, int *errCode); * If the Config is empty, config.size does not match, or errCode is empty. * Get database path failed.Get RDB Store fail. Nullptr is returned. * @see OH_Rdb_ConfigV2, OH_Rdb_Store. - * @since 13 + * @since 14 */ OH_Rdb_Store *OH_Rdb_CreateOrOpen(const OH_Rdb_ConfigV2 *config, int *errCode); @@ -421,7 +422,7 @@ int OH_Rdb_DeleteStore(const OH_Rdb_Config *config); * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. * while failure returns a specific error code. Specific error codes can be referenced {@link OH_Rdb_ErrCode}. * @see OH_Rdb_ErrCode. - * @since 13 + * @since 14 */ int OH_Rdb_DeleteStoreV2(const OH_Rdb_ConfigV2 *config); @@ -503,14 +504,14 @@ int OH_Rdb_Execute(OH_Rdb_Store *store, const char *sql); * @brief Write operations are performed using the specified transaction represented by the transaction ID * * @param store Represents a pointer to an {@link OH_Rdb_Store} instance. - * @param sql Indicates the SQL statement to execute. * @param trxId The transaction ID of the specified transaction, must be greater than 0 + * @param sql Indicates the SQL statement to execute. * @return Returns the status code of the execution. * {@link RDB_OK} - success. * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. * {@link RDB_E_NOT_SUPPORTED} - The error code for not supprt. * @see OH_Rdb_Store. - * @since 13 + * @since 14 */ int OH_Rdb_ExecuteByTrxId(OH_Rdb_Store *store, int64_t trxId, const char *sql); @@ -572,7 +573,7 @@ int OH_Rdb_Commit(OH_Rdb_Store *store); * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. * {@link RDB_E_NOT_SUPPORTED} - The error code for not supprt. * @see OH_Rdb_Store. - * @since 13 + * @since 14 */ int OH_Rdb_BeginTransWithTrxId(OH_Rdb_Store *store, int64_t *trxId); @@ -586,7 +587,7 @@ int OH_Rdb_BeginTransWithTrxId(OH_Rdb_Store *store, int64_t *trxId); * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. * {@link RDB_E_NOT_SUPPORTED} - The error code for not supprt. * @see OH_Rdb_Store. - * @since 13 + * @since 14 */ int OH_Rdb_RollBackByTrxId(OH_Rdb_Store *store, int64_t trxId); @@ -600,7 +601,7 @@ int OH_Rdb_RollBackByTrxId(OH_Rdb_Store *store, int64_t trxId); * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. * {@link RDB_E_NOT_SUPPORTED} - The error code for not supprt. * @see OH_Rdb_Store. - * @since 13 + * @since 14 */ int OH_Rdb_CommitByTrxId(OH_Rdb_Store *store, int64_t trxId); diff --git a/distributeddatamgr/relational_store/libnative_rdb.ndk.json b/distributeddatamgr/relational_store/libnative_rdb.ndk.json index 4d72ebe84..5e0681865 100644 --- a/distributeddatamgr/relational_store/libnative_rdb.ndk.json +++ b/distributeddatamgr/relational_store/libnative_rdb.ndk.json @@ -3,58 +3,58 @@ {"name":"OH_Rdb_CreateValueObject" }, {"name":"OH_Rdb_CreateValuesBucket" }, { - "first_introduced":"13", + "first_introduced":"14", "name":"OH_Rdb_CreateConfig" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_SetDatabaseDir" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_SetStoreName" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_SetBundleName" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_SetModuleName" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_SetEncrypted" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_SetSecurityLevel" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_SetArea" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_SetDbType" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_GetSupportedDbType" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_DestroyConfig" }, {"name":"OH_Rdb_GetOrOpen" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_CreateOrOpen" }, {"name":"OH_Rdb_CloseStore" }, {"name":"OH_Rdb_DeleteStore" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_DeleteStoreV2" }, {"name":"OH_Rdb_Insert" }, @@ -63,7 +63,7 @@ {"name":"OH_Rdb_Query" }, {"name":"OH_Rdb_Execute" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_ExecuteByTrxId" }, {"name":"OH_Rdb_ExecuteQuery" }, @@ -71,15 +71,15 @@ {"name":"OH_Rdb_RollBack" }, {"name":"OH_Rdb_Commit" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_BeginTransWithTrxId" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_RollBackByTrxId" }, { - "first_introduced": "13", + "first_introduced": "14", "name":"OH_Rdb_CommitByTrxId" }, {"name":"OH_Rdb_Backup" }, -- Gitee From c012a044fd475b9697695bb7ee51111c66653958 Mon Sep 17 00:00:00 2001 From: shaoyuanzhao Date: Fri, 8 Nov 2024 15:51:57 +0800 Subject: [PATCH 364/620] fix errorcode Signed-off-by: blc --- .../include/inputmethod_inputmethod_proxy_capi.h | 12 ++++++------ inputmethod/include/inputmethod_types_capi.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h index c0ae0a12c..f8257c2b6 100644 --- a/inputmethod/include/inputmethod_inputmethod_proxy_capi.h +++ b/inputmethod/include/inputmethod_inputmethod_proxy_capi.h @@ -60,7 +60,7 @@ typedef struct InputMethod_InputMethodProxy InputMethod_InputMethodProxy; * {@link IME_ERR_OK} - success. * {@link IME_ERR_IMCLIENT} - input method client error. * {@link IME_ERR_IMMS} - input method manager service error. - * {@link IME_ERR_DETACHED} - input method client is detached. + * {@link IME_ERR_DETACHED} - input method client detached. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 12 @@ -76,7 +76,7 @@ InputMethod_ErrorCode OH_InputMethodProxy_ShowKeyboard(InputMethod_InputMethodPr * {@link IME_ERR_OK} - success. * {@link IME_ERR_IMCLIENT} - input method client error. * {@link IME_ERR_IMMS} - input method manager service error. - * {@link IME_ERR_DETACHED} - input method client is detached. + * {@link IME_ERR_DETACHED} - input method client detached. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 12 @@ -99,7 +99,7 @@ InputMethod_ErrorCode OH_InputMethodProxy_HideKeyboard(InputMethod_InputMethodPr * {@link IME_ERR_PARAMCHECK} - parameter check failed. * {@link IME_ERR_IMCLIENT} - input method client error. * {@link IME_ERR_IMMS} - input method manager service error. - * {@link IME_ERR_DETACHED} - input method client is detached. + * {@link IME_ERR_DETACHED} - input method client detached. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 12 @@ -119,7 +119,7 @@ InputMethod_ErrorCode OH_InputMethodProxy_NotifySelectionChange( * {@link IME_ERR_PARAMCHECK} - parameter check failed. * {@link IME_ERR_IMCLIENT} - input method client error. * {@link IME_ERR_IMMS} - input method manager service error. - * {@link IME_ERR_DETACHED} - input method client is detached. + * {@link IME_ERR_DETACHED} - input method client detached. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 12 @@ -139,7 +139,7 @@ InputMethod_ErrorCode OH_InputMethodProxy_NotifyConfigurationChange(InputMethod_ * {@link IME_ERR_PARAMCHECK} - parameter check failed. * {@link IME_ERR_IMCLIENT} - input method client error. * {@link IME_ERR_IMMS} - input method manager service error. - * {@link IME_ERR_DETACHED} - input method client is detached. + * {@link IME_ERR_DETACHED} - input method client detached. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 12 @@ -159,7 +159,7 @@ InputMethod_ErrorCode OH_InputMethodProxy_NotifyCursorUpdate( * {@link IME_ERR_PARAMCHECK} - parameter check failed. * {@link IME_ERR_IMCLIENT} - input method client error. * {@link IME_ERR_IMMS} - input method manager service error. - * {@link IME_ERR_DETACHED} - input method client is detached. + * {@link IME_ERR_DETACHED} - input method client detached. * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. * Specific error codes can be referenced {@link InputMethod_ErrorCode}. * @since 12 diff --git a/inputmethod/include/inputmethod_types_capi.h b/inputmethod/include/inputmethod_types_capi.h index 2e1481335..0fc88c455 100644 --- a/inputmethod/include/inputmethod_types_capi.h +++ b/inputmethod/include/inputmethod_types_capi.h @@ -261,7 +261,7 @@ typedef enum InputMethod_ErrorCode { */ IME_ERR_PARAMCHECK = 401, /** - * @error The error code when the package manager error. + * @error The error code when the bundle manager error. */ IME_ERR_PACKAGEMANAGER = 12800001, /** @@ -273,7 +273,7 @@ typedef enum InputMethod_ErrorCode { */ IME_ERR_IMCLIENT = 12800003, /** - * @error The error code when configuration persisting error. + * @error The error code when configuration persistence error. */ IME_ERR_CONFIG_PERSIST = 12800005, /** @@ -289,7 +289,7 @@ typedef enum InputMethod_ErrorCode { */ IME_ERR_IMMS = 12800008, /** - * @error The error code when input method client is detached. + * @error The error code when input method client detached. */ IME_ERR_DETACHED = 12800009, /** -- Gitee From b9bb37b31c7d153f15162aeec043947607a120cb Mon Sep 17 00:00:00 2001 From: xzcbob Date: Fri, 8 Nov 2024 09:01:54 +0000 Subject: [PATCH 365/620] update multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json. Signed-off-by: xzcbob --- .../av_codec/codec_base/libnative_media_codecbase.ndk.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json index bf12ff2c9..715c18d86 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -393,7 +393,7 @@ }, { "first_introduced": "14", - "name": "OH_MD_KEY_VIDEO_DECODER_ENABLE_VRR" + "name": "OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR" }, { "first_introduced": "10", -- Gitee From dc7476f91e98e5468f82d200d1399ad8f3c6955b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E6=97=AD?= Date: Sat, 9 Nov 2024 02:23:21 +0000 Subject: [PATCH 366/620] =?UTF-8?q?api=E5=8F=98=E6=9B=B4sdk-c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 郭旭 --- .../kits/c/input/oh_input_manager.h | 36 +++++++++---------- multimodalinput/kits/c/ohinput.ndk.json | 28 +++++++-------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 0a2b5b471..f187532bf 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -231,7 +231,7 @@ typedef struct Input_AxisEvent Input_AxisEvent; /** * @brief Defines the hot key structure. * - * @since 13 + * @since 14 */ typedef struct Input_Hotkey Input_Hotkey; @@ -255,19 +255,19 @@ typedef enum Input_Result { INPUT_REPEAT_INTERCEPTOR = 4200001, /** * @error Already occupied by the system - * @since 13 + * @since 14 */ INPUT_OCCUPIED_BY_SYSTEM = 4200002, /** * @error Already occupied by the other - * @since 13 + * @since 14 */ INPUT_OCCUPIED_BY_OTHER = 4200003, } Input_Result; /** * @brief Callback used to return shortcut key events. - * @since 13 + * @since 14 */ typedef void (*Input_HotkeyCallback)(Input_Hotkey* hotkey); @@ -1285,7 +1285,7 @@ Input_Result OH_Input_RemoveInputEventInterceptor(void); * {@Link INPUT_SERVICE_EXCEPTION} Failed to get the interval because the service is exception.\n * {@Link INPUT_PARAMETER_ERROR} The timeInterval is NULL.\n * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Result OH_Input_GetIntervalSinceLastInput(int64_t *timeInterval); @@ -1295,7 +1295,7 @@ Input_Result OH_Input_GetIntervalSinceLastInput(int64_t *timeInterval); * @return Returns an {@Link Input_Hotkey} pointer object if the operation is successful. Otherwise, a null pointer is * returned. The possible cause is memory allocation failure. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Hotkey *OH_Input_CreateHotkey(void); @@ -1304,7 +1304,7 @@ Input_Hotkey *OH_Input_CreateHotkey(void); * * @param hotkey Hot key object. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ void OH_Input_DestroyHotkey(Input_Hotkey **hotkey); @@ -1315,7 +1315,7 @@ void OH_Input_DestroyHotkey(Input_Hotkey **hotkey); * @param preKeys List of modifier keys. * @param size Number of modifier keys. One or two modifier keys are supported. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ void OH_Input_SetPreKeys(Input_Hotkey *hotkey, int32_t *preKeys, int32_t size); @@ -1330,7 +1330,7 @@ void OH_Input_SetPreKeys(Input_Hotkey *hotkey, int32_t *preKeys, int32_t size); * {@link INPUT_PARAMETER_ERROR} The hotkey is NULL or the pressedKeys is NULL or the pressedKeyCount * is NULL.\n * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Result OH_Input_GetPreKeys(const Input_Hotkey *hotkey, int32_t **preKeys, int32_t *preKeyCount); @@ -1340,7 +1340,7 @@ Input_Result OH_Input_GetPreKeys(const Input_Hotkey *hotkey, int32_t **preKeys, * @param hotkey Hotkey key object. * @param finalKey Modified key. Only one modified key is supported. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ void OH_Input_SetFinalKey(Input_Hotkey *hotkey, int32_t finalKey); @@ -1353,7 +1353,7 @@ void OH_Input_SetFinalKey(Input_Hotkey *hotkey, int32_t finalKey); * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} The hotkey is NULL or the finalKeyCode is NULL.\n * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Result OH_Input_GetFinalKey(const Input_Hotkey *hotkey, int32_t *finalKeyCode); @@ -1366,7 +1366,7 @@ Input_Result OH_Input_GetFinalKey(const Input_Hotkey *hotkey, int32_t *finalKeyC * operation fails, a null pointer is returned. The possible cause is memory allocation failure or count is not equal * to the number of system hotkeys. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Hotkey **OH_Input_CreateAllSystemHotkeys(int32_t count); @@ -1377,7 +1377,7 @@ Input_Hotkey **OH_Input_CreateAllSystemHotkeys(int32_t count); * {@Link OH_Input_CreateAllSystemHotkeys} method. * @param count Count of the array to be destroyed, which must be the same as the number of system shortcut keys. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ void OH_Input_DestroyAllSystemHotkeys(Input_Hotkey **hotkeys, int32_t count); @@ -1392,7 +1392,7 @@ void OH_Input_DestroyAllSystemHotkeys(Input_Hotkey **hotkeys, int32_t count); * {@link INPUT_PARAMETER_ERROR} The hotkey or count is NULL, or the value of count does not match the number * of system shortcut keys supported by the system. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Result OH_Input_GetAllSystemHotkeys(Input_Hotkey **hotkey, int32_t *count); @@ -1403,7 +1403,7 @@ Input_Result OH_Input_GetAllSystemHotkeys(Input_Hotkey **hotkey, int32_t *count) * @param isRepeat Whether to report repeated key events. * The value true means to report repeated key events, and the value false means the opposite. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ void OH_Input_SetRepeat(Input_Hotkey* hotkey, bool isRepeat); @@ -1416,7 +1416,7 @@ void OH_Input_SetRepeat(Input_Hotkey* hotkey, bool isRepeat); * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} otherwise.\n * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Result OH_Input_GetRepeat(const Input_Hotkey* hotkey, bool *isRepeat); @@ -1432,7 +1432,7 @@ Input_Result OH_Input_GetRepeat(const Input_Hotkey* hotkey, bool *isRepeat); * GetAllSystemHotkeys} interface to query all system shortcut keys.\n * {@Link INPUT_OCCUPIED_BY_OTHER} The hotkey has been subscribed to by another.\n * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Result OH_Input_AddHotkeyMonitor(const Input_Hotkey* hotkey, Input_HotkeyCallback callback); @@ -1445,7 +1445,7 @@ Input_Result OH_Input_AddHotkeyMonitor(const Input_Hotkey* hotkey, Input_HotkeyC * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} if hotkey or callback is NULL;\n * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Result OH_Input_RemoveHotkeyMonitor(const Input_Hotkey* hotkey, Input_HotkeyCallback callback); diff --git a/multimodalinput/kits/c/ohinput.ndk.json b/multimodalinput/kits/c/ohinput.ndk.json index 0a906be71..35791ebb5 100644 --- a/multimodalinput/kits/c/ohinput.ndk.json +++ b/multimodalinput/kits/c/ohinput.ndk.json @@ -316,59 +316,59 @@ "name": "OH_Input_RemoveInputEventInterceptor" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_GetIntervalSinceLastInput" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_CreateAllSystemHotkeys" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_DestroyAllSystemHotkeys" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_GetAllSystemHotkeys" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_CreateHotkey" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_DestroyHotkey" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_SetPreKeys" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_GetPreKeys" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_SetFinalKey" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_GetFinalKey" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_AddHotkeyMonitor" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_RemoveHotkeyMonitor" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_SetRepeat" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_GetRepeat" }, { -- Gitee From 844f7aa53ebebd7e68d7a4af7398dc8dee632b28 Mon Sep 17 00:00:00 2001 From: z30053788 Date: Sat, 9 Nov 2024 16:30:05 +0800 Subject: [PATCH 367/620] update Signed-off-by: z30053788 Change-Id: I17f78f854d58b4d048379a0647b2505d734c6cac --- BasicServicesKit/commonevent/oh_commonevent.h | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/BasicServicesKit/commonevent/oh_commonevent.h b/BasicServicesKit/commonevent/oh_commonevent.h index 44c679926..bfe5c1235 100644 --- a/BasicServicesKit/commonevent/oh_commonevent.h +++ b/BasicServicesKit/commonevent/oh_commonevent.h @@ -244,7 +244,7 @@ const CommonEvent_Parameters* OH_CommonEvent_GetParametersFromRcvData(const Comm /** * @brief Check whether the parameters contains a key. * - * @param rcvData Indicates the event of callback data. + * @param para Indicates the event of callback data. * @param key Indicates the key of parameter. * @return Returns the result of check, true means it contains. * @since 12 @@ -254,7 +254,7 @@ bool OH_CommonEvent_HasKeyInParameters(const CommonEvent_Parameters* para, const /** * @brief Get int data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param defaultValue Indicates default return value. * @return Returns the int data of the key in the parameters. @@ -265,7 +265,7 @@ int OH_CommonEvent_GetIntFromParameters(const CommonEvent_Parameters* para, cons /** * @brief Get int array data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param array Indicates the int array. * @return Returns the length of the array. @@ -276,7 +276,7 @@ int32_t OH_CommonEvent_GetIntArrayFromParameters(const CommonEvent_Parameters* p /** * @brief Get long data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param defaultValue Indicates default return value. * @return Returns the long data of the key in the parameters. @@ -287,7 +287,7 @@ long OH_CommonEvent_GetLongFromParameters(const CommonEvent_Parameters* para, co /** * @brief Get long array data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param array Indicates the long array. * @return Returns the length of the array. @@ -298,7 +298,7 @@ int32_t OH_CommonEvent_GetLongArrayFromParameters(const CommonEvent_Parameters* /** * @brief Get bool data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param defaultValue Indicates default return value. * @return Returns the bool data of the key in the parameters. @@ -309,7 +309,7 @@ bool OH_CommonEvent_GetBoolFromParameters(const CommonEvent_Parameters* para, co /** * @brief Get bool array data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param array Indicates the bool array. * @return Returns the length of the array. @@ -320,7 +320,7 @@ int32_t OH_CommonEvent_GetBoolArrayFromParameters(const CommonEvent_Parameters* /** * @brief Get char data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param defaultValue Indicates default return value. * @return Returns the char data of the key in the parameters. @@ -331,7 +331,7 @@ char OH_CommonEvent_GetCharFromParameters(const CommonEvent_Parameters* para, co /** * @brief Get char array data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param array Indicates the char array. * @return Returns the length of the array. @@ -342,7 +342,7 @@ int32_t OH_CommonEvent_GetCharArrayFromParameters(const CommonEvent_Parameters* /** * @brief Get double data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param defaultValue Indicates default return value. * @return Returns the double data of the key in the parameters. @@ -354,7 +354,7 @@ double OH_CommonEvent_GetDoubleFromParameters(const CommonEvent_Parameters* para /** * @brief Get double array data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param array Indicates the double array. * @return Returns the length of the array, default is 0. -- Gitee From 2a1976778b7bfd166174a0bc3e77fdcd65e3ed8d Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Mon, 11 Nov 2024 02:04:41 +0000 Subject: [PATCH 368/620] ad Signed-off-by: Feng Lin --- multimedia/player_framework/avplayer_base.h | 44 --------------------- 1 file changed, 44 deletions(-) diff --git a/multimedia/player_framework/avplayer_base.h b/multimedia/player_framework/avplayer_base.h index 02a121290..8a3b311fc 100644 --- a/multimedia/player_framework/avplayer_base.h +++ b/multimedia/player_framework/avplayer_base.h @@ -398,50 +398,6 @@ typedef void (*OH_AVPlayerOnError)(OH_AVPlayer *player, int32_t errorCode, const * @syscap SystemCapability.Multimedia.Media.AVPlayer * @param player The pointer to an OH_AVPlayer instance. * @param errorCode Error code. - * {@link AV_ERR_IO_CANNOT_FIND_HOST} if the address of server is incorrect, and IO can not find host. - * {@link AV_ERR_IO_CONNECTION_TIMEOUT} if network connection timeout. - * {@link AV_ERR_IO_NETWORK_ABNORMAL} if link failed due to abnormal network. - * {@link AV_ERR_IO_NETWORK_UNAVAILABLE} if link failed due to unavailable network. - * {@link AV_ERR_IO_NO_PERMISSION} if network permission dennied. - * {@link AV_ERR_IO_NETWORK_ACCESS_DENIED} if the client request parameters are incorrect or exceed - * the processing capacity. - * {@link AV_ERR_IO_RESOURE_NOT_FOUND} cannot find available network resources. - * {@link AV_ERR_IO_SSL_CLIENT_CERT_NEEDED} if the server failS to verify the client certificate - * because the certificate is not carried, - * the certificate is invalid, or the certificate is expired. - * {@link AV_ERR_IO_SSL_CONNECT_FAIL} if the client fails to verify the server certificate because the - * certificate is not carried, - * the certificate is invalid, or the certificate is expired. - * {@link AV_ERR_IO_SSL_SERVER_CERT_UNTRUSTED} if IO SSL server cert untrusted. - * {@link AV_ERR_IO_UNSUPPORTTED_REQUEST} if unsupported request due to network protocols. - * {@link AV_ERR_IO_DATA_ABNORMAL} if file data is incorrect, and no specific data can be provided. - * {@link AV_ERR_IO_FILE_ACCESS_DENIED} if file is occupied by other processes and cannot be accessed. - * {@link AV_ERR_IO_FILE_BAD_HANDLE} if the file handle is incorrect. - * {@link AV_ERR_IO_FILE_NOT_FOUND} if IO file not found. - * {@link AV_ERR_IO_FILE_PERMISSION_DENIED} if IO file permission denied because API does not - * have permissions. - * {@link AV_ERR_IO_AUDIO_DEC_FAILED} if player fails to decode the audio data. - * {@link AV_ERR_IO_AUDIO_DEC_INIT_FAILED} if player fail to init the audio decoder. - * {@link AV_ERR_IO_AUDIO_DEC_UNAVAILABLE} if the audio decoder is unavailable for handler incurrupt, - * or audio decoder subsystem abnormal. - * {@link AV_ERR_IO_AUDIO_DEVICE_ERROR} if audio device error. - * {@link AV_ERR_IO_AUDIO_DEVICE_INVALID_STATE} if audio device state does not support current operation. - * {@link AV_ERR_IO_AUDIO_DEVICE_TIMEOUT} if audio device timeout when calling audio render interface. - * {@link AV_ERR_IO_AUDIO_DEVICE_UNAVAILABLE} if audio device unavailable, unable to - * create an audio device. - * {@link AV_ERR_IO_AUDIO_ENC_FAILED} if player fails to encode the audio data. - * {@link AV_ERR_IO_AUDIO_ENC_INIT_FAILED} if player fails to init the video decoder. - * {@link AV_ERR_IO_AUDIO_ENC_UNAVAILABLE} if video decoder is unavailable for handler incurrupt, - * or video decoder subsystem abnormal. - * {@link AV_ERR_IO_VIDEO_DEC_FAILED} if player fails to decode the video data. - * {@link AV_ERR_IO_VIDEO_DEC_INIT_FAILED} if player fails to init the video decoder. - * {@link AV_ERR_IO_VIDEO_DEC_UNAVAILABLE} if video decoder is unavailable for handler incurrupt, - * or video decoder subsystem abnormal. - * {@link AV_ERR_IO_VIDEO_DEVICE_ERROR} if video device error. - * {@link AV_ERR_IO_VIDEO_ENC_FAILED} if player fails to encode the video data. - * {@link AV_ERR_IO_VIDEO_ENC_INIT_FAILED} if player fails to init the video encoder. - * {@link AV_ERR_IO_VIDEO_ENC_UNAVAILABLE} if video encoder is unavailable for handler incurrupt, - * or video encoder subsystem abnormal. * @param errorMsg Error message, only valid in callback function. * @param userData Pointer to user specific data. * @since 12 -- Gitee From 9983a759fa592b8b2440db4096e5c6075170d1a2 Mon Sep 17 00:00:00 2001 From: cuiruibin Date: Sat, 9 Nov 2024 09:50:13 +0800 Subject: [PATCH 369/620] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cuiruibin --- filemanagement/file_uri/include/oh_file_uri.h | 15 +++++++++++++-- filemanagement/fileshare/include/oh_file_share.h | 13 +++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/filemanagement/file_uri/include/oh_file_uri.h b/filemanagement/file_uri/include/oh_file_uri.h index adf9f0fa3..dde24336d 100644 --- a/filemanagement/file_uri/include/oh_file_uri.h +++ b/filemanagement/file_uri/include/oh_file_uri.h @@ -13,8 +13,15 @@ * limitations under the License. */ -#ifndef FILE_MANAGEMENT_OH_FILE_URI_H -#define FILE_MANAGEMENT_OH_FILE_URI_H +/** + * @addtogroup fileUri + * @{ + * + * @brief This module provides URI format validation and URI conversion processing, + * as well as obtaining URI-related information + * + * @since 12 + */ /** * @file oh_file_uri.h @@ -30,6 +37,9 @@ * @since 12 */ +#ifndef FILE_MANAGEMENT_OH_FILE_URI_H +#define FILE_MANAGEMENT_OH_FILE_URI_H + #include "error_code.h" #include #include @@ -116,4 +126,5 @@ FileManagement_ErrCode OH_FileUri_GetFileName(const char *uri, unsigned int leng #ifdef __cplusplus }; #endif +/** @} */ #endif // FILE_MANAGEMENT_OH_FILE_URI_H diff --git a/filemanagement/fileshare/include/oh_file_share.h b/filemanagement/fileshare/include/oh_file_share.h index e89d335f5..fc89f08ed 100644 --- a/filemanagement/fileshare/include/oh_file_share.h +++ b/filemanagement/fileshare/include/oh_file_share.h @@ -13,12 +13,6 @@ * limitations under the License. */ -#ifndef FILE_MANAGEMENT_OH_FILE_SHARE_H -#define FILE_MANAGEMENT_OH_FILE_SHARE_H - -#include "error_code.h" -#include - /** * @addtogroup fileShare * @{ @@ -38,6 +32,13 @@ * @syscap SystemCapability.FileManagement.AppFileService.FolderAuthorization * @since 12 */ + +#ifndef FILE_MANAGEMENT_OH_FILE_SHARE_H +#define FILE_MANAGEMENT_OH_FILE_SHARE_H + +#include "error_code.h" +#include + #ifdef __cplusplus extern "C" { #endif -- Gitee From 573796b0048f14aba5e144c2afb30cc8e11f2303 Mon Sep 17 00:00:00 2001 From: liangqi Date: Fri, 8 Nov 2024 11:21:53 +0800 Subject: [PATCH 370/620] standardize rectification Signed-off-by: liangqi --- drivers/external_device_manager/base/ddk_api.h | 5 +++-- drivers/external_device_manager/base/ddk_types.h | 5 +++-- drivers/external_device_manager/hid/hid_ddk_api.h | 9 ++++++--- drivers/external_device_manager/hid/hid_ddk_types.h | 7 +++++-- drivers/external_device_manager/usb/usb_ddk_api.h | 8 ++++++-- drivers/external_device_manager/usb/usb_ddk_types.h | 8 ++++++-- 6 files changed, 29 insertions(+), 13 deletions(-) diff --git a/drivers/external_device_manager/base/ddk_api.h b/drivers/external_device_manager/base/ddk_api.h index 41d69c7b6..b5eb3005b 100644 --- a/drivers/external_device_manager/base/ddk_api.h +++ b/drivers/external_device_manager/base/ddk_api.h @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef DDK_API_H -#define DDK_API_H /** * @addtogroup Ddk @@ -36,6 +34,9 @@ * @since 12 */ +#ifndef DDK_API_H +#define DDK_API_H + #include #include "ddk_types.h" diff --git a/drivers/external_device_manager/base/ddk_types.h b/drivers/external_device_manager/base/ddk_types.h index e9e352c87..b13651367 100644 --- a/drivers/external_device_manager/base/ddk_types.h +++ b/drivers/external_device_manager/base/ddk_types.h @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef DDK_TYPES_H -#define DDK_TYPES_H /** * @addtogroup Ddk @@ -36,6 +34,9 @@ * @since 12 */ +#ifndef DDK_TYPES_H +#define DDK_TYPES_H + #include #include diff --git a/drivers/external_device_manager/hid/hid_ddk_api.h b/drivers/external_device_manager/hid/hid_ddk_api.h index b5d535a10..ac9336efd 100644 --- a/drivers/external_device_manager/hid/hid_ddk_api.h +++ b/drivers/external_device_manager/hid/hid_ddk_api.h @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef HID_DDK_API_H -#define HID_DDK_API_H /** * @addtogroup HidDdk @@ -32,11 +30,16 @@ * @brief Declares the HID DDK interfaces for the host to access an input device. * * @kit DriverDevelopmentKit + * @library libhid.z.so + * @syscap SystemCapability.Driver.HID.Extension * File to include: * @since 11 * @version 1.0 */ +#ifndef HID_DDK_API_H +#define HID_DDK_API_H + #include #include "hid_ddk_types.h" @@ -100,7 +103,7 @@ int32_t OH_Hid_EmitEvent(int32_t deviceId, const Hid_EmitItem items[], uint16_t * @version 1.0 */ int32_t OH_Hid_DestroyDevice(int32_t deviceId); - +/** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/drivers/external_device_manager/hid/hid_ddk_types.h b/drivers/external_device_manager/hid/hid_ddk_types.h index 4feaf5f55..1029fbb12 100644 --- a/drivers/external_device_manager/hid/hid_ddk_types.h +++ b/drivers/external_device_manager/hid/hid_ddk_types.h @@ -13,8 +13,6 @@ * limitations under the License. */ -#ifndef HID_DDK_TYPES_H -#define HID_DDK_TYPES_H /** * @addtogroup HidDdk * @{ @@ -33,10 +31,15 @@ * @brief Provides definitions of enum variables and structs in the HID DDK. * * File to include: + * @library libhid.z.so + * @syscap SystemCapability.Driver.HID.Extension * @since 11 * @version 1.0 */ +#ifndef HID_DDK_TYPES_H +#define HID_DDK_TYPES_H + #include #ifdef __cplusplus diff --git a/drivers/external_device_manager/usb/usb_ddk_api.h b/drivers/external_device_manager/usb/usb_ddk_api.h index d43aa52d7..90ff08e69 100644 --- a/drivers/external_device_manager/usb/usb_ddk_api.h +++ b/drivers/external_device_manager/usb/usb_ddk_api.h @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef USB_DDK_API_H -#define USB_DDK_API_H /** * @addtogroup UsbDdk @@ -33,10 +31,16 @@ * * @brief Declares the USB DDK APIs used by the USB host to access USB devices. * + * @kit DriverDevelopmentKit + * @library libusb_ndk.z.so + * @syscap SystemCapability.Driver.USB.Extension * @since 10 * @version 1.0 */ +#ifndef USB_DDK_API_H +#define USB_DDK_API_H + #include #include "ddk_types.h" diff --git a/drivers/external_device_manager/usb/usb_ddk_types.h b/drivers/external_device_manager/usb/usb_ddk_types.h index 6385308af..602baba11 100644 --- a/drivers/external_device_manager/usb/usb_ddk_types.h +++ b/drivers/external_device_manager/usb/usb_ddk_types.h @@ -13,8 +13,6 @@ * limitations under the License. */ -#ifndef USB_DDK_TYPES_H -#define USB_DDK_TYPES_H /** * @addtogroup UsbDdk * @{ @@ -33,10 +31,16 @@ * * @brief Provides the enumerated variables, structures, and macros used in USB DDK APIs. * + * @kit DriverDevelopmentKit + * @library libusb_ndk.z.so + * @syscap SystemCapability.Driver.USB.Extension * @since 10 * @version 1.0 */ +#ifndef USB_DDK_TYPES_H +#define USB_DDK_TYPES_H + #include #include -- Gitee From 4bd17d65c51dd3d1ba8662fcd14e7c4dccd88c63 Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Mon, 11 Nov 2024 02:36:11 +0000 Subject: [PATCH 371/620] ad Signed-off-by: Feng Lin --- multimedia/media_foundation/native_averrors.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/media_foundation/native_averrors.h b/multimedia/media_foundation/native_averrors.h index 546aff716..727f2eea3 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -141,7 +141,7 @@ typedef enum OH_AVErrCode { * @cannot find available network resources. * @since 14 */ - AV_ERR_IO_RESOURE_NOT_FOUND = 5411007, + AV_ERR_IO_RESOURCE_NOT_FOUND = 5411007, /** * @the server failS to verify the client certificate because the certificate is not carried, * the certificate is invalid, or the certificate is expired. @@ -163,7 +163,7 @@ typedef enum OH_AVErrCode { * @unsupported request due to network protocols. * @since 14 */ - AV_ERR_IO_UNSUPPORTTED_REQUEST = 5411011, + AV_ERR_IO_UNSUPPORTED_REQUEST = 5411011, /** * @file data is incorrect, and no specific data can be provided. * @since 14 -- Gitee From 67955f50ca127970f538b5b52369504faa317834 Mon Sep 17 00:00:00 2001 From: xxb-wzy Date: Mon, 11 Nov 2024 11:37:27 +0800 Subject: [PATCH 372/620] Signed-off-by: xxb-wzy Change-Id: Ia858cc4e59e5c126d3e388e97a4e14b75831e328 --- graphic/graphic_2d/native_vsync/native_vsync.h | 1 + 1 file changed, 1 insertion(+) diff --git a/graphic/graphic_2d/native_vsync/native_vsync.h b/graphic/graphic_2d/native_vsync/native_vsync.h index 791fbfd36..bb77a0108 100644 --- a/graphic/graphic_2d/native_vsync/native_vsync.h +++ b/graphic/graphic_2d/native_vsync/native_vsync.h @@ -127,6 +127,7 @@ int OH_NativeVSync_GetPeriod(OH_NativeVSync* nativeVsync, long long* period); * after the animation frame associated with the previous VSync is complete. In addition, the self-drawing frames must * carry timestamps that align with VSync. * After the animation ends, disable DVSync. + * Only phones and tablets support DVSync. * On a platform that does not support DVSync or if another application has enabled DVSync, the attempt to enable it * will not take effect, and the application still receives normal VSync signals. * -- Gitee From 903642507abdd74ebfedd2fa3a8431fbed2a284a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=BD=E8=BF=90=E7=90=86?= Date: Mon, 11 Nov 2024 11:51:45 +0800 Subject: [PATCH 373/620] =?UTF-8?q?fix=20warning=20in=20comment=20Signed-o?= =?UTF-8?q?ff-by:=20=E6=96=BD=E8=BF=90=E7=90=86=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BasicServicesKit/os_account.h | 7 ++++--- BasicServicesKit/os_account_common.h | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/BasicServicesKit/os_account.h b/BasicServicesKit/os_account.h index a93a32b4b..2a90d0cfd 100644 --- a/BasicServicesKit/os_account.h +++ b/BasicServicesKit/os_account.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OS_ACCOUNT_H -#define OS_ACCOUNT_H - /** * @addtogroup OsAccount * @{ @@ -23,6 +20,7 @@ * @brief Provide the definition of the C interface for the native OsAccount. * @since 12 */ + /** * @file os_account.h * @@ -33,6 +31,9 @@ * @since 12 */ +#ifndef OS_ACCOUNT_H +#define OS_ACCOUNT_H + #include #include "os_account_common.h" diff --git a/BasicServicesKit/os_account_common.h b/BasicServicesKit/os_account_common.h index 932b398c5..334ad730b 100644 --- a/BasicServicesKit/os_account_common.h +++ b/BasicServicesKit/os_account_common.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OS_ACCOUNT_COMMON_H -#define OS_ACCOUNT_COMMON_H - /** * @addtogroup OsAccount * @{ @@ -23,6 +20,7 @@ * @brief Provide the definition of the C interface for the native OsAccount. * @since 12 */ + /** * @file os_account_common.h * @@ -33,6 +31,9 @@ * @since 12 */ +#ifndef OS_ACCOUNT_COMMON_H +#define OS_ACCOUNT_COMMON_H + #ifdef __cplusplus extern "C" { #endif -- Gitee From 8bfa6a7a1c44bb34b1fee4df9720fae735506414 Mon Sep 17 00:00:00 2001 From: Cai Xincheng Date: Mon, 11 Nov 2024 16:02:21 +0800 Subject: [PATCH 374/620] asset api lint Signed-off-by: Cai Xincheng Change-Id: Ibcdadb18e9eb07318aeb3dab975732a6465b5a9f --- security/asset/inc/asset_api.h | 16 ++++++++-------- security/asset/inc/asset_type.h | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/security/asset/inc/asset_api.h b/security/asset/inc/asset_api.h index 794a04e02..cda927aac 100755 --- a/security/asset/inc/asset_api.h +++ b/security/asset/inc/asset_api.h @@ -13,14 +13,6 @@ * limitations under the License. */ -#ifndef ASSET_API_H -#define ASSET_API_H - -#include -#include - -#include "asset_type.h" - /** * @addtogroup AssetApi * @{ @@ -44,6 +36,14 @@ * @since 11 */ +#ifndef ASSET_API_H +#define ASSET_API_H + +#include +#include + +#include "asset_type.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/security/asset/inc/asset_type.h b/security/asset/inc/asset_type.h index 8d64e56d5..4eea24c7c 100755 --- a/security/asset/inc/asset_type.h +++ b/security/asset/inc/asset_type.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef ASSET_TYPE_H -#define ASSET_TYPE_H - /** * @addtogroup AssetType * @{ @@ -36,6 +33,9 @@ * @since 11 */ +#ifndef ASSET_TYPE_H +#define ASSET_TYPE_H + #include #include -- Gitee From 7cf96e803f6e8199671eb522d904b998ed904591 Mon Sep 17 00:00:00 2001 From: yangxuguang-huawei Date: Mon, 11 Nov 2024 16:04:15 +0800 Subject: [PATCH 375/620] fix: api lint Signed-off-by: yangxuguang-huawei Change-Id: Ia60c1cecfb6fbb4794246d3d8c94134109162a00 --- .../child_process/native_child_process.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ability/ability_runtime/child_process/native_child_process.h b/ability/ability_runtime/child_process/native_child_process.h index af736450b..a60cca635 100644 --- a/ability/ability_runtime/child_process/native_child_process.h +++ b/ability/ability_runtime/child_process/native_child_process.h @@ -13,11 +13,6 @@ * limitations under the License. */ -#ifndef OHOS_ABILITY_RUNTIME_C_NATIVE_CHILD_PROCESS_H -#define OHOS_ABILITY_RUNTIME_C_NATIVE_CHILD_PROCESS_H - -#include "IPCKit/ipc_cparcel.h" - /** * @addtogroup ChildProcess * @{ @@ -40,6 +35,11 @@ * @since 12 */ +#ifndef OHOS_ABILITY_RUNTIME_C_NATIVE_CHILD_PROCESS_H +#define OHOS_ABILITY_RUNTIME_C_NATIVE_CHILD_PROCESS_H + +#include "IPCKit/ipc_cparcel.h" + #ifdef __cplusplus extern "C" { #endif -- Gitee From 307f50f3014a481b8656007880a5cec9e89a5e22 Mon Sep 17 00:00:00 2001 From: lwx1281857 Date: Mon, 11 Nov 2024 16:41:14 +0800 Subject: [PATCH 376/620] Description:Code optimization Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: lwx1281857 --- startup/init/syscap/include/deviceinfo.h | 19 +++++++++++++++++++ startup/init/syscap/include/syscap_ndk.h | 19 +++++++++++++++++++ startup/init/syscap/init_sync.h | 20 +++++++++++++++++++- 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/startup/init/syscap/include/deviceinfo.h b/startup/init/syscap/include/deviceinfo.h index 955759bfb..0725cd540 100644 --- a/startup/init/syscap/include/deviceinfo.h +++ b/startup/init/syscap/include/deviceinfo.h @@ -16,6 +16,24 @@ #ifndef DEVICEINFO_CSDK_H #define DEVICEINFO_CSDK_H +/** + * @addtogroup DeviceInfo + * @{ + * + * @brief Provides APIs for querying terminal device information. + * + * @since 10 + */ + +/** + * @file deviceinfo.h + * @kit BasicServicesKit + * @brief Declares APIs for querying terminal device information. + * @library libdeviceinfo_ndk.z.so + * @syscap SystemCapability.Startup.SystemInfo + * @since 10 + */ + #ifdef __cplusplus #if __cplusplus extern "C" { @@ -227,4 +245,5 @@ const char *OH_GetDistributionOSReleaseType(void); } #endif #endif +/** @} */ #endif diff --git a/startup/init/syscap/include/syscap_ndk.h b/startup/init/syscap/include/syscap_ndk.h index 070a6cb1e..d821c3a35 100644 --- a/startup/init/syscap/include/syscap_ndk.h +++ b/startup/init/syscap/include/syscap_ndk.h @@ -16,6 +16,24 @@ #ifndef SYSCAP_NDK_H #define SYSCAP_NDK_H +/** + * @addtogroup SyscapNdk + * @{ + * + * @brief Provides APIs for querying system capabilities. + * + * @since 10 + */ + +/** + * @file deviceinfo.h + * @kit BasicServicesKit + * @brief Declares APIs for acquiring the set of system capabilities . + * @library na + * @syscap SystemCapability.Startup.SystemInfo + * @since 10 + */ + #include #ifdef __cplusplus @@ -31,4 +49,5 @@ bool canIUse(const char *cap); } #endif #endif +/** @} */ #endif \ No newline at end of file diff --git a/startup/init/syscap/init_sync.h b/startup/init/syscap/init_sync.h index ceeefbce3..ca4836b27 100644 --- a/startup/init/syscap/init_sync.h +++ b/startup/init/syscap/init_sync.h @@ -16,6 +16,24 @@ #ifndef BASE_STARTUP_INITLITE_NOTIFY_H #define BASE_STARTUP_INITLITE_NOTIFY_H +/** + * @addtogroup InitSync + * @{ + * + * @brief Provides APIs for notifying the Init process of events. + * + * @since 10 + */ + +/** + * @file init_sync.h + * @kit BasicServicesKit + * @brief Declares APIs for notifying events to the Init process. + * @library na + * @syscap SystemCapability.Startup.SystemInfo + * @since 10 + */ + #ifdef __cplusplus #if __cplusplus extern "C" { @@ -45,5 +63,5 @@ extern int NotifyInit(unsigned long event); } #endif #endif - +/** @} */ #endif // BASE_STARTUP_INITLITE_NOTIFY_H -- Gitee From ce584c9a1da7b4223c36e0456403b530433c5c57 Mon Sep 17 00:00:00 2001 From: lcc Date: Mon, 11 Nov 2024 16:55:19 +0800 Subject: [PATCH 377/620] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lcc --- CryptoArchitectureKit/crypto_signature.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CryptoArchitectureKit/crypto_signature.h b/CryptoArchitectureKit/crypto_signature.h index 63d46299a..321b3f833 100644 --- a/CryptoArchitectureKit/crypto_signature.h +++ b/CryptoArchitectureKit/crypto_signature.h @@ -75,7 +75,7 @@ typedef struct OH_CryptoVerify OH_CryptoVerify; * @brief Create a verify context according to the given algorithm name. * * @param algoName Indicates the algorithm name for generating the verify context. Example RSA1024|PKCS1|SHA256. - * @param ctx Indicates the pointer to the verify context. + * @param verify Indicates the pointer to the verify context. * @return {@link OH_Crypto_ErrCode#CRYPTO_SUCCESS} 0 - If the operation is successful. * {@link OH_Crypto_ErrCode#CRYPTO_INVALID_PARAMS} 401 - If parameter is invalid. * {@link OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED} 801 - If the operation is not supported. -- Gitee From f607ea1dffdb0e4f7a2c103026f222bdec051b98 Mon Sep 17 00:00:00 2001 From: gonghongyu Date: Mon, 11 Nov 2024 21:03:04 +0800 Subject: [PATCH 378/620] =?UTF-8?q?NativeDisplaySoloist=20API=20Lint=20?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gonghongyu --- .../native_display_soloist/native_display_soloist.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/graphic/graphic_2d/native_display_soloist/native_display_soloist.h b/graphic/graphic_2d/native_display_soloist/native_display_soloist.h index abbda4fde..8f3b9dca0 100644 --- a/graphic/graphic_2d/native_display_soloist/native_display_soloist.h +++ b/graphic/graphic_2d/native_display_soloist/native_display_soloist.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_NATIVE_DISPLAY_SOLOIST_H_ -#define C_INCLUDE_NATIVE_DISPLAY_SOLOIST_H_ - /** * @addtogroup NativeDisplaySoloist * @{ @@ -38,6 +35,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_NATIVE_DISPLAY_SOLOIST_H_ +#define C_INCLUDE_NATIVE_DISPLAY_SOLOIST_H_ + #include #include #ifdef __cplusplus -- Gitee From 15067984421879ec20519ae77596379e171177d8 Mon Sep 17 00:00:00 2001 From: wangxiuxiu96 Date: Thu, 7 Nov 2024 10:04:25 +0800 Subject: [PATCH 379/620] key event support capi Signed-off-by: wangxiuxiu96 Change-Id: I2aa53bf46076e489800c8f5ec80ed8ab1139584b --- arkui/ace_engine/native/BUILD.gn | 1 + arkui/ace_engine/native/libace.ndk.json | 48 ++ arkui/ace_engine/native/native_key_event.h | 535 +++++++++++++++++++++ arkui/ace_engine/native/native_node.h | 25 + 4 files changed, 609 insertions(+) create mode 100644 arkui/ace_engine/native/native_key_event.h diff --git a/arkui/ace_engine/native/BUILD.gn b/arkui/ace_engine/native/BUILD.gn index 99ad7f778..f8f7ff274 100644 --- a/arkui/ace_engine/native/BUILD.gn +++ b/arkui/ace_engine/native/BUILD.gn @@ -33,6 +33,7 @@ if (!is_arkui_x) { "native_gesture.h", "native_interface.h", "native_interface_accessibility.h", + "native_key_event.h", "native_node.h", "native_node_napi.h", "native_type.h", diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 197833444..96208e941 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2386,5 +2386,53 @@ { "first_introduced": "14", "name": "OH_NativeXComponent_RegisterKeyEventCallbackWithResult" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_KeyEvent_GetType" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_KeyEvent_GetKeyCode" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_KeyEvent_GetKeyText" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_KeyEvent_GetKeySource" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_KeyEvent_GetDeviceId" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_KeyEvent_GetMetaKey" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_KeyEvent_GetTimestamp" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_KeyEvent_StopPropagation" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_KeyEvent_GetModifierKeyState" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_KeyEvent_GetKeyIntensionCode" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_KeyEvent_GetUnicode" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_KeyEvent_SetConsumed" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_key_event.h b/arkui/ace_engine/native/native_key_event.h new file mode 100644 index 000000000..0ab0303a1 --- /dev/null +++ b/arkui/ace_engine/native/native_key_event.h @@ -0,0 +1,535 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup ArkUI_NativeModule + * @{ + * + * @brief Provides the general key event APIs of ArkUI on the native side. + * + * @since 14 + */ + +/** + * @file native_key_event.h + * + * @brief Declares the APIs related to native key events. + * + * @library libace_ndk.z.so + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @kit ArkUI + * @since 14 + */ + +#ifndef ARKUI_NATIVE_KEY_EVENT_H +#define ARKUI_NATIVE_KEY_EVENT_H + +#include + +#include "native_type.h" +#include "ui_input_event.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Defines an enum for the key codes in key events. + * + * @since 14 + */ +typedef enum { + /** Unknown (or unrecognized) key **/ + ARKUI_KEYCODE_UNKNOWN = -1, + /** Function (Fn) key **/ + ARKUI_KEYCODE_FN = 0, + /** Volume Up key **/ + ARKUI_KEYCODE_VOLUME_UP = 16, + /** Volume Down key **/ + ARKUI_KEYCODE_VOLUME_DOWN = 17, + /** Power key **/ + ARKUI_KEYCODE_POWER = 18, + /** Shutter key **/ + ARKUI_KEYCODE_CAMERA = 19, + /** Speaker Mute key **/ + ARKUI_KEYCODE_VOLUME_MUTE = 22, + /** Mute key **/ + ARKUI_KEYCODE_MUTE = 23, + /** Brightness Up key **/ + ARKUI_KEYCODE_BRIGHTNESS_UP = 40, + /** Brightness Down key **/ + ARKUI_KEYCODE_BRIGHTNESS_DOWN = 41, + /** Key 0 **/ + ARKUI_KEYCODE_0 = 2000, + /** Key 1 **/ + ARKUI_KEYCODE_1 = 2001, + /** Key 2 **/ + ARKUI_KEYCODE_2 = 2002, + /** Key 3 **/ + ARKUI_KEYCODE_3 = 2003, + /** Key 4 **/ + ARKUI_KEYCODE_4 = 2004, + /** Key 5 **/ + ARKUI_KEYCODE_5 = 2005, + /** Key 6 **/ + ARKUI_KEYCODE_6 = 2006, + /** Key 7 **/ + ARKUI_KEYCODE_7 = 2007, + /** Key 8 **/ + ARKUI_KEYCODE_8 = 2008, + /** Key 9 **/ + ARKUI_KEYCODE_9 = 2009, + /** Key + **/ + ARKUI_KEYCODE_STAR = 2010, + /** Key # **/ + ARKUI_KEYCODE_POUND = 2011, + /** Up key on D-pad **/ + ARKUI_KEYCODE_DPAD_UP = 2012, + /** Down key on D-pad **/ + ARKUI_KEYCODE_DPAD_DOWN = 2013, + /** Left key on D-pad **/ + ARKUI_KEYCODE_DPAD_LEFT = 2014, + /** Right key on D-pad **/ + ARKUI_KEYCODE_DPAD_RIGHT = 2015, + /** OK key on D-pad **/ + ARKUI_KEYCODE_DPAD_CENTER = 2016, + /** Key A **/ + ARKUI_KEYCODE_A = 2017, + /** Key B **/ + ARKUI_KEYCODE_B = 2018, + /** Key C **/ + ARKUI_KEYCODE_C = 2019, + /** Key D **/ + ARKUI_KEYCODE_D = 2020, + /** Key E **/ + ARKUI_KEYCODE_E = 2021, + /** Key F **/ + ARKUI_KEYCODE_F = 2022, + /** Key G **/ + ARKUI_KEYCODE_G = 2023, + /** Key H **/ + ARKUI_KEYCODE_H = 2024, + /** Key I **/ + ARKUI_KEYCODE_I = 2025, + /** Key J **/ + ARKUI_KEYCODE_J = 2026, + /** Key K **/ + ARKUI_KEYCODE_K = 2027, + /** Key L **/ + ARKUI_KEYCODE_L = 2028, + /** Key M **/ + ARKUI_KEYCODE_M = 2029, + /** Key N **/ + ARKUI_KEYCODE_N = 2030, + /** Key O **/ + ARKUI_KEYCODE_O = 2031, + /** Key P **/ + ARKUI_KEYCODE_P = 2032, + /** Key R **/ + ARKUI_KEYCODE_Q = 2033, + /** Key R **/ + ARKUI_KEYCODE_R = 2034, + /** Key S **/ + ARKUI_KEYCODE_S = 2035, + /** Key T **/ + ARKUI_KEYCODE_T = 2036, + /** Key U **/ + ARKUI_KEYCODE_U = 2037, + /** Key V **/ + ARKUI_KEYCODE_V = 2038, + /** Key W **/ + ARKUI_KEYCODE_W = 2039, + /** Key X **/ + ARKUI_KEYCODE_X = 2040, + /** Key Y **/ + ARKUI_KEYCODE_Y = 2041, + /** Key Z **/ + ARKUI_KEYCODE_Z = 2042, + /** Key # **/ + ARKUI_KEYCODE_COMMA = 2043, + /** Key # **/ + ARKUI_KEYCODE_PERIOD = 2044, + /** Left Alt key **/ + ARKUI_KEYCODE_ALT_LEFT = 2045, + /** Right Alt key **/ + ARKUI_KEYCODE_ALT_RIGHT = 2046, + /** Left Shift key **/ + ARKUI_KEYCODE_SHIFT_LEFT = 2047, + /** Right Shift key **/ + ARKUI_KEYCODE_SHIFT_RIGHT = 2048, + /** Tab key **/ + ARKUI_KEYCODE_TAB = 2049, + /** Space key **/ + ARKUI_KEYCODE_SPACE = 2050, + /** Symbol key **/ + ARKUI_KEYCODE_SYM = 2051, + /** Explorer key, used to start the explorer application **/ + ARKUI_KEYCODE_EXPLORER = 2052, + /** Email key, used to start the email application **/ + ARKUI_KEYCODE_ENVELOPE = 2053, + /** Enter key **/ + ARKUI_KEYCODE_ENTER = 2054, + /** Backspace key **/ + ARKUI_KEYCODE_DEL = 2055, + /** Key ` **/ + ARKUI_KEYCODE_GRAVE = 2056, + /** Key - **/ + ARKUI_KEYCODE_MINUS = 2057, + /** Key = **/ + ARKUI_KEYCODE_EQUALS = 2058, + /** Key [ **/ + ARKUI_KEYCODE_LEFT_BRACKET = 2059, + /** Key ]**/ + ARKUI_KEYCODE_RIGHT_BRACKET = 2060, + /** Key \\ **/ + ARKUI_KEYCODE_BACKSLASH = 2061, + /** Key ; **/ + ARKUI_KEYCODE_SEMICOLON = 2062, + /** Key ' **/ + ARKUI_KEYCODE_APOSTROPHE = 2063, + /** Key / **/ + ARKUI_KEYCODE_SLASH = 2064, + /** Key @ **/ + ARKUI_KEYCODE_AT = 2065, + /** Key + **/ + ARKUI_KEYCODE_PLUS = 2066, + /** Menu key **/ + ARKUI_KEYCODE_MENU = 2067, + /** Page Up key **/ + ARKUI_KEYCODE_PAGE_UP = 2068, + /** Page Down key **/ + ARKUI_KEYCODE_PAGE_DOWN = 2069, + /** ESC key **/ + ARKUI_KEYCODE_ESCAPE = 2070, + /** Delete key **/ + ARKUI_KEYCODE_FORWARD_DEL = 2071, + /** Left Ctrl key **/ + ARKUI_KEYCODE_CTRL_LEFT = 2072, + /** Right Ctrl key **/ + ARKUI_KEYCODE_CTRL_RIGHT = 2073, + /** Caps Lock key **/ + ARKUI_KEYCODE_CAPS_LOCK = 2074, + /** Scroll Lock key **/ + ARKUI_KEYCODE_SCROLL_LOCK = 2075, + /** Left Meta key **/ + ARKUI_KEYCODE_META_LEFT = 2076, + /** Right Meta key **/ + ARKUI_KEYCODE_META_RIGHT = 2077, + /** Function key **/ + ARKUI_KEYCODE_FUNCTION = 2078, + /** System Request/Print Screen key **/ + ARKUI_KEYCODE_SYSRQ = 2079, + /** Break/Pause key **/ + ARKUI_KEYCODE_BREAK = 2080, + /** Move to Home key **/ + ARKUI_KEYCODE_MOVE_HOME = 2081, + /** Move to End key **/ + ARKUI_KEYCODE_MOVE_END = 2082, + /** Insert key **/ + ARKUI_KEYCODE_INSERT = 2083, + /** Forward key **/ + ARKUI_KEYCODE_FORWARD = 2084, + /** Play key **/ + ARKUI_KEYCODE_MEDIA_PLAY = 2085, + /** Pause key **/ + ARKUI_KEYCODE_MEDIA_PAUSE = 2086, + /** Close key **/ + ARKUI_KEYCODE_MEDIA_CLOSE = 2087, + /** Eject key **/ + ARKUI_KEYCODE_MEDIA_EJECT = 2088, + /** Record key **/ + ARKUI_KEYCODE_MEDIA_RECORD = 2089, + /** F1 key **/ + ARKUI_KEYCODE_F1 = 2090, + /** F2 key **/ + ARKUI_KEYCODE_F2 = 2091, + /** F3 key **/ + ARKUI_KEYCODE_F3 = 2092, + /** F4 key **/ + ARKUI_KEYCODE_F4 = 2093, + /** F5 key **/ + ARKUI_KEYCODE_F5 = 2094, + /** F6 key **/ + ARKUI_KEYCODE_F6 = 2095, + /** F7 key **/ + ARKUI_KEYCODE_F7 = 2096, + /** F8 key **/ + ARKUI_KEYCODE_F8 = 2097, + /** F9 key **/ + ARKUI_KEYCODE_F9 = 2098, + /** F10 key **/ + ARKUI_KEYCODE_F10 = 2099, + /** F11 key **/ + ARKUI_KEYCODE_F11 = 2100, + /** F12 key **/ + ARKUI_KEYCODE_F12 = 2101, + /** Number Lock key on numeric keypad **/ + ARKUI_KEYCODE_NUM_LOCK = 2102, + /** Key 0 on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_0 = 2103, + /** Key 1 on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_1 = 2104, + /** Key 2 on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_2 = 2105, + /** Key 3 on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_3 = 2106, + /** Key 4 on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_4 = 2107, + /** Key 5 on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_5 = 2108, + /** Key 6 on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_6 = 2109, + /** Key 7 on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_7 = 2110, + /** Key 8 on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_8 = 2111, + /** Key 9 on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_9 = 2112, + /** Key / on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_DIVIDE = 2113, + /** Key ) on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_MULTIPLY = 2114, + /** Key - on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_SUBTRACT = 2115, + /** Key + on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_ADD = 2116, + /** Key . on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_DOT = 2117, + /** Key , on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_COMMA = 2118, + /** Enter key on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_ENTER = 2119, + /** Key = on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_EQUALS = 2120, + /** Key ( on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_LEFT_PAREN = 2121, + /** Key ) on numeric keypad **/ + ARKUI_KEYCODE_NUMPAD_RIGHT_PAREN = 2122, +} ArkUI_KeyCode; + +/** + * @brief Defines an enum for the key event types. + * + * @since 14 + */ +typedef enum { + /** Unknown type **/ + ARKUI_KEY_EVENT_UNKNOWN = -1, + /** Pressing of a key **/ + ARKUI_KEY_EVENT_DOWN = 0, + /** Release of a key **/ + ARKUI_KEY_EVENT_UP = 1, + /** Long press of a key **/ + ARKUI_KEY_EVENT_LONG_PRESS = 2, + /** Click of a key **/ + ARKUI_KEY_EVENT_CLICK = 3, +} ArkUI_KeyEventType; + +/** + * @brief Defines an enum for the types of devices that trigger a key event. + * + * @since 14 + */ +typedef enum { + /** Unknown type **/ + ARKUI_KEY_SOURCE_UNKNOWN = 0, + /** Mouse **/ + ARKUI_KEY_SOURCE_TYPE_MOUSE = 1, + /** Keyboard **/ + ARKUI_KEY_SOURCE_TYPE_KEYBOARD = 4, +} ArkUI_KeySourceType; + +/** + * @brief Defines an enum for key intentions. + * + * @since 14 + */ +typedef enum { + /** Unknown intention **/ + ARKUI_KEY_INTENSION_UNKNOWN = -1, + /**Upward**/ + ARKUI_KEY_INTENSION_UP = 1, + /** Downward **/ + ARKUI_KEY_INTENSION_DOWN = 2, + /** Leftward **/ + ARKUI_KEY_INTENSION_LEFT = 3, + /** Rightward **/ + ARKUI_KEY_INTENSION_RIGHT = 4, + /** Select **/ + ARKUI_KEY_INTENSION_SELECT = 5, + /** Escape **/ + ARKUI_KEY_INTENSION_ESCAPE = 6, + /** Back**/ + ARKUI_KEY_INTENSION_BACK = 7, + /** Forward **/ + ARKUI_KEY_INTENSION_FORWARD = 8, + /** Menu **/ + ARKUI_KEY_INTENSION_MENU = 9, + /** Home **/ + ARKUI_KEY_INTENSION_HOME = 10, + /** Page up **/ + ARKUI_KEY_INTENSION_PAGE_UP = 11, + /** Page down **/ + ARKUI_KEY_INTENSION_PAGE_DOWN = 12, + /** Zoom out **/ + ARKUI_KEY_INTENSION_ZOOM_OUT = 13, + /** Zoom in **/ + ARKUI_KEY_INTENSION_ZOOM_IN = 14, + + /** Play or pause **/ + ARKUI_KEY_INTENTION_MEDIA_PLAY_PAUSE = 100, + /** Fast-forward **/ + ARKUI_KEY_INTENTION_MEDIA_FAST_FORWARD = 101, + /** Fast playback **/ + ARKUI_KEY_INTENTION_MEDIA_FAST_PLAYBACK = 103, + /** Play next **/ + ARKUI_KEY_INTENTION_MEDIA_NEXT = 104, + /** Play previous **/ + ARKUI_KEY_INTENTION_MEDIA_PREVIOUS = 105, + /** Mute **/ + ARKUI_KEY_INTENTION_MEDIA_MUTE = 106, + /** Volume up **/ + ARKUI_KEY_INTENTION_VOLUME_UP = 107, + /** Volume down **/ + ARKUI_KEY_INTENTION_VOLUME_DOWN = 108, + + /** Answer a call **/ + ARKUI_KEY_INTENTION_CALL = 200, + /** Camera **/ + ARKUI_KEY_INTENTION_CAMERA = 300, +} ArkUI_KeyIntension; + +/** + * @brief Obtains the type of a key event. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @return Returns the key event type. + * @since 14 + */ +ArkUI_KeyEventType OH_ArkUI_KeyEvent_GetType(const ArkUI_UIInputEvent* event); + +/** + * @brief Obtains the key code from a key event. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @return Returns the key code. + * @since 14 + */ +int32_t OH_ArkUI_KeyEvent_GetKeyCode(const ArkUI_UIInputEvent* event); + +/** + * @brief Obtains the key value from a key event. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @return Returns the key value. + * @since 14 + */ +const char *OH_ArkUI_KeyEvent_GetKeyText(const ArkUI_UIInputEvent* event); + +/** + * @brief Obtains the type of device that triggers a key event. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @return Returns the device type. + * @since 14 + */ +ArkUI_KeySourceType OH_ArkUI_KeyEvent_GetKeySource(const ArkUI_UIInputEvent* event); + +/** + * @brief Obtains the ID of device that triggers a key event. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @return Returns the device ID. + * @since 14 + */ +int32_t OH_ArkUI_KeyEvent_GetDeviceId(const ArkUI_UIInputEvent* event); + +/** + * @brief Obtains the state of the meta key (that is, the WIN key on the Windows keyboard or the Command + * key on the Mac keyboard) when a key event occurs. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @return Returns the state of the meta key. The value 1 means that the key is pressed, and 0 means the + * opposite. + * @since 14 + */ +int32_t OH_ArkUI_KeyEvent_GetMetaKey(const ArkUI_UIInputEvent* event); + +/** + * @brief Obtains the timestamp of a key event. It is the interval between the time when the event is triggered and the + * time when the system starts, in nanoseconds. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @return Returns the event timestamp, in nanoseconds. + * @since 14 + */ +uint64_t OH_ArkUI_KeyEvent_GetTimestamp(const ArkUI_UIInputEvent* event); + +/** + * @brief Prevents a key event from bubbling up. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @param stopPropagation Whether to stop event propagation. + * @since 14 + */ +void OH_ArkUI_KeyEvent_StopPropagation(const ArkUI_UIInputEvent* event, bool stopPropagation); + +/** + * @brief Obtains the pressed status of modifier keys from a key event. + * The following modifier keys are supported: Ctrl, Alt, Shift, Fn. However, the Fn key on external keyboards + * is not supported. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @param modifierKeys Modifier keys to check, which must be created using {@link ArkUI_ModifierKeyName}. + * @return Returns whether the pressed status of the modifier keys. + * @since 14 + */ +bool OH_ArkUI_KeyEvent_GetModifierKeyState(const ArkUI_UIInputEvent* event, uint32_t modifierKeys); + +/** + * @brief Obtains the intention code associated with a key event. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @return Returns the intention code associated with the key event. + * @since 14 + */ +ArkUI_KeyIntension OH_ArkUI_KeyEvent_GetKeyIntensionCode(const ArkUI_UIInputEvent* event); + +/** + * @brief Obtains the Unicode value associated with a key event. + * Non-space basic Latin characters in the 0x0021-0x007E range are supported. Characters with a value of 0 are not + * supported. In the case of key combination, this API returns the Unicode value of the key corresponding to the key + * event. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @return Returns the Unicode value. + * @since 14 + */ +uint32_t OH_ArkUI_KeyEvent_GetUnicode(const ArkUI_UIInputEvent* event); + +/** + * @brief Sets whether a key event is consumed in the key event callback. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @param isConsumed Whether the event is consumed. + * @since 14 + */ +void OH_ArkUI_KeyEvent_SetConsumed(const ArkUI_UIInputEvent* event, bool isConsumed); +#ifdef __cplusplus +}; +#endif + +#endif // ARKUI_NATIVE_KEY_EVENT_H +/** @} */ \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index d57414dcc..0348b322d 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -5661,6 +5661,31 @@ typedef enum { * {@link ArkUI_NodeEvent} object. \n */ NODE_ON_DRAG_END = 20, + /** + * @brief Defines the event triggered when a key event occurs. + * + * The callback can be triggered during interactions with a focused window using an external keyboard or other input + * device. \n + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * + * @since 14 + */ + NODE_ON_KEY_EVENT = 21, + /** + * @brief Defines the event triggered before the input method responds to the key action. + * + * If the return value of this callback is true, it is considered that the key event has been consumed, and + * subsequent event callbacks (keyboardShortcut, input method events, onKeyEvent) will be intercepted + * and no longer triggered. + * The callback can be triggered during interactions with a focused window using an external keyboard or other input + * device. \n + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * + * @since 14 + */ + NODE_ON_KEY_PRE_IME = 22, /** * @brief Triggers onDetectResultUpdate callback -- Gitee From 6ef94e3de0c9efdd512278f2d6098295b488807a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B4=94=E6=B4=AA=E6=96=8C?= Date: Tue, 12 Nov 2024 10:35:01 +0800 Subject: [PATCH 380/620] =?UTF-8?q?=E7=AA=97=E5=8F=A3=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 崔洪斌 --- arkui/window_manager/oh_window_event_filter.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arkui/window_manager/oh_window_event_filter.h b/arkui/window_manager/oh_window_event_filter.h index 783e8c5c2..e4651cd59 100644 --- a/arkui/window_manager/oh_window_event_filter.h +++ b/arkui/window_manager/oh_window_event_filter.h @@ -12,15 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef INCLUDE_OH_WINDOW_EVENT_FILTER_H -#define INCLUDE_OH_WINDOW_EVENT_FILTER_H - /** * @addtogroup WindowManager_NativeModule * @{ * - * * @brief Provides abilities of windowManager on the native side, such as key event * filtration. * @@ -37,6 +33,10 @@ * @kit ArkUI * @since 12 */ + +#ifndef INCLUDE_OH_WINDOW_EVENT_FILTER_H +#define INCLUDE_OH_WINDOW_EVENT_FILTER_H + #include "stdbool.h" #include "stdint.h" #include "oh_window_comm.h" @@ -79,4 +79,5 @@ WindowManager_ErrorCode OH_NativeWindowManager_UnregisterKeyEventFilter(int32_t } #endif -#endif // INCLUDE_OH_WINDOW_EVENT_FILTER_H \ No newline at end of file +#endif // INCLUDE_OH_WINDOW_EVENT_FILTER_H +/** @} */ \ No newline at end of file -- Gitee From ee845cd9ace66f14fb1103d03ed1a2c62d62043c Mon Sep 17 00:00:00 2001 From: leafly2021 Date: Mon, 11 Nov 2024 20:15:59 +0800 Subject: [PATCH 381/620] add Vsync api Signed-off-by: leafly2021 --- graphic/graphic_2d/native_vsync/native_vsync.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/graphic/graphic_2d/native_vsync/native_vsync.h b/graphic/graphic_2d/native_vsync/native_vsync.h index 791fbfd36..c5f6f6543 100644 --- a/graphic/graphic_2d/native_vsync/native_vsync.h +++ b/graphic/graphic_2d/native_vsync/native_vsync.h @@ -70,6 +70,19 @@ OH_NativeVSync* OH_NativeVSync_Create(const char* name, unsigned int length); */ void OH_NativeVSync_Destroy(OH_NativeVSync* nativeVsync); +/** + * @brief Creates a NativeVsync instance.\n + * A new NativeVsync instance is created each time this function is called. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeVsync + * @param windowID Indicates the id of the associated window. + * @param name Indicates the vsync connection name. + * @param length Indicates the name's length. + * @return Returns the pointer to the NativeVsync instance created. + * @since 14 + * @version 1.0 + */ +OH_NativeVSync* OH_NativeVSync_Create_ForAssociatedWindow(uint64_t windowID, const char* name, unsigned int length); /** * @brief Request next vsync with callback. * If you call this interface multiple times in one frame, it will only call the last callback. -- Gitee From b8ea9c3b7d11620a818639b49c08219c3b47972f Mon Sep 17 00:00:00 2001 From: Lixiaoying25 Date: Tue, 12 Nov 2024 16:07:06 +0800 Subject: [PATCH 382/620] =?UTF-8?q?API=20lint=20=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E6=95=B4=E6=94=B9=20Signed-off-by:=20Lixiaoying25=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IPCKit/ipc_cparcel.h | 6 +++--- IPCKit/ipc_cremote_object.h | 6 +++--- IPCKit/ipc_cskeleton.h | 6 +++--- IPCKit/ipc_error_code.h | 6 +++--- IPCKit/ipc_kit.h | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/IPCKit/ipc_cparcel.h b/IPCKit/ipc_cparcel.h index bade20ba9..6903bb621 100644 --- a/IPCKit/ipc_cparcel.h +++ b/IPCKit/ipc_cparcel.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef CAPI_INCLUDE_IPC_CPARCEL_H -#define CAPI_INCLUDE_IPC_CPARCEL_H - /** * @addtogroup OHIPCParcel * @{ @@ -37,6 +34,9 @@ * @since 12 */ +#ifndef CAPI_INCLUDE_IPC_CPARCEL_H +#define CAPI_INCLUDE_IPC_CPARCEL_H + #include #ifdef __cplusplus diff --git a/IPCKit/ipc_cremote_object.h b/IPCKit/ipc_cremote_object.h index b8f82db7c..1f04f78dd 100644 --- a/IPCKit/ipc_cremote_object.h +++ b/IPCKit/ipc_cremote_object.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef CAPI_INCLUDE_IPC_CREMOTE_OBJECT_H -#define CAPI_INCLUDE_IPC_CREMOTE_OBJECT_H - /** * @addtogroup OHIPCRemoteObject * @{ @@ -39,6 +36,9 @@ * @since 12 */ +#ifndef CAPI_INCLUDE_IPC_CREMOTE_OBJECT_H +#define CAPI_INCLUDE_IPC_CREMOTE_OBJECT_H + #include #include "ipc_cparcel.h" diff --git a/IPCKit/ipc_cskeleton.h b/IPCKit/ipc_cskeleton.h index 68364cbec..e6a853013 100644 --- a/IPCKit/ipc_cskeleton.h +++ b/IPCKit/ipc_cskeleton.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef CAPI_INCLUDE_IPC_CSKELETON_H -#define CAPI_INCLUDE_IPC_CSKELETON_H - /** * @addtogroup OHIPCSkeleton * @{ @@ -39,6 +36,9 @@ * @since 12 */ +#ifndef CAPI_INCLUDE_IPC_CSKELETON_H +#define CAPI_INCLUDE_IPC_CSKELETON_H + #include #include "ipc_cparcel.h" diff --git a/IPCKit/ipc_error_code.h b/IPCKit/ipc_error_code.h index 5f7a14514..5fa109e5b 100644 --- a/IPCKit/ipc_error_code.h +++ b/IPCKit/ipc_error_code.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef CAPI_INCLUDE_IPC_ERROR_CODE_H -#define CAPI_INCLUDE_IPC_ERROR_CODE_H - /** * @addtogroup OHIPCErrorCode * @{ @@ -37,6 +34,9 @@ * @since 12 */ +#ifndef CAPI_INCLUDE_IPC_ERROR_CODE_H +#define CAPI_INCLUDE_IPC_ERROR_CODE_H + /** * @brief Enumerates IPC error codes. * diff --git a/IPCKit/ipc_kit.h b/IPCKit/ipc_kit.h index e30d81aac..9786bd1f2 100644 --- a/IPCKit/ipc_kit.h +++ b/IPCKit/ipc_kit.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef CAPI_INCLUDE_IPC_KIT_H -#define CAPI_INCLUDE_IPC_KIT_H - /** * @addtogroup IPCKit * @{ @@ -36,6 +33,9 @@ * @since 12 */ +#ifndef CAPI_INCLUDE_IPC_KIT_H +#define CAPI_INCLUDE_IPC_KIT_H + #include "ipc_error_code.h" #include "ipc_cparcel.h" #include "ipc_cremote_object.h" -- Gitee From 7c084270497986349387f5dc057229f9691d8289 Mon Sep 17 00:00:00 2001 From: houguobiao Date: Tue, 12 Nov 2024 10:22:34 +0800 Subject: [PATCH 383/620] =?UTF-8?q?TextPicker=E7=BB=84=E4=BB=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0onScrollStop=E4=BA=8B=E4=BB=B6=E5=9B=9E=E8=B0=83C?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: houguobiao Change-Id: I935cdc210db6488527cf788ef629dc0050c76783 --- arkui/ace_engine/native/native_node.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index d57414dcc..f871de0b4 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -6100,6 +6100,19 @@ typedef enum { */ NODE_TEXT_PICKER_EVENT_ON_CHANGE = MAX_NODE_SCOPE_NUM * ARKUI_NODE_TEXT_PICKER, + /** + * @brief Defines the event triggered when an item is selected and scrolling has stopped in the + * ARKUI_NODE_TEXT_PICKER component. + * + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * {@link ArkUI_NodeComponentEvent} contains one parameter:\n + * ArkUI_NodeComponentEvent.data[0...11].i32: value of the selected item. \n + * + * @since 14 + */ + NODE_TEXT_PICKER_EVENT_ON_SCROLL_STOP = 15001, + /** * @brief Defines the event triggered when a date is selected in the NODE_CALENDAR_PICKER. * -- Gitee From 614c630b15567fae11c1a30cc9c76884cc78f41d Mon Sep 17 00:00:00 2001 From: wangxiuxiu96 Date: Wed, 30 Oct 2024 18:06:39 +0800 Subject: [PATCH 384/620] capi Signed-off-by: wangxiuxiu96 --- arkui/ace_engine/native/native_node.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index d57414dcc..419ba69d7 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -1825,6 +1825,20 @@ typedef enum { * */ NODE_CLICK_DISTANCE = 97, + + /** + * @brief Sets whether the focus can be placed on this component. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: whether the focus can be placed on the current component. The parameter type is 1 or 0. + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether the focus can be placed on the current component. The parameter type is 1 or 0. + * + * @since 14 + */ + NODE_TAB_STOP = 98, /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. -- Gitee From d9ffada86c3a49c51c0ff6d1d5e522ca1a0b0c2b Mon Sep 17 00:00:00 2001 From: zoulinken Date: Mon, 28 Oct 2024 16:30:34 +0800 Subject: [PATCH 385/620] =?UTF-8?q?C-API=E6=89=93=E7=82=B9=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E7=9B=B8=E5=85=B3API=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zoulinken --- arkui/ace_engine/native/libace.ndk.json | 44 +++++++++++++++++ arkui/ace_engine/native/native_node.h | 63 +++++++++++++++++++++++++ arkui/ace_engine/native/native_type.h | 57 ++++++++++++++++++++++ 3 files changed, 164 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 48c1d3a84..8852a3d2b 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -1303,6 +1303,50 @@ "first_introduced": "13", "name": "OH_ArkUI_NodeUtils_RemoveCustomProperty" }, + { + "first_introduced": "14", + "name": "OH_ArkUI_NodeUtils_GetCustomProperty" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_NodeUtils_GetParentInPageTree" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_NodeUtils_GetActiveChildrenInfo" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_NodeUtils_GetCurrentPageRootNode" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_NodeUtils_IsCreatedByNDK" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_NodeUtils_GetNodeType" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_CustomProperty_Destroy" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_CustomProperty_GetStringValue" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_ActiveChildrenInfo_Destroy" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_ActiveChildrenInfo_GetNodeByIndex" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_ActiveChildrenInfo_GetCount" + }, { "first_introduced": "12", "name": "OH_ArkUI_ListChildrenMainSizeOption_Create" diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index d57414dcc..908e160b8 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -7728,6 +7728,69 @@ void OH_ArkUI_NodeUtils_AddCustomProperty(ArkUI_NodeHandle node, const char* nam */ void OH_ArkUI_NodeUtils_RemoveCustomProperty(ArkUI_NodeHandle node, const char* name); +/** + * @brief Get the value of the custom property of the component. + * + * @param node ArkUI-NodeHandle pointer. + * @param name The name of the custom attribute. + * @param handle The structure of the custom attribute corresponding to the key parameter name obtained. + * @return Error code. + * {@link ARKUI_ERROR_CODE_NO_ERROR} success. + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function parameter exception. + * @since 14 + */ +int32_t OH_ArkUI_NodeUtils_GetCustomProperty(ArkUI_NodeHandle node, const char* name, ArkUI_CustomProperty** handle); + +/** + * @brief Get the parent node to obtain the component nodes created by ArkTs. + * + * @param node Target node object. + * @return Return the pointer of the component. + * @since 14 + */ +ArkUI_NodeHandle OH_ArkUI_NodeUtils_GetParentInPageTree(ArkUI_NodeHandle node); + +/** + * @brief Retrieve all active child nodes of a node. + * + * @param head Pass in the node that needs to be obtained. + * @param handle The structure corresponding to the sub node information of the head node. + * @return Error code. + * {@link ARKUI_ERROR_CODE_NO_ERROR} success. + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function parameter exception. + * @since 14 + */ +int32_t OH_ArkUI_NodeUtils_GetActiveChildrenInfo(ArkUI_NodeHandle head, ArkUI_ActiveChildrenInfo** handle); + +/** + * @brief Retrieve the root node of the current page. + * + * @param node Target node object. + * @return Return the pointer of the component. + * @since 14 + */ +ArkUI_NodeHandle OH_ArkUI_NodeUtils_GetCurrentPageRootNode(ArkUI_NodeHandle node); + +/** + * @brief Retrieve whether the component is labeled by C-API. + * + * @param node Target node object. + * @return Return whether the node is a Tag created by C-API, + * true represents created by C-API, false represents not created by C-API. + * @since 14 + */ +bool OH_ArkUI_NodeUtils_IsCreatedByNDK(ArkUI_NodeHandle node); + +/** + * @brief Get the type of node. + * + * @param node Target node object. + * @return Return the type of the node. + * For specific open types, refer to {@link ArkUI_NodeType}. For unopened nodes, return -1. + * @since 14 + */ +int32_t OH_ArkUI_NodeUtils_GetNodeType(ArkUI_NodeHandle node); + /** * @brief Collapse the ListItem in its expanded state. * diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index f484a3538..ca825e62b 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -193,6 +193,20 @@ typedef struct ArkUI_AccessibilityState ArkUI_AccessibilityState; */ typedef struct ArkUI_AccessibilityValue ArkUI_AccessibilityValue; +/** + * @brief Define the information of the Custom Property class for custom properties. + * + * @since 14 + */ +typedef struct ArkUI_CustomProperty ArkUI_CustomProperty; + +/** + * @brief Define ActiveChildenInfo class information. + * + * @since 14 + */ +typedef struct ArkUI_ActiveChildrenInfo ArkUI_ActiveChildrenInfo; + /** * @brief Defines the event callback type. * @@ -3878,6 +3892,49 @@ void OH_ArkUI_AccessibilityValue_SetText(ArkUI_AccessibilityValue* value, const * @since 12 */ const char* OH_ArkUI_AccessibilityValue_GetText(ArkUI_AccessibilityValue* value); + +/** + * @brief Destroy the instance of Customs Property. + * + * @param handle The instance of Customs Property to be destroyed. + * @since 14 + */ +void OH_ArkUI_CustomProperty_Destroy(ArkUI_CustomProperty* handle); + +/** + * @brief Get custom attribute value information. + * + * @param handle Custom attribute object pointer. + * @return Customize the value information within the attribute structure. + * @since 14 + */ +const char* OH_ArkUI_CustomProperty_GetStringValue(ArkUI_CustomProperty* handle); + +/** + * @brief Destroy ActiveChildenInfo instance. + * + * @param handle ActiveChild instance to be destroyed. + * @since 14 + */ +void OH_ArkUI_ActiveChildrenInfo_Destroy(ArkUI_ActiveChildrenInfo* handle); + +/** + * @brief Retrieve the child nodes of ActiveChildenInfo with the structure index. + * + * @param handle The ActiveChildenInfo instance for obtaining information. + * @return The child node pointer corresponding to the index. Return nullptr in case of exception. + * @since 14 + */ +ArkUI_NodeHandle OH_ArkUI_ActiveChildrenInfo_GetNodeByIndex(ArkUI_ActiveChildrenInfo* handle, int32_t index); + +/** + * @brief Retrieve the number of nodes within the structure of ActiveChildenInfo. + * + * @param handle The ActiveChildenInfo instance for obtaining information. + * @return Number of child nodes. Default value: 0. + * @since 14 + */ +int32_t OH_ArkUI_ActiveChildrenInfo_GetCount(ArkUI_ActiveChildrenInfo* handle); #ifdef __cplusplus }; #endif -- Gitee From 441bd679251b74dcaf0f91edc7fc6f96a8b304aa Mon Sep 17 00:00:00 2001 From: "@ran-zhao-yu" Date: Wed, 13 Nov 2024 11:13:56 +0800 Subject: [PATCH 386/620] =?UTF-8?q?API=20Link=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: @ran-zhao-yu --- .../include/rawfile/raw_dir.h | 3 ++ .../include/rawfile/raw_file.h | 3 ++ .../include/rawfile/raw_file_manager.h | 3 ++ .../include/resourcemanager/ohresmgr.h | 40 +++++++++---------- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/global/resource_management/include/rawfile/raw_dir.h b/global/resource_management/include/rawfile/raw_dir.h index 94965690c..9e4228122 100644 --- a/global/resource_management/include/rawfile/raw_dir.h +++ b/global/resource_management/include/rawfile/raw_dir.h @@ -31,6 +31,9 @@ * @brief Declares native functions related to raw file directories. * * For example, you can use the functions to traverse and close a raw file directory, and reset its index. + * + * @syscap SystemCapability.Global.ResourceManager + * @library librawfile.z.so * @kit LocalizationKit * @since 8 * @version 1.0 diff --git a/global/resource_management/include/rawfile/raw_file.h b/global/resource_management/include/rawfile/raw_file.h index 4aa80b842..1a0da611f 100644 --- a/global/resource_management/include/rawfile/raw_file.h +++ b/global/resource_management/include/rawfile/raw_file.h @@ -31,6 +31,9 @@ * @brief Declares native functions related to raw file. * * For example, you can use the functions to search for, read, and close raw files. + * + * @syscap SystemCapability.Global.ResourceManager + * @library librawfile.z.so * @kit LocalizationKit * @since 8 * @version 1.0 diff --git a/global/resource_management/include/rawfile/raw_file_manager.h b/global/resource_management/include/rawfile/raw_file_manager.h index 1663e77be..4b1dfb619 100644 --- a/global/resource_management/include/rawfile/raw_file_manager.h +++ b/global/resource_management/include/rawfile/raw_file_manager.h @@ -31,6 +31,9 @@ * @brief Declares native functions for the resource manager. * * You can use the resource manager to open raw files for subsequent operations, such as seeking and reading. + * + * @syscap SystemCapability.Global.ResourceManager + * @library librawfile.z.so * @kit LocalizationKit * @since 8 * @version 1.0 diff --git a/global/resource_management/include/resourcemanager/ohresmgr.h b/global/resource_management/include/resourcemanager/ohresmgr.h index 9fc6efde4..d48a69f8b 100644 --- a/global/resource_management/include/resourcemanager/ohresmgr.h +++ b/global/resource_management/include/resourcemanager/ohresmgr.h @@ -50,10 +50,10 @@ extern "C" { * @param mgr Indicates the pointer to {@link NativeResourceManager} * {@link OH_ResourceManager_InitNativeResourceManager}. * @param resId Indicates the resource ID. - * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means - * to use the density of current system dpi. * @param resultValue the result write to resultValue. * @param resultLen the media length write to resultLen. + * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means + * to use the density of current system dpi. * @return {@link SUCCESS} 0 - Success. * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: * 1.Incorrect parameter types; 2.Parameter verification failed. @@ -73,10 +73,10 @@ ResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64(const NativeResource * @param mgr Indicates the pointer to {@link NativeResourceManager} * {@link OH_ResourceManager_InitNativeResourceManager}. * @param resId Indicates the resource ID. - * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means - * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. * @param resultValue the result write to resultValue. * @param resultLen the media length write to resultLen. + * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means + * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. * @return {@link SUCCESS} 0 - Success. * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: * 1.Incorrect parameter types; 2.Parameter verification failed. @@ -96,10 +96,10 @@ ResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64Data(const NativeReso * @param mgr Indicates the pointer to {@link NativeResourceManager} * {@link OH_ResourceManager_InitNativeResourceManager}. * @param resName Indicates the resource name. - * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means - * to use the density of current system dpi. * @param resultValue the result write to resultValue. * @param resultLen the media length write to resultLen. + * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means + * to use the density of current system dpi. * @return {@link SUCCESS} 0 - Success. * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: * 1.Incorrect parameter types; 2.Parameter verification failed. @@ -119,10 +119,10 @@ ResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64ByName(const NativeRe * @param mgr Indicates the pointer to {@link NativeResourceManager} * {@link OH_ResourceManager_InitNativeResourceManager}. * @param resName Indicates the resource name. - * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means - * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. * @param resultValue the result write to resultValue. * @param resultLen the media length write to resultLen. + * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means + * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. * @return {@link SUCCESS} 0 - Success. * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: * 1.Incorrect parameter types; 2.Parameter verification failed. @@ -142,10 +142,10 @@ ResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64DataByName(const Nati * @param mgr Indicates the pointer to {@link NativeResourceManager} * {@link OH_ResourceManager_InitNativeResourceManager}. * @param resId Indicates the resource ID. - * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means - * to use the density of current system dpi. * @param resultValue the result write to resultValue. * @param resultLen the media length write to resultLen. + * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means + * to use the density of current system dpi. * @return {@link SUCCESS} 0 - Success. * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: * 1.Incorrect parameter types; 2.Parameter verification failed. @@ -165,10 +165,10 @@ ResourceManager_ErrorCode OH_ResourceManager_GetMedia(const NativeResourceManage * @param mgr Indicates the pointer to {@link NativeResourceManager} * {@link OH_ResourceManager_InitNativeResourceManager}. * @param resId Indicates the resource ID. - * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means - * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. * @param resultValue the result write to resultValue. * @param resultLen the media length write to resultLen. + * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means + * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. * @return {@link SUCCESS} 0 - Success. * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: * 1.Incorrect parameter types; 2.Parameter verification failed. @@ -188,10 +188,10 @@ ResourceManager_ErrorCode OH_ResourceManager_GetMediaData(const NativeResourceMa * @param mgr Indicates the pointer to {@link NativeResourceManager} * {@link OH_ResourceManager_InitNativeResourceManager}. * @param resName Indicates the resource name. - * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means - * to use the density of current system dpi. * @param resultValue the result write to resultValue. * @param resultLen the media length write to resultLen. + * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means + * to use the density of current system dpi. * @return {@link SUCCESS} 0 - Success. * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: * 1.Incorrect parameter types; 2.Parameter verification failed. @@ -211,10 +211,10 @@ ResourceManager_ErrorCode OH_ResourceManager_GetMediaByName(const NativeResource * @param mgr Indicates the pointer to {@link NativeResourceManager} * {@link OH_ResourceManager_InitNativeResourceManager}. * @param resName Indicates the resource name. - * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means - * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. * @param resultValue the result write to resultValue. * @param resultLen the media length write to resultLen. + * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means + * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. * @return {@link SUCCESS} 0 - Success. * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: * 1.Incorrect parameter types; 2.Parameter verification failed. @@ -234,10 +234,10 @@ ResourceManager_ErrorCode OH_ResourceManager_GetMediaDataByName(const NativeReso * @param mgr Indicates the pointer to {@link NativeResourceManager} * {@link OH_ResourceManager_InitNativeResourceManager}. * @param resId Indicates the resource ID. + * @param drawableDescriptor the result write to drawableDescriptor. * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means * to use the density of current system dpi. * @param type The optional parameter means the media type, 0 means the normal media, 1 means the the theme style media. - * @param drawableDescriptor the result write to drawableDescriptor. * @return {@link SUCCESS} 0 - Success. * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: * 1.Incorrect parameter types; 2.Parameter verification failed. @@ -256,11 +256,11 @@ ResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptor(const NativeR * @param mgr Indicates the pointer to {@link NativeResourceManager} * {@link OH_ResourceManager_InitNativeResourceManager}. * @param resId Indicates the resource ID. + * @param drawableDescriptor the result write to drawableDescriptor. * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. * @param type The optional parameter means the media type, 0 means the normal media, 1 means the the theme style media. * If this attribute is not required, set this parameter to 0. - * @param drawableDescriptor the result write to drawableDescriptor. * @return {@link SUCCESS} 0 - Success. * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: * 1.Incorrect parameter types; 2.Parameter verification failed. @@ -278,11 +278,11 @@ ResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptorData(const Nat * @param mgr Indicates the pointer to {@link NativeResourceManager} * {@link OH_ResourceManager_InitNativeResourceManager}. * @param resName Indicates the resource name. + * @param drawableDescriptor the result write to drawableDescriptor. * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means * to use the density of current system dpi. * @param type The optional parameter means the media type, 0 means the normal media, 1 means the the theme style media, * 2 means the theme dynamic media. - * @param drawableDescriptor the result write to drawableDescriptor. * @return {@link SUCCESS} 0 - Success. * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: * 1.Incorrect parameter types; 2.Parameter verification failed. @@ -300,11 +300,11 @@ ResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptorByName(const N * @param mgr Indicates the pointer to {@link NativeResourceManager} * {@link OH_ResourceManager_InitNativeResourceManager}. * @param resName Indicates the resource name. + * @param drawableDescriptor the result write to drawableDescriptor. * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. * @param type The optional parameter means the media type, 0 means the normal media, 1 means the the theme style media, * 2 means the theme dynamic media. If this attribute is not required, set this parameter to 0. - * @param drawableDescriptor the result write to drawableDescriptor. * @return {@link SUCCESS} 0 - Success. * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: * 1.Incorrect parameter types; 2.Parameter verification failed. -- Gitee From b0d7da93a67929ffec1542cbcfd6b1cb6a10f909 Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Wed, 13 Nov 2024 06:40:50 +0000 Subject: [PATCH 387/620] add Signed-off-by: Feng Lin --- multimedia/media_foundation/native_averrors.h | 123 ++---------------- 1 file changed, 14 insertions(+), 109 deletions(-) diff --git a/multimedia/media_foundation/native_averrors.h b/multimedia/media_foundation/native_averrors.h index 727f2eea3..1bb0f8062 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -108,172 +108,77 @@ typedef enum OH_AVErrCode { */ AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION = 301, /** - * @the address of server is incorrect, and IO can not find host. + * @error the address of server is incorrect, and IO can not find host. * @since 14 */ AV_ERR_IO_CANNOT_FIND_HOST = 5411001, /** - * @network connection timeout. + * @error network connection timeout. * @since 14 */ AV_ERR_IO_CONNECTION_TIMEOUT = 5411002, /** - * @failed link due to abnormal network. + * @error failed link due to abnormal network. * @since 14 */ AV_ERR_IO_NETWORK_ABNORMAL = 5411003, /** - * @failed link due to unavailable network. + * @error failed link due to unavailable network. * @since 14 */ AV_ERR_IO_NETWORK_UNAVAILABLE = 5411004, /** - * @network permission dennied. + * @error network permission dennied. * @since 14 */ AV_ERR_IO_NO_PERMISSION = 5411005, /** - * @the client request parameters are incorrect or exceed the processing capacity. + * @error the client request parameters are incorrect or exceed the processing capacity. * @since 14 */ AV_ERR_IO_NETWORK_ACCESS_DENIED = 5411006, /** - * @cannot find available network resources. + * @error cannot find available network resources. * @since 14 */ AV_ERR_IO_RESOURCE_NOT_FOUND = 5411007, /** - * @the server failS to verify the client certificate because the certificate is not carried, + * @error the server failS to verify the client certificate because the certificate is not carried, * the certificate is invalid, or the certificate is expired. * @since 14 */ AV_ERR_IO_SSL_CLIENT_CERT_NEEDED = 5411008, /** - * @the client fails to verify the server certificate because the certificate is not carried, + * @error the client fails to verify the server certificate because the certificate is not carried, * the certificate is invalid, or the certificate is expired. * @since 14 */ AV_ERR_IO_SSL_CONNECT_FAIL = 5411009, /** - * @IO SSL server cert untrusted. + * @error IO SSL server cert untrusted. * @since 14 */ AV_ERR_IO_SSL_SERVER_CERT_UNTRUSTED = 5411010, /** - * @unsupported request due to network protocols. + * @error unsupported request due to network protocols. * @since 14 */ AV_ERR_IO_UNSUPPORTED_REQUEST = 5411011, /** - * @file data is incorrect, and no specific data can be provided. + * @error file data is incorrect, and no specific data can be provided. * @since 14 */ AV_ERR_IO_DATA_ABNORMAL = 5411012, /** - * @file is occupied by other processes and cannot be accessed. - * @since 14 - */ - AV_ERR_IO_FILE_ACCESS_DENIED = 5411013, - /** - * @the file handle is incorrect. - * @since 14 - */ - AV_ERR_IO_FILE_BAD_HANDLE = 5411014, - /** - * @IO file not found. - * @since 14 - */ - AV_ERR_IO_FILE_NOT_FOUND = 5411015, - /** - * @IO file permission denied because API does not have permissions. - * @since 14 - */ - AV_ERR_IO_FILE_PERMISSION_DENIED = 5411016, - /** - * @fail to decode the audio data. - * @since 14 - */ - AV_ERR_IO_AUDIO_DEC_FAILED = 5411017, - /** - * @fail to init the audio decoder. - * @since 14 - */ - AV_ERR_IO_AUDIO_DEC_INIT_FAILED = 5411018, - /** - * @the audio decoder is unavailable for handler incurrupt, or audio decoder subsystem abnormal. - * @since 14 - */ - AV_ERR_IO_AUDIO_DEC_UNAVAILABLE = 5411019, - /** - * @audio device error. + * @error audio device error. * @since 14 */ AV_ERR_IO_AUDIO_DEVICE_ERROR = 5411020, /** - * @audio device state does not support the current operation. - * @since 14 - */ - AV_ERR_IO_AUDIO_DEVICE_INVALID_STATE = 5411021, - /** - * @audio device timeout when calling audio render interface. - * @since 14 - */ - AV_ERR_IO_AUDIO_DEVICE_TIMEOUT = 5411022, - /** - * @audio device unavailable, unable to create an audio device. - * @since 14 - */ - AV_ERR_IO_AUDIO_DEVICE_UNAVAILABLE = 5411023, - /** - * @fail to encode the audio data. - * @since 14 - */ - AV_ERR_IO_AUDIO_ENC_FAILED = 5411024, - /** - * @fail to init the audio encoder. - * @since 14 - */ - AV_ERR_IO_AUDIO_ENC_INIT_FAILED = 5411025, - /** - * @audio encoder is unavailable for handler incurrupt, or audio encoder subsystem abnormal. - * @since 14 - */ - AV_ERR_IO_AUDIO_ENC_UNAVAILABLE = 5411026, - /** - * @fail to decode the video data. - * @since 14 - */ - AV_ERR_IO_VIDEO_DEC_FAILED = 5411027, - /** - * @fail to init the video decoder. - * @since 14 - */ - AV_ERR_IO_VIDEO_DEC_INIT_FAILED = 5411028, - /** - * @video decoder is unavailable for handler incurrupt, or video decoder subsystem abnormal. - * @since 14 - */ - AV_ERR_IO_VIDEO_DEC_UNAVAILABLE = 5411029, - /** - * @video device error. + * @error video device error. * @since 14 */ AV_ERR_IO_VIDEO_DEVICE_ERROR = 5411030, - /** - * @fail to encode the video data. - * @since 14 - */ - AV_ERR_IO_VIDEO_ENC_FAILED = 5411031, - /** - * @fail to init the video encoder. - * @since 14 - */ - AV_ERR_IO_VIDEO_ENC_INIT_FAILED = 5411032, - /** - * @video encoder is unavailable for handler incurrupt, or video encoder subsystem abnormal. - * @since 14 - */ - AV_ERR_IO_VIDEO_ENC_UNAVAILABLE = 5411033, } OH_AVErrCode; #ifdef __cplusplus -- Gitee From 1e41924be4e8fdda1f8e199cb124e7dfaf7a225e Mon Sep 17 00:00:00 2001 From: maan4 Date: Wed, 13 Nov 2024 06:58:04 +0000 Subject: [PATCH 388/620] sensors CAPI change Signed-off-by: maan4 --- sensors/miscdevice/vibrator/include/vibrator_type.h | 4 ++++ sensors/sensor/oh_sensor_type.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sensors/miscdevice/vibrator/include/vibrator_type.h b/sensors/miscdevice/vibrator/include/vibrator_type.h index 1711f7308..0ce2b1ea3 100644 --- a/sensors/miscdevice/vibrator/include/vibrator_type.h +++ b/sensors/miscdevice/vibrator/include/vibrator_type.h @@ -34,7 +34,11 @@ #ifndef VIBRATOR_TYPE_H #define VIBRATOR_TYPE_H +#ifdef __cplusplus #include +#else +#include +#endif #ifdef __cplusplus extern "C" { diff --git a/sensors/sensor/oh_sensor_type.h b/sensors/sensor/oh_sensor_type.h index 0641a9c0c..c53c5e152 100644 --- a/sensors/sensor/oh_sensor_type.h +++ b/sensors/sensor/oh_sensor_type.h @@ -34,7 +34,11 @@ #ifndef OH_SENSOR_TYPE_H #define OH_SENSOR_TYPE_H +#ifdef __cplusplus #include +#else +#include +#endif #ifdef __cplusplus extern "C" { -- Gitee From 3e354bd41c13918faa31b3f35a46afddfe63ebca Mon Sep 17 00:00:00 2001 From: dujingcheng Date: Wed, 13 Nov 2024 02:44:57 +0000 Subject: [PATCH 389/620] fix Signed-off-by: dujingcheng --- arkui/ace_engine/native/native_animate.h | 4 ++++ arkui/ace_engine/native/native_interface_accessibility.h | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_animate.h b/arkui/ace_engine/native/native_animate.h index 08709d707..bd5c9303e 100644 --- a/arkui/ace_engine/native/native_animate.h +++ b/arkui/ace_engine/native/native_animate.h @@ -36,7 +36,11 @@ #ifndef ARKUI_NATIVE_ANIMATE_H #define ARKUI_NATIVE_ANIMATE_H +#ifdef __cplusplus #include +#else +#include +#endif #include "native_type.h" diff --git a/arkui/ace_engine/native/native_interface_accessibility.h b/arkui/ace_engine/native/native_interface_accessibility.h index 4150edcec..09f8b97e5 100644 --- a/arkui/ace_engine/native/native_interface_accessibility.h +++ b/arkui/ace_engine/native/native_interface_accessibility.h @@ -34,10 +34,14 @@ #ifndef _NATIVE_INTERFACE_ACCESSIBILITY_H #define _NATIVE_INTERFACE_ACCESSIBILITY_H +#ifdef __cplusplus #include +#else +#include +#endif #ifdef __cplusplus -extern "C"{ +extern "C" { #endif /** -- Gitee From 6db2f758d39bb686842db34eff7ad0fecc06b55f Mon Sep 17 00:00:00 2001 From: GuoLi Date: Wed, 13 Nov 2024 07:46:04 +0000 Subject: [PATCH 390/620] =?UTF-8?q?=E8=93=9D=E9=BB=84=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: GuoLi --- network/netssl/include/net_ssl_c_type.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/network/netssl/include/net_ssl_c_type.h b/network/netssl/include/net_ssl_c_type.h index c7096a558..d0bbea496 100644 --- a/network/netssl/include/net_ssl_c_type.h +++ b/network/netssl/include/net_ssl_c_type.h @@ -38,7 +38,11 @@ */ #include +#ifdef __cplusplus #include +#else +#include +#endif #ifdef __cplusplus extern "C" { -- Gitee From c11960f563081cfa573b77edba795060b2803153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=96=87=E9=BE=99?= Date: Wed, 13 Nov 2024 15:58:34 +0800 Subject: [PATCH 391/620] bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李文龙 --- LocationKit/oh_location_type.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LocationKit/oh_location_type.h b/LocationKit/oh_location_type.h index 729a61051..48e117740 100644 --- a/LocationKit/oh_location_type.h +++ b/LocationKit/oh_location_type.h @@ -34,7 +34,11 @@ #ifndef OH_LOCATION_TYPE_H #define OH_LOCATION_TYPE_H +#ifdef __cplusplus #include +#else +#include +#endif #ifdef __cplusplus extern "C" { -- Gitee From be0748697db475982ce846909f0830b63670f09f Mon Sep 17 00:00:00 2001 From: shilong Date: Wed, 13 Nov 2024 08:38:33 +0000 Subject: [PATCH 392/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E6=96=B0=E5=A2=9Erelease=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- .../hid/hid_ddk_types.h | 26 ++++++++-------- .../external_device_manager/usb/usb_ddk_api.h | 11 +++++++ .../usb/usb_ddk_types.h | 31 +++++++++---------- 3 files changed, 38 insertions(+), 30 deletions(-) diff --git a/drivers/external_device_manager/hid/hid_ddk_types.h b/drivers/external_device_manager/hid/hid_ddk_types.h index 1029fbb12..2bd632dc2 100644 --- a/drivers/external_device_manager/hid/hid_ddk_types.h +++ b/drivers/external_device_manager/hid/hid_ddk_types.h @@ -589,20 +589,20 @@ typedef struct Hid_EventProperties { * @version 1.0 */ typedef enum { - /** @error Operation successful */ + /** Operation successful */ HID_DDK_SUCCESS = 0, - /** @error Operation failed */ - HID_DDK_FAILURE = -1, - /** @error Invalid parameter */ - HID_DDK_INVALID_PARAMETER = -2, - /** @error Invalid operation */ - HID_DDK_INVALID_OPERATION = -3, - /** @error Null pointer exception */ - HID_DDK_NULL_PTR = -4, - /** @error Timeout */ - HID_DDK_TIMEOUT = -5, - /** @error Permission denied */ - HID_DDK_NO_PERM = -6 + /** Permission denied */ + HID_DDK_NO_PERM = 201, + /** Invalid parameter */ + HID_DDK_INVALID_PARAMETER = 401, + /** Operation failed */ + HID_DDK_FAILURE = 27300001, + /** Null pointer exception */ + HID_DDK_NULL_PTR = 27300002, + /** Invalid operation */ + HID_DDK_INVALID_OPERATION = 27300003, + /** Timeout */ + HID_DDK_TIMEOUT = 27300004, } Hid_DdkErrCode; #ifdef __cplusplus } diff --git a/drivers/external_device_manager/usb/usb_ddk_api.h b/drivers/external_device_manager/usb/usb_ddk_api.h index 90ff08e69..00cb13c07 100644 --- a/drivers/external_device_manager/usb/usb_ddk_api.h +++ b/drivers/external_device_manager/usb/usb_ddk_api.h @@ -70,6 +70,17 @@ int32_t OH_Usb_Init(void); */ void OH_Usb_Release(void); +/** + * @brief Releases the DDK. + * + * @permission ohos.permission.ACCESS_DDK_USB + * @return {@link USB_DDK_SUCCESS} the operation is successful. + * {@link USB_DDK_NO_PERM} permission check failed. + * @since 14 + * @version 1.0 + */ +int32_t OH_Usb_ReleaseSource(void); + /** * @brief Obtains the USB device descriptor. * diff --git a/drivers/external_device_manager/usb/usb_ddk_types.h b/drivers/external_device_manager/usb/usb_ddk_types.h index 602baba11..0e32d4a92 100644 --- a/drivers/external_device_manager/usb/usb_ddk_types.h +++ b/drivers/external_device_manager/usb/usb_ddk_types.h @@ -292,28 +292,25 @@ typedef struct UsbDeviceMemMap { /** * @brief Defines error codes for USB DDK. * - * @since 10 + * @since 11 * @version 1.0 */ typedef enum { - /** @error The operation is successful. */ + /** The operation is successful. */ USB_DDK_SUCCESS = 0, - /** @error The operation failed. */ - USB_DDK_FAILED = -1, - /** @error Invalid parameter. */ - USB_DDK_INVALID_PARAMETER = -2, - /** @error Memory-related error, for example, insufficient memory, memory data copy failure,\n - * or memory application failure. + /** Permission denied. */ + USB_DDK_NO_PERM = 201, + /** Invalid parameter. */ + USB_DDK_INVALID_PARAMETER = 401, + /** Memory-related error, for example, insufficient memory, memory data copy failure, or memory application failure. */ - USB_DDK_MEMORY_ERROR = -3, - /** @error Invalid operation. */ - USB_DDK_INVALID_OPERATION = -4, - /** @error Null pointer exception */ - USB_DDK_NULL_PTR = -5, - /** @error Device busy. */ - USB_DDK_DEVICE_BUSY = -6, - /** @error Transmission timeout. */ - USB_DDK_TIMEOUT = -7 + USB_DDK_MEMORY_ERROR = 27400001, + /** Invalid operation. */ + USB_DDK_INVALID_OPERATION = 27400002, + /** I/O error */ + USB_DDK_IO_FAILED = 27400003, + /** Transmission timeout. */ + USB_DDK_TIMEOUT = 27400004, } UsbDdkErrCode; #ifdef __cplusplus } -- Gitee From 49a0e31828997679d1aa6cdf697851e3660b086b Mon Sep 17 00:00:00 2001 From: y00656910 Date: Wed, 13 Nov 2024 16:53:37 +0800 Subject: [PATCH 393/620] fix build error Signed-off-by: y00656910 Change-Id: Id0714bce41f7ac7d05e8115f8f24387eaba4c92f --- multimedia/image_framework/include/image_pixel_map_napi.h | 4 ++++ multimedia/image_framework/include/image_source_mdk.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/multimedia/image_framework/include/image_pixel_map_napi.h b/multimedia/image_framework/include/image_pixel_map_napi.h index 3f4a447f5..3608dac13 100644 --- a/multimedia/image_framework/include/image_pixel_map_napi.h +++ b/multimedia/image_framework/include/image_pixel_map_napi.h @@ -36,7 +36,11 @@ #ifndef INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PIXEL_MAP_NAPI_H_ #define INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PIXEL_MAP_NAPI_H_ +#ifdef __cplusplus #include +#else +#include +#endif #include "napi/native_api.h" namespace OHOS { namespace Media { diff --git a/multimedia/image_framework/include/image_source_mdk.h b/multimedia/image_framework/include/image_source_mdk.h index ae7cadf4d..91b4b5abd 100644 --- a/multimedia/image_framework/include/image_source_mdk.h +++ b/multimedia/image_framework/include/image_source_mdk.h @@ -37,7 +37,11 @@ #ifndef INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_SOURCE_MDK_H_ #define INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_SOURCE_MDK_H_ +#ifdef __cplusplus #include +#else +#include +#endif #include "napi/native_api.h" #include "image_mdk_common.h" #include "rawfile/raw_file.h" -- Gitee From 8dd446a16404df8c2e34ccf9303708cdcc26f148 Mon Sep 17 00:00:00 2001 From: shilong Date: Wed, 13 Nov 2024 09:03:59 +0000 Subject: [PATCH 394/620] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B2=A1=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=94=99=E8=AF=AF=E7=A0=81=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- .../external_device_manager/usb/usb_ddk_api.h | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/external_device_manager/usb/usb_ddk_api.h b/drivers/external_device_manager/usb/usb_ddk_api.h index 00cb13c07..844dea874 100644 --- a/drivers/external_device_manager/usb/usb_ddk_api.h +++ b/drivers/external_device_manager/usb/usb_ddk_api.h @@ -88,7 +88,7 @@ int32_t OH_Usb_ReleaseSource(void); * @param deviceId ID of the device whose descriptor is to be obtained. * @param desc Standard device descriptor defined in the USB protocol. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} desc is null. * @since 10 @@ -106,7 +106,7 @@ int32_t OH_Usb_GetDeviceDescriptor(uint64_t deviceId, struct UsbDeviceDescriptor * @param config Configuration descriptor, which includes the standard configuration descriptor defined in the\n * USB protocol and the associated interface descriptor and endpoint descriptor. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} config is null. * @since 10 @@ -135,7 +135,7 @@ void OH_Usb_FreeConfigDescriptor(struct UsbDdkConfigDescriptor * const config); * @param interfaceHandle Interface operation handle. After the interface is claimed successfully, a value will be\n * assigned to this parameter. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} interfaceHandle is null. * @since 10 @@ -149,7 +149,7 @@ int32_t OH_Usb_ClaimInterface(uint64_t deviceId, uint8_t interfaceIndex, uint64_ * @permission ohos.permission.ACCESS_DDK_USB * @param interfaceHandle Interface operation handle. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * @since 10 * @version 1.0 @@ -164,7 +164,7 @@ int32_t OH_Usb_ReleaseInterface(uint64_t interfaceHandle); * @param settingIndex Index of the alternate setting, which corresponds to bAlternateSetting\n * in the USB protocol. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * @since 10 * @version 1.0 @@ -179,7 +179,7 @@ int32_t OH_Usb_SelectInterfaceSetting(uint64_t interfaceHandle, uint8_t settingI * @param settingIndex Index of the alternate setting, which corresponds to bAlternateSetting\n * in the USB protocol. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} settingIndex is null. * @since 10 @@ -197,7 +197,7 @@ int32_t OH_Usb_GetCurrentInterfaceSetting(uint64_t interfaceHandle, uint8_t *set * @param data Data to be transferred. * @param dataLen Data length. The return value indicates the length of the actually read data. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} setup is null or data is null or dataLen is null or dataLen is less than\n * size of the read data. @@ -218,7 +218,7 @@ int32_t OH_Usb_SendControlReadRequest(uint64_t interfaceHandle, const struct Usb * @param data Data to be transferred. * @param dataLen Data length. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} setup is null or data is null. * @since 10 @@ -235,7 +235,7 @@ int32_t OH_Usb_SendControlWriteRequest(uint64_t interfaceHandle, const struct Us * @param pipe Pipe used to transfer data. * @param devMmap Device memory map, which can be obtained by calling OH_Usb_CreateDeviceMemMap. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} pipe is null or devMmap is null or address of devMmap is null. * @since 10 @@ -251,7 +251,7 @@ int32_t OH_Usb_SendPipeRequest(const struct UsbRequestPipe *pipe, UsbDeviceMemMa * @param pipe Pipe used to transfer data. * @param ashmem Shared memory, which can be obtained by calling OH_DDK_CreateAshmem. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} pipe is null or ashmem is null or address of ashmem is null. * @since 12 @@ -267,7 +267,7 @@ int32_t OH_Usb_SendPipeRequestWithAshmem(const struct UsbRequestPipe *pipe, DDK_ * @param size Buffer size. * @param devMmap Data memory map, through which the created buffer is returned to the caller. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_PARAMETER} devMmap is null. * {@link USB_DDK_MEMORY_ERROR} mmap failed or alloc memory of devMmap failed. * @since 10 -- Gitee From 882542001830df38d5b11cbc3ab6440c4a24155c Mon Sep 17 00:00:00 2001 From: shilong Date: Wed, 13 Nov 2024 09:34:40 +0000 Subject: [PATCH 395/620] =?UTF-8?q?=E4=BF=AE=E6=94=B911=E5=88=B010?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- drivers/external_device_manager/usb/usb_ddk_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/external_device_manager/usb/usb_ddk_types.h b/drivers/external_device_manager/usb/usb_ddk_types.h index 0e32d4a92..808d834f1 100644 --- a/drivers/external_device_manager/usb/usb_ddk_types.h +++ b/drivers/external_device_manager/usb/usb_ddk_types.h @@ -292,7 +292,7 @@ typedef struct UsbDeviceMemMap { /** * @brief Defines error codes for USB DDK. * - * @since 11 + * @since 10 * @version 1.0 */ typedef enum { -- Gitee From 24c8bfd7c75f76bde88e1e2e4a5a70c505693f50 Mon Sep 17 00:00:00 2001 From: liufei Date: Wed, 13 Nov 2024 18:24:07 +0800 Subject: [PATCH 396/620] fix compile error Signed-off-by: liufei Change-Id: I5fdd7d49cb42880b4ae8d8de992ad2e32b2c624c --- .../graphic_2d/native_drawing/drawing_text_typography.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index da9f9a974..59d6488ea 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -40,14 +40,19 @@ * @version 1.0 */ -#include "cstddef" +#ifdef __cplusplus +#include +#include +#else +#include +#include +#endif #include "drawing_canvas.h" #include "drawing_color.h" #include "drawing_font.h" #include "drawing_text_declaration.h" #include "drawing_types.h" -#include "stdint.h" #ifdef __cplusplus extern "C" { -- Gitee From 245f0fa250a404a90c00c124b7c105dbd2c1388e Mon Sep 17 00:00:00 2001 From: shilong Date: Wed, 13 Nov 2024 11:44:33 +0000 Subject: [PATCH 397/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- drivers/external_device_manager/usb/usb_ddk_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/external_device_manager/usb/usb_ddk_api.h b/drivers/external_device_manager/usb/usb_ddk_api.h index 844dea874..1ee732e19 100644 --- a/drivers/external_device_manager/usb/usb_ddk_api.h +++ b/drivers/external_device_manager/usb/usb_ddk_api.h @@ -79,7 +79,7 @@ void OH_Usb_Release(void); * @since 14 * @version 1.0 */ -int32_t OH_Usb_ReleaseSource(void); +int32_t OH_Usb_ReleaseResource(void); /** * @brief Obtains the USB device descriptor. -- Gitee From f43af5a2cd55708f175194616774c5534083ac9f Mon Sep 17 00:00:00 2001 From: shilong Date: Thu, 14 Nov 2024 01:53:23 +0000 Subject: [PATCH 398/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9hid=5Fddk=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- drivers/external_device_manager/hid/hid_ddk_api.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/external_device_manager/hid/hid_ddk_api.h b/drivers/external_device_manager/hid/hid_ddk_api.h index ac9336efd..38cb31b71 100644 --- a/drivers/external_device_manager/hid/hid_ddk_api.h +++ b/drivers/external_device_manager/hid/hid_ddk_api.h @@ -83,8 +83,7 @@ int32_t OH_Hid_CreateDevice(Hid_Device *hidDevice, Hid_EventProperties *hidEvent * {@link HID_DDK_INVALID_OPERATION} connect hid ddk service failed or the caller is not the creator of device. * {@link HID_DDK_INVALID_PARAMETER} parameter check failed. Possible causes: 1.deviceId is less than 0;\n * 2.length exceeds 7; 3.items is null. - * {@link HID_DDK_NULL_PTR} the inject of device is null. - * {@link HID_DDK_FAILURE} the device does not exit. + * {@link HID_DDK_NULL_PTR} the device does not exit. * @since 11 * @version 1.0 */ @@ -98,7 +97,6 @@ int32_t OH_Hid_EmitEvent(int32_t deviceId, const Hid_EmitItem items[], uint16_t * @return {@link HID_DDK_SUCCESS} operation successful. * {@link HID_DDK_NO_PERM} permission check failed. * {@link HID_DDK_INVALID_OPERATION} connect hid ddk service failed or the caller is not the creator of device. - * {@link HID_DDK_FAILURE} the device does not exit. * @since 11 * @version 1.0 */ -- Gitee From f2336b93c8e6a47146d392afec94159ef11f59f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=89=E5=8F=AC=E5=AE=87?= Date: Thu, 14 Nov 2024 01:57:21 +0000 Subject: [PATCH 399/620] update global/resource_management/include/rawfile/raw_dir.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冉召宇 --- global/resource_management/include/rawfile/raw_dir.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global/resource_management/include/rawfile/raw_dir.h b/global/resource_management/include/rawfile/raw_dir.h index 9e4228122..7cc36d691 100644 --- a/global/resource_management/include/rawfile/raw_dir.h +++ b/global/resource_management/include/rawfile/raw_dir.h @@ -31,7 +31,7 @@ * @brief Declares native functions related to raw file directories. * * For example, you can use the functions to traverse and close a raw file directory, and reset its index. - * + * * @syscap SystemCapability.Global.ResourceManager * @library librawfile.z.so * @kit LocalizationKit -- Gitee From dc3a6b7fc7b3bd85dc63ea404affed040ad18647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=89=E5=8F=AC=E5=AE=87?= Date: Thu, 14 Nov 2024 01:57:36 +0000 Subject: [PATCH 400/620] update global/resource_management/include/rawfile/raw_file.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冉召宇 --- global/resource_management/include/rawfile/raw_file.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global/resource_management/include/rawfile/raw_file.h b/global/resource_management/include/rawfile/raw_file.h index 1a0da611f..5616931a6 100644 --- a/global/resource_management/include/rawfile/raw_file.h +++ b/global/resource_management/include/rawfile/raw_file.h @@ -31,7 +31,7 @@ * @brief Declares native functions related to raw file. * * For example, you can use the functions to search for, read, and close raw files. - * + * * @syscap SystemCapability.Global.ResourceManager * @library librawfile.z.so * @kit LocalizationKit -- Gitee From 605adc91b2d598b0b6944d6b2c303aafb43c4fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=89=E5=8F=AC=E5=AE=87?= Date: Thu, 14 Nov 2024 01:57:51 +0000 Subject: [PATCH 401/620] update global/resource_management/include/rawfile/raw_file_manager.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冉召宇 --- global/resource_management/include/rawfile/raw_file_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global/resource_management/include/rawfile/raw_file_manager.h b/global/resource_management/include/rawfile/raw_file_manager.h index 4b1dfb619..6b775fc15 100644 --- a/global/resource_management/include/rawfile/raw_file_manager.h +++ b/global/resource_management/include/rawfile/raw_file_manager.h @@ -31,7 +31,7 @@ * @brief Declares native functions for the resource manager. * * You can use the resource manager to open raw files for subsequent operations, such as seeking and reading. - * + * * @syscap SystemCapability.Global.ResourceManager * @library librawfile.z.so * @kit LocalizationKit -- Gitee From 25a5c0ee4a39f5da5a489559c46f67b51b3385e0 Mon Sep 17 00:00:00 2001 From: shilong Date: Thu, 14 Nov 2024 01:58:09 +0000 Subject: [PATCH 402/620] =?UTF-8?q?exit=20=E4=BF=AE=E6=94=B9=E6=88=90exist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- drivers/external_device_manager/hid/hid_ddk_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/external_device_manager/hid/hid_ddk_api.h b/drivers/external_device_manager/hid/hid_ddk_api.h index 38cb31b71..44f16c804 100644 --- a/drivers/external_device_manager/hid/hid_ddk_api.h +++ b/drivers/external_device_manager/hid/hid_ddk_api.h @@ -83,7 +83,7 @@ int32_t OH_Hid_CreateDevice(Hid_Device *hidDevice, Hid_EventProperties *hidEvent * {@link HID_DDK_INVALID_OPERATION} connect hid ddk service failed or the caller is not the creator of device. * {@link HID_DDK_INVALID_PARAMETER} parameter check failed. Possible causes: 1.deviceId is less than 0;\n * 2.length exceeds 7; 3.items is null. - * {@link HID_DDK_NULL_PTR} the device does not exit. + * {@link HID_DDK_NULL_PTR} the device does not exist. * @since 11 * @version 1.0 */ -- Gitee From e1781c27ea495c3995a59711eb43e2c55153a962 Mon Sep 17 00:00:00 2001 From: l00844999 Date: Tue, 12 Nov 2024 09:14:04 +0800 Subject: [PATCH 403/620] =?UTF-8?q?drawing=E6=95=B4=E6=94=B9=20Signed-off-?= =?UTF-8?q?by:=20l00844999=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../native_drawing/drawing_bitmap.h | 52 ++-- .../graphic_2d/native_drawing/drawing_brush.h | 74 ++--- .../native_drawing/drawing_canvas.h | 281 +++++++++--------- .../graphic_2d/native_drawing/drawing_color.h | 6 +- .../native_drawing/drawing_color_filter.h | 24 +- .../native_drawing/drawing_color_space.h | 10 +- .../native_drawing/drawing_error_code.h | 6 +- .../native_drawing/drawing_filter.h | 34 +-- .../graphic_2d/native_drawing/drawing_font.h | 130 ++++---- .../native_drawing/drawing_gpu_context.h | 14 +- .../graphic_2d/native_drawing/drawing_image.h | 30 +- .../native_drawing/drawing_image_filter.h | 25 +- .../native_drawing/drawing_mask_filter.h | 10 +- .../native_drawing/drawing_matrix.h | 89 +++--- .../native_drawing/drawing_memory_stream.h | 10 +- .../graphic_2d/native_drawing/drawing_path.h | 175 +++++------ .../native_drawing/drawing_path_effect.h | 10 +- .../graphic_2d/native_drawing/drawing_pen.h | 126 ++++---- .../native_drawing/drawing_pixel_map.h | 18 +- .../graphic_2d/native_drawing/drawing_point.h | 10 +- .../native_drawing/drawing_record_cmd.h | 8 +- .../graphic_2d/native_drawing/drawing_rect.h | 37 +-- .../native_drawing/drawing_region.h | 18 +- .../native_drawing/drawing_round_rect.h | 25 +- .../native_drawing/drawing_sampling_options.h | 17 +- .../native_drawing/drawing_shader_effect.h | 52 ++-- .../native_drawing/drawing_shadow_layer.h | 10 +- .../native_drawing/drawing_surface.h | 22 +- .../native_drawing/drawing_text_blob.h | 58 ++-- .../native_drawing/drawing_typeface.h | 14 +- .../graphic_2d/native_drawing/drawing_types.h | 6 +- 31 files changed, 707 insertions(+), 694 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_bitmap.h b/graphic/graphic_2d/native_drawing/drawing_bitmap.h index 5811794fe..95dd825f9 100644 --- a/graphic/graphic_2d/native_drawing/drawing_bitmap.h +++ b/graphic/graphic_2d/native_drawing/drawing_bitmap.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_BITMAP_H -#define C_INCLUDE_DRAWING_BITMAP_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_BITMAP_H +#define C_INCLUDE_DRAWING_BITMAP_H + #include "drawing_types.h" #ifdef __cplusplus @@ -73,114 +73,114 @@ OH_Drawing_Bitmap* OH_Drawing_BitmapCreate(void); * @brief Destroys an OH_Drawing_Bitmap object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param bitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @since 8 * @version 1.0 */ -void OH_Drawing_BitmapDestroy(OH_Drawing_Bitmap*); +void OH_Drawing_BitmapDestroy(OH_Drawing_Bitmap* bitmap); /** * @brief Creates an OH_Drawing_Bitmap object with OH_Drawing_Image_Info object * and sets the mem address or pixel storage. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Image_Info Indicates the pointer to an OH_Drawing_Image_Info object. + * @param imageInfo Indicates the pointer to an OH_Drawing_Image_Info object. * @param pixels the pointer to memory address or pixel storage. * @param rowBytes size of pixel row or larger. * @return Returns the pointer to the OH_Drawing_Bitmap object created. * @since 12 * @version 1.0 */ -OH_Drawing_Bitmap* OH_Drawing_BitmapCreateFromPixels(OH_Drawing_Image_Info*, void* pixels, uint32_t rowBytes); +OH_Drawing_Bitmap* OH_Drawing_BitmapCreateFromPixels(OH_Drawing_Image_Info* imageInfo, void* pixels, uint32_t rowBytes); /** * @brief Initializes the width and height of an OH_Drawing_Bitmap object * and sets the pixel format for the bitmap. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param bitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @param width Indicates the width of the bitmap to be initialized. * @param height Indicates the height of the bitmap to be initialized. - * @param OH_Drawing_BitmapFormat Indicates the pixel format of the bitmap to be initialized, + * @param bitmapFormat Indicates the pixel format of the bitmap to be initialized, * including the pixel color type and alpha type. * @since 8 * @version 1.0 */ -void OH_Drawing_BitmapBuild( - OH_Drawing_Bitmap*, const uint32_t width, const uint32_t height, const OH_Drawing_BitmapFormat*); +void OH_Drawing_BitmapBuild(OH_Drawing_Bitmap* bitmap, + const uint32_t width, const uint32_t height, const OH_Drawing_BitmapFormat* bitmapFormat); /** * @brief Obtains the width of a bitmap. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param bitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @return Returns the width. * @since 8 * @version 1.0 */ -uint32_t OH_Drawing_BitmapGetWidth(OH_Drawing_Bitmap*); +uint32_t OH_Drawing_BitmapGetWidth(OH_Drawing_Bitmap* bitmap); /** * @brief Obtains the height of a bitmap. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param bitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @return Returns the height. * @since 8 * @version 1.0 */ -uint32_t OH_Drawing_BitmapGetHeight(OH_Drawing_Bitmap*); +uint32_t OH_Drawing_BitmapGetHeight(OH_Drawing_Bitmap* bitmap); /** * @brief Obtains the color format of a bitmap. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param bitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @return Returns the bitmap color format. * @since 12 * @version 1.0 */ -OH_Drawing_ColorFormat OH_Drawing_BitmapGetColorFormat(OH_Drawing_Bitmap*); +OH_Drawing_ColorFormat OH_Drawing_BitmapGetColorFormat(OH_Drawing_Bitmap* bitmap); /** * @brief Obtains the alpha format of a bitmap. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param bitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @return Returns the bitmap alpha format. * @since 12 * @version 1.0 */ -OH_Drawing_AlphaFormat OH_Drawing_BitmapGetAlphaFormat(OH_Drawing_Bitmap*); +OH_Drawing_AlphaFormat OH_Drawing_BitmapGetAlphaFormat(OH_Drawing_Bitmap* bitmap); /** * @brief Obtains the pixel address of a bitmap. You can use this address to obtain the pixel data of the bitmap. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param bitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @return Returns the pixel address. * @since 8 * @version 1.0 */ -void* OH_Drawing_BitmapGetPixels(OH_Drawing_Bitmap*); +void* OH_Drawing_BitmapGetPixels(OH_Drawing_Bitmap* bitmap); /** * @brief Gets the image info. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. - * @param OH_Drawing_Image_Info Indicates the pointer to an OH_Drawing_Image_Info object. + * @param bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param imageInfo Indicates the pointer to an OH_Drawing_Image_Info object. * @since 12 * @version 1.0 */ -void OH_Drawing_BitmapGetImageInfo(OH_Drawing_Bitmap*, OH_Drawing_Image_Info*); +void OH_Drawing_BitmapGetImageInfo(OH_Drawing_Bitmap* bitmap, OH_Drawing_Image_Info* imageInfo); /** * @brief Copies a rect of pixels from bitmap to dstPixels. Copy starts at (srcX, srcY), * and does not exceed bitmap width and height. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param bitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @param dstInfo Indicates the pointer to an OH_Drawing_Image_Info object. * @param dstPixels Destination pixel storage. * @param dstRowBytes Destination row length. @@ -190,7 +190,7 @@ void OH_Drawing_BitmapGetImageInfo(OH_Drawing_Bitmap*, OH_Drawing_Image_Info*); * @since 12 * @version 1.0 */ -bool OH_Drawing_BitmapReadPixels(OH_Drawing_Bitmap*, const OH_Drawing_Image_Info* dstInfo, +bool OH_Drawing_BitmapReadPixels(OH_Drawing_Bitmap* bitmap, const OH_Drawing_Image_Info* dstInfo, void* dstPixels, size_t dstRowBytes, int32_t srcX, int32_t srcY); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_brush.h b/graphic/graphic_2d/native_drawing/drawing_brush.h index 1762a979b..d677d9aec 100644 --- a/graphic/graphic_2d/native_drawing/drawing_brush.h +++ b/graphic/graphic_2d/native_drawing/drawing_brush.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_BRUSH_H -#define C_INCLUDE_DRAWING_BRUSH_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_BRUSH_H +#define C_INCLUDE_DRAWING_BRUSH_H + #include "drawing_types.h" #ifdef __cplusplus @@ -60,158 +60,158 @@ OH_Drawing_Brush* OH_Drawing_BrushCreate(void); * @brief Creates an OH_Drawing_Brush copy object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. * @return Returns the pointer to the OH_Drawing_Brush object created. * If nullptr is returned, the creation fails. * The possible cause of the failure is that the available memory is empty or a nullptr is passed. * @since 12 * @version 1.0 */ -OH_Drawing_Brush* OH_Drawing_BrushCopy(OH_Drawing_Brush*); +OH_Drawing_Brush* OH_Drawing_BrushCopy(OH_Drawing_Brush* brush); /** * @brief Destroys an OH_Drawing_Brush object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. * @since 8 * @version 1.0 */ -void OH_Drawing_BrushDestroy(OH_Drawing_Brush*); +void OH_Drawing_BrushDestroy(OH_Drawing_Brush* brush); /** * @brief Checks whether anti-aliasing is enabled for a brush. If anti-aliasing is enabled, * edges will be drawn with partial transparency. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. * @return Returns true if anti-aliasing is enabled; returns false otherwise. * @since 8 * @version 1.0 */ -bool OH_Drawing_BrushIsAntiAlias(const OH_Drawing_Brush*); +bool OH_Drawing_BrushIsAntiAlias(const OH_Drawing_Brush* brush); /** * @brief Enables or disables anti-aliasing for a brush. If anti-aliasing is enabled, * edges will be drawn with partial transparency. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. - * @param bool Specifies whether to enable anti-aliasing. The value true means + * @param brush Indicates the pointer to an OH_Drawing_Brush object. + * @param antiAlias Specifies whether to enable anti-aliasing. The value true means * to enable anti-aliasing, and false means the opposite. * @since 8 * @version 1.0 */ -void OH_Drawing_BrushSetAntiAlias(OH_Drawing_Brush*, bool); +void OH_Drawing_BrushSetAntiAlias(OH_Drawing_Brush* brush, bool antiAlias); /** * @brief Obtains the color of a brush. The color is used by the brush to fill in a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. * @return Returns a 32-bit (ARGB) variable that describes the color. * @since 8 * @version 1.0 */ -uint32_t OH_Drawing_BrushGetColor(const OH_Drawing_Brush*); +uint32_t OH_Drawing_BrushGetColor(const OH_Drawing_Brush* brush); /** * @brief Sets the color for a brush. The color will be used by the brush to fill in a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. * @param color Indicates the color to set, which is a 32-bit (ARGB) variable. * @since 8 * @version 1.0 */ -void OH_Drawing_BrushSetColor(OH_Drawing_Brush*, uint32_t color); +void OH_Drawing_BrushSetColor(OH_Drawing_Brush* brush, uint32_t color); /** * @brief Obtains the alpha of a brush. The alpha is used by the brush to fill in a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. * @return Returns a 8-bit variable that describes the alpha. * @since 11 * @version 1.0 */ -uint8_t OH_Drawing_BrushGetAlpha(const OH_Drawing_Brush*); +uint8_t OH_Drawing_BrushGetAlpha(const OH_Drawing_Brush* brush); /** * @brief Sets the alpha for a brush. The alpha will be used by the brush to fill in a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. * @param alpha Indicates the alpha to set, which is a 8-bit variable. * @since 11 * @version 1.0 */ -void OH_Drawing_BrushSetAlpha(OH_Drawing_Brush*, uint8_t alpha); +void OH_Drawing_BrushSetAlpha(OH_Drawing_Brush* brush, uint8_t alpha); /** * @brief Sets the shaderEffect for a brush. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. - * @param OH_Drawing_ShaderEffect Indicates the pointer to an OH_Drawing_ShaderEffect object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. + * @param shaderEffect Indicates the pointer to an OH_Drawing_ShaderEffect object. * @since 11 * @version 1.0 */ -void OH_Drawing_BrushSetShaderEffect(OH_Drawing_Brush*, OH_Drawing_ShaderEffect*); +void OH_Drawing_BrushSetShaderEffect(OH_Drawing_Brush* brush, OH_Drawing_ShaderEffect* shaderEffect); /** * @brief Sets the shadowLayer for a brush. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. - * @param OH_Drawing_ShadowLayer Indicates the pointer to an OH_Drawing_ShadowLayer object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. + * @param shadowLayer Indicates the pointer to an OH_Drawing_ShadowLayer object. * @since 12 * @version 1.0 */ -void OH_Drawing_BrushSetShadowLayer(OH_Drawing_Brush*, OH_Drawing_ShadowLayer*); +void OH_Drawing_BrushSetShadowLayer(OH_Drawing_Brush* brush, OH_Drawing_ShadowLayer* shadowLayer); /** * @brief Sets the filter for a brush. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. - * @param OH_Drawing_Filter Indicates the pointer to an OH_Drawing_Filter object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. + * @param filter Indicates the pointer to an OH_Drawing_Filter object. * @since 11 * @version 1.0 */ -void OH_Drawing_BrushSetFilter(OH_Drawing_Brush*, OH_Drawing_Filter*); +void OH_Drawing_BrushSetFilter(OH_Drawing_Brush* brush, OH_Drawing_Filter* filter); /** * @brief Gets the filter from a brush. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. - * @param OH_Drawing_Filter Indicates the pointer to an OH_Drawing_Filter object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. + * @param filter Indicates the pointer to an OH_Drawing_Filter object. * @since 12 * @version 1.0 */ -void OH_Drawing_BrushGetFilter(OH_Drawing_Brush*, OH_Drawing_Filter*); +void OH_Drawing_BrushGetFilter(OH_Drawing_Brush* brush, OH_Drawing_Filter* filter); /** * @brief Sets a blender that implements the specified blendmode enum for a brush. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Brush object. - * @param OH_Drawing_BlendMode Indicates the blend mode. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. + * @param blendMode Indicates the blend mode. * @since 12 * @version 1.0 */ -void OH_Drawing_BrushSetBlendMode(OH_Drawing_Brush*, OH_Drawing_BlendMode); +void OH_Drawing_BrushSetBlendMode(OH_Drawing_Brush* brush, OH_Drawing_BlendMode blendMode); /** * @brief Resets all brush contents to their initial values. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. * @since 12 * @version 1.0 */ -void OH_Drawing_BrushReset(OH_Drawing_Brush*); +void OH_Drawing_BrushReset(OH_Drawing_Brush* brush); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_canvas.h b/graphic/graphic_2d/native_drawing/drawing_canvas.h index f78e6127f..5a1de3d15 100644 --- a/graphic/graphic_2d/native_drawing/drawing_canvas.h +++ b/graphic/graphic_2d/native_drawing/drawing_canvas.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_H -#define C_INCLUDE_DRAWING_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_H +#define C_INCLUDE_DRAWING_H + #include "drawing_error_code.h" #include "drawing_types.h" @@ -78,128 +78,128 @@ OH_Drawing_Canvas* OH_Drawing_CanvasCreate(void); * @brief Destroys an OH_Drawing_Canvas object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @since 8 * @version 1.0 */ -void OH_Drawing_CanvasDestroy(OH_Drawing_Canvas*); +void OH_Drawing_CanvasDestroy(OH_Drawing_Canvas* canvas); /** * @brief Binds a bitmap to a canvas so that the content drawn on the canvas * is output to the bitmap (this process is called CPU rendering). * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param bitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @since 8 * @version 1.0 */ -void OH_Drawing_CanvasBind(OH_Drawing_Canvas*, OH_Drawing_Bitmap*); +void OH_Drawing_CanvasBind(OH_Drawing_Canvas* canvas, OH_Drawing_Bitmap* bitmap); /** * @brief Attaches a pen to a canvas so that the canvas will use the style and color of the pen to outline a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @since 8 * @version 1.0 */ -void OH_Drawing_CanvasAttachPen(OH_Drawing_Canvas*, const OH_Drawing_Pen*); +void OH_Drawing_CanvasAttachPen(OH_Drawing_Canvas* canvas, const OH_Drawing_Pen* pen); /** * @brief Detaches the pen from a canvas so that the canvas will not use the style * and color of the pen to outline a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @since 8 * @version 1.0 */ -void OH_Drawing_CanvasDetachPen(OH_Drawing_Canvas*); +void OH_Drawing_CanvasDetachPen(OH_Drawing_Canvas* canvas); /** * @brief Attaches a brush to a canvas so that the canvas will use the style and color of the brush to fill in a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. * @since 8 * @version 1.0 */ -void OH_Drawing_CanvasAttachBrush(OH_Drawing_Canvas*, const OH_Drawing_Brush*); +void OH_Drawing_CanvasAttachBrush(OH_Drawing_Canvas* canvas, const OH_Drawing_Brush* brush); /** * @brief Detaches the brush from a canvas so that the canvas will not use the style * and color of the brush to fill in a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @since 8 * @version 1.0 */ -void OH_Drawing_CanvasDetachBrush(OH_Drawing_Canvas*); +void OH_Drawing_CanvasDetachBrush(OH_Drawing_Canvas* canvas); /** * @brief Saves the current canvas status (canvas matrix) to the top of the stack. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @since 8 * @version 1.0 */ -void OH_Drawing_CanvasSave(OH_Drawing_Canvas*); +void OH_Drawing_CanvasSave(OH_Drawing_Canvas* canvas); /** * @brief Saves matrix and clip, and allocates a bitmap for subsequent drawing. * Calling restore discards changes to matrix and clip, and draws the bitmap. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasSaveLayer(OH_Drawing_Canvas*, const OH_Drawing_Rect*, const OH_Drawing_Brush*); +void OH_Drawing_CanvasSaveLayer(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect, const OH_Drawing_Brush* brush); /** * @brief Restores the canvas status (canvas matrix) saved on the top of the stack. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @since 8 * @version 1.0 */ -void OH_Drawing_CanvasRestore(OH_Drawing_Canvas*); +void OH_Drawing_CanvasRestore(OH_Drawing_Canvas* canvas); /** * @brief Gets the number of the canvas status (canvas matrix) saved in the stack. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @return Returns a 32-bit variable that describes the number of canvas status. * @since 11 * @version 1.0 */ -uint32_t OH_Drawing_CanvasGetSaveCount(OH_Drawing_Canvas*); +uint32_t OH_Drawing_CanvasGetSaveCount(OH_Drawing_Canvas* canvas); /** * @brief Restores the specific number of the canvas status (canvas matrix) saved in the stack. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @param saveCount Indicates the specific number of canvas status. * @since 11 * @version 1.0 */ -void OH_Drawing_CanvasRestoreToCount(OH_Drawing_Canvas*, uint32_t saveCount); +void OH_Drawing_CanvasRestoreToCount(OH_Drawing_Canvas* canvas, uint32_t saveCount); /** * @brief Draws a line segment. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @param x1 Indicates the x coordinate of the start point of the line segment. * @param y1 Indicates the y coordinate of the start point of the line segment. * @param x2 Indicates the x coordinate of the end point of the line segment. @@ -207,55 +207,55 @@ void OH_Drawing_CanvasRestoreToCount(OH_Drawing_Canvas*, uint32_t saveCount); * @since 8 * @version 1.0 */ -void OH_Drawing_CanvasDrawLine(OH_Drawing_Canvas*, float x1, float y1, float x2, float y2); +void OH_Drawing_CanvasDrawLine(OH_Drawing_Canvas* canvas, float x1, float y1, float x2, float y2); /** * @brief Draws a path. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @since 8 * @version 1.0 */ -void OH_Drawing_CanvasDrawPath(OH_Drawing_Canvas*, const OH_Drawing_Path*); +void OH_Drawing_CanvasDrawPath(OH_Drawing_Canvas* canvas, const OH_Drawing_Path* path); /** * @brief Draw the specified area of the Media::PixelMap to the specified area of the canvas. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_PixelMap Indicates the pointer to an OH_Drawing_PixelMap object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param pixelMap Indicates the pointer to an OH_Drawing_PixelMap object. * @param src the area of source pixelmap. * @param dst the area of destination canvas. - * @param OH_Drawing_SamplingOptions the sampling mode. + * @param samplingOptions the sampling mode. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasDrawPixelMapRect(OH_Drawing_Canvas*, OH_Drawing_PixelMap*, const OH_Drawing_Rect* src, - const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions*); +void OH_Drawing_CanvasDrawPixelMapRect(OH_Drawing_Canvas* canvas, OH_Drawing_PixelMap* pixelMap, + const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions* samplingOptions); /** * @brief Fills clipped canvas area with brush. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param brush Indicates the pointer to an OH_Drawing_Brush object. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasDrawBackground(OH_Drawing_Canvas*, const OH_Drawing_Brush*); +void OH_Drawing_CanvasDrawBackground(OH_Drawing_Canvas* canvas, const OH_Drawing_Brush* brush); /** * @brief Draws region using clip, matrix and paint. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Region Indicates the pointer to an OH_Drawing_Region object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param region Indicates the pointer to an OH_Drawing_Region object. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasDrawRegion(OH_Drawing_Canvas*, const OH_Drawing_Region*); +void OH_Drawing_CanvasDrawRegion(OH_Drawing_Canvas* canvas, const OH_Drawing_Region* region); /** * @brief Enumerates of scale to fit flags, selects if an array of points are drawn as discrete points, as lines, @@ -297,66 +297,66 @@ OH_Drawing_ErrorCode OH_Drawing_CanvasDrawPoint(OH_Drawing_Canvas* canvas, const * @brief Draws point array as separate point, line segment or open polygon according to given point mode. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @param mode Draw points enum. * @param count The point count. - * @param OH_Drawing_Point2D Point struct array. + * @param point2D Point struct array. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasDrawPoints(OH_Drawing_Canvas*, OH_Drawing_PointMode mode, - uint32_t count, const OH_Drawing_Point2D*); +void OH_Drawing_CanvasDrawPoints(OH_Drawing_Canvas* canvas, OH_Drawing_PointMode mode, + uint32_t count, const OH_Drawing_Point2D* point2D); /** * @brief Draws a bitmap. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param bitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @param left Indicates the left position of the OH_Drawing_Bitmap. * @param top Indicates the top position of the OH_Drawing_Bitmap. * @since 11 * @version 1.0 */ -void OH_Drawing_CanvasDrawBitmap(OH_Drawing_Canvas*, const OH_Drawing_Bitmap*, float left, float top); +void OH_Drawing_CanvasDrawBitmap(OH_Drawing_Canvas* canvas, const OH_Drawing_Bitmap* bitmap, float left, float top); /** * @brief Draw the specified area of the bitmap to the specified area of the canvas. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param bitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @param src the area of source bitmap, can be nullptr. * @param dst the area of destination canvas. - * @param OH_Drawing_SamplingOptions the sampling mode. + * @param samplingOptions the sampling mode. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasDrawBitmapRect(OH_Drawing_Canvas*, const OH_Drawing_Bitmap*, const OH_Drawing_Rect* src, - const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions*); +void OH_Drawing_CanvasDrawBitmapRect(OH_Drawing_Canvas* canvas, const OH_Drawing_Bitmap* bitmap, + const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions* samplingOptions); /** * @brief Draws a rect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @since 11 * @version 1.0 */ -void OH_Drawing_CanvasDrawRect(OH_Drawing_Canvas*, const OH_Drawing_Rect*); +void OH_Drawing_CanvasDrawRect(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect); /** * @brief Draws a circle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Point Indicates the pointer to an OH_Drawing_Point object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param point Indicates the pointer to an OH_Drawing_Point object. * @param radius Indicates the radius of the circle. * @since 11 * @version 1.0 */ -void OH_Drawing_CanvasDrawCircle(OH_Drawing_Canvas*, const OH_Drawing_Point*, float radius); +void OH_Drawing_CanvasDrawCircle(OH_Drawing_Canvas* canvas, const OH_Drawing_Point* point, float radius); /** * @brief Fills the entire canvas with the specified color and blend mode. @@ -378,44 +378,45 @@ OH_Drawing_ErrorCode OH_Drawing_CanvasDrawColor(OH_Drawing_Canvas* canvas, uint3 * @brief Draws an oval. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @since 11 * @version 1.0 */ -void OH_Drawing_CanvasDrawOval(OH_Drawing_Canvas*, const OH_Drawing_Rect*); +void OH_Drawing_CanvasDrawOval(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect); /** * @brief Draws an arc. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @param startAngle Indicates the startAngle of the arc. * @param sweepAngle Indicates the sweepAngle of the arc. * @since 11 * @version 1.0 */ -void OH_Drawing_CanvasDrawArc(OH_Drawing_Canvas*, const OH_Drawing_Rect*, float startAngle, float sweepAngle); +void OH_Drawing_CanvasDrawArc(OH_Drawing_Canvas* canvas, + const OH_Drawing_Rect* rect, float startAngle, float sweepAngle); /** * @brief Draws a roundrect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_RoundRect Indicates the pointer to an OH_Drawing_RoundRect object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param roundRect Indicates the pointer to an OH_Drawing_RoundRect object. * @since 11 * @version 1.0 */ -void OH_Drawing_CanvasDrawRoundRect(OH_Drawing_Canvas*, const OH_Drawing_RoundRect*); +void OH_Drawing_CanvasDrawRoundRect(OH_Drawing_Canvas* canvas, const OH_Drawing_RoundRect* roundRect); /** * @brief Draws a single character. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @param str Indicates the single character encoded in UTF-8. - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @param x Indicates the horizontal offset applied to the single character. * @param y Indicates the vertical offset applied to the single character. * @return Returns the error code. @@ -432,14 +433,14 @@ OH_Drawing_ErrorCode OH_Drawing_CanvasDrawSingleCharacter(OH_Drawing_Canvas* can * @brief Draws a textblob. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_TextBlob Indicates the pointer to an OH_Drawing_TextBlob object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param textBlob Indicates the pointer to an OH_Drawing_TextBlob object. * @param x Indicates the horizontal offset applied to blob. * @param y Indicates the vertical offset applied to blob. * @since 11 * @version 1.0 */ -void OH_Drawing_CanvasDrawTextBlob(OH_Drawing_Canvas*, const OH_Drawing_TextBlob*, float x, float y); +void OH_Drawing_CanvasDrawTextBlob(OH_Drawing_Canvas* canvas, const OH_Drawing_TextBlob* textBlob, float x, float y); /** * @brief Enumerates clip op. @@ -462,42 +463,42 @@ typedef enum { * @brief Clip a rect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @param clipOp Indicates the operation to apply to clip. * @param doAntiAlias Indicates whether clip operation requires anti-aliased. * @since 11 * @version 1.0 */ -void OH_Drawing_CanvasClipRect(OH_Drawing_Canvas*, const OH_Drawing_Rect*, +void OH_Drawing_CanvasClipRect(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect, OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias); /** * @brief Clip a round rect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_RoundRect Indicates the pointer to an OH_Drawing_RoundRect object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param roundRect Indicates the pointer to an OH_Drawing_RoundRect object. * @param clipOp Indicates the operation to apply to clip. * @param doAntiAlias Indicates whether clip operation requires anti-aliased. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasClipRoundRect(OH_Drawing_Canvas*, const OH_Drawing_RoundRect*, +void OH_Drawing_CanvasClipRoundRect(OH_Drawing_Canvas* canvas, const OH_Drawing_RoundRect* roundRect, OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias); /** * @brief Clip a path. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param clipOp Indicates the operation to apply to clip. * @param doAntiAlias Indicates whether clip operation requires anti-aliased. * @since 11 * @version 1.0 */ -void OH_Drawing_CanvasClipPath(OH_Drawing_Canvas*, const OH_Drawing_Path*, +void OH_Drawing_CanvasClipPath(OH_Drawing_Canvas* canvas, const OH_Drawing_Path* path, OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias); /** @@ -520,104 +521,104 @@ OH_Drawing_ErrorCode OH_Drawing_CanvasClipRegion(OH_Drawing_Canvas* canvas, cons * @brief Rotates by degrees. Positive degrees rotates clockwise. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @param degrees Indicates the amount to rotate, in degrees. * @param px Indicates the x-axis value of the point to rotate about. * @param py Indicates the y-axis value of the point to rotate about. * @since 11 * @version 1.0 */ -void OH_Drawing_CanvasRotate(OH_Drawing_Canvas*, float degrees, float px, float py); +void OH_Drawing_CanvasRotate(OH_Drawing_Canvas* canvas, float degrees, float px, float py); /** * @brief Translates by dx along the x-axis and dy along the y-axis. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @param dx Indicates the distance to translate on x-axis. * @param dy Indicates the distance to translate on y-axis. * @since 11 * @version 1.0 */ -void OH_Drawing_CanvasTranslate(OH_Drawing_Canvas*, float dx, float dy); +void OH_Drawing_CanvasTranslate(OH_Drawing_Canvas* canvas, float dx, float dy); /** * @brief Scales by sx on the x-axis and sy on the y-axis. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @param sx Indicates the amount to scale on x-axis. * @param sy Indicates the amount to scale on y-axis. * @since 11 * @version 1.0 */ -void OH_Drawing_CanvasScale(OH_Drawing_Canvas*, float sx, float sy); +void OH_Drawing_CanvasScale(OH_Drawing_Canvas* canvas, float sx, float sy); /** * @brief Skew by sx on the x-axis and sy on the y-axis. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @param sx Indicates the amount to skew on x-axis. * @param sy Indicates the amount to skew on y-axis. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasSkew(OH_Drawing_Canvas*, float sx, float sy); +void OH_Drawing_CanvasSkew(OH_Drawing_Canvas* canvas, float sx, float sy); /** * @brief Get the width of a canvas. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @since 12 * @version 1.0 */ -int32_t OH_Drawing_CanvasGetWidth(OH_Drawing_Canvas*); +int32_t OH_Drawing_CanvasGetWidth(OH_Drawing_Canvas* canvas); /** * @brief Get the height of a canvas. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @since 12 * @version 1.0 */ -int32_t OH_Drawing_CanvasGetHeight(OH_Drawing_Canvas*); +int32_t OH_Drawing_CanvasGetHeight(OH_Drawing_Canvas* canvas); /** * @brief Get the bounds of clip of a canvas. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasGetLocalClipBounds(OH_Drawing_Canvas*, OH_Drawing_Rect*); +void OH_Drawing_CanvasGetLocalClipBounds(OH_Drawing_Canvas* canvas, OH_Drawing_Rect* rect); /** * @brief Get a 3x3 matrix of the transform from local coordinates to 'device'. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasGetTotalMatrix(OH_Drawing_Canvas*, OH_Drawing_Matrix*); +void OH_Drawing_CanvasGetTotalMatrix(OH_Drawing_Canvas* canvas, OH_Drawing_Matrix* matrix); /** * @brief Use the passed matrix to transforming the geometry, then use existing matrix. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object, + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object, * represents the matrix which is passed. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasConcatMatrix(OH_Drawing_Canvas*, OH_Drawing_Matrix*); +void OH_Drawing_CanvasConcatMatrix(OH_Drawing_Canvas* canvas, OH_Drawing_Matrix* matrix); /** * @brief Enumerates of shadow flags. @@ -648,8 +649,8 @@ typedef enum { * @brief Use circular light to draw an offset spot shadow and outlining ambient shadow for the given path. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object, use to generate shadows. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param path Indicates the pointer to an OH_Drawing_Path object, use to generate shadows. * @param planeParams Represents the value of the function which returns Z offset of the occluder from the * canvas based on x and y. * @param devLightPos Represents the position of the light relative to the canvas. @@ -660,7 +661,7 @@ typedef enum { * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasDrawShadow(OH_Drawing_Canvas*, OH_Drawing_Path*, OH_Drawing_Point3D planeParams, +void OH_Drawing_CanvasDrawShadow(OH_Drawing_Canvas* canvas, OH_Drawing_Path* path, OH_Drawing_Point3D planeParams, OH_Drawing_Point3D devLightPos, float lightRadius, uint32_t ambientColor, uint32_t spotColor, OH_Drawing_CanvasShadowFlags flag); @@ -668,66 +669,66 @@ void OH_Drawing_CanvasDrawShadow(OH_Drawing_Canvas*, OH_Drawing_Path*, OH_Drawin * @brief Clears a canvas by using a specified color. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @param color Indicates the color, which is a 32-bit (ARGB) variable. * @since 8 * @version 1.0 */ -void OH_Drawing_CanvasClear(OH_Drawing_Canvas*, uint32_t color); +void OH_Drawing_CanvasClear(OH_Drawing_Canvas* canvas, uint32_t color); /** * @brief Sets matrix of canvas. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasSetMatrix(OH_Drawing_Canvas*, OH_Drawing_Matrix*); +void OH_Drawing_CanvasSetMatrix(OH_Drawing_Canvas* canvas, OH_Drawing_Matrix* matrix); /** * @brief Reset matrix to the idenmtity matrix, any prior matrix state is overwritten. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasResetMatrix(OH_Drawing_Canvas*); +void OH_Drawing_CanvasResetMatrix(OH_Drawing_Canvas* canvas); /** * @brief Draws the specified source rectangle of the image onto the canvas, * scaled and translated to the destination rectangle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Image Indicates the pointer to an OH_Drawing_Image object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param image Indicates the pointer to an OH_Drawing_Image object. * @param src The area of source image. * @param dst The area of destination canvas. - * @param OH_Drawing_SamplingOptions Indicates the pointer to an OH_Drawing_SamplingOptions object. - * @param OH_Drawing_SrcRectConstraint Constraint type. + * @param samplingOptions Indicates the pointer to an OH_Drawing_SamplingOptions object. + * @param srcRectConstraint Constraint type. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasDrawImageRectWithSrc(OH_Drawing_Canvas*, const OH_Drawing_Image*, - const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions*, - OH_Drawing_SrcRectConstraint); +void OH_Drawing_CanvasDrawImageRectWithSrc(OH_Drawing_Canvas* canvas, const OH_Drawing_Image* image, + const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions* samplingOptions, + OH_Drawing_SrcRectConstraint srcRectConstraint); /** * @brief Draws the specified source rectangle of the image onto the canvas, * scaled and translated to the destination rectangle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Image Indicates the pointer to an OH_Drawing_Image object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. - * @param OH_Drawing_SamplingOptions Indicates the pointer to an OH_Drawing_SamplingOptions object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param image Indicates the pointer to an OH_Drawing_Image object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. + * @param samplingOptions Indicates the pointer to an OH_Drawing_SamplingOptions object. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasDrawImageRect(OH_Drawing_Canvas*, OH_Drawing_Image*, - OH_Drawing_Rect* dst, OH_Drawing_SamplingOptions*); +void OH_Drawing_CanvasDrawImageRect(OH_Drawing_Canvas* canvas, OH_Drawing_Image* image, + OH_Drawing_Rect* rect, OH_Drawing_SamplingOptions* samplingOptions); /** * @brief Enumerates of vertices flags. @@ -754,7 +755,7 @@ typedef enum { * @brief Draw a triangular mesh with vertex descriptions. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @param vertexMmode Draw a set of vertices. * @param vertexCount Vertex count. * @param positions Positions data pointer. @@ -762,10 +763,11 @@ typedef enum { * @param colors Color data pointer. * @param indexCount Index count. * @param indices Index data pointer. + * @param mode Blend mode used for drawing. * @since 12 * @version 1.0 */ -void OH_Drawing_CanvasDrawVertices(OH_Drawing_Canvas*, OH_Drawing_VertexMode vertexMmode, +void OH_Drawing_CanvasDrawVertices(OH_Drawing_Canvas* canvas, OH_Drawing_VertexMode vertexMmode, int32_t vertexCount, const OH_Drawing_Point2D* positions, const OH_Drawing_Point2D* texs, const uint32_t* colors, int32_t indexCount, const uint16_t* indices, OH_Drawing_BlendMode mode); @@ -773,8 +775,8 @@ void OH_Drawing_CanvasDrawVertices(OH_Drawing_Canvas*, OH_Drawing_VertexMode ver * @brief Read pixels data from canvas. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Image_Info width, height, colorType, and alphaType of dstPixels. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param imageInfo width, height, colorType, and alphaType of dstPixels. * @param dstPixels destination pixel storage. * @param dstRowBytes size of one row of pixels. * @param srcX offset into canvas writable pixels on x-axis. @@ -783,22 +785,23 @@ void OH_Drawing_CanvasDrawVertices(OH_Drawing_Canvas*, OH_Drawing_VertexMode ver * @since 12 * @version 1.0 */ -bool OH_Drawing_CanvasReadPixels(OH_Drawing_Canvas*, OH_Drawing_Image_Info*, +bool OH_Drawing_CanvasReadPixels(OH_Drawing_Canvas* canvas, OH_Drawing_Image_Info* imageInfo, void* dstPixels, uint32_t dstRowBytes, int32_t srcX, int32_t srcY); /** * @brief Read pixels data to a bitmap from canvas. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param bitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @param srcX offset into canvas writable pixels on x-axis. * @param srcY offset into canvas writable pixels on y-axis. * @return true if pixels are copied to dstBitmap. * @since 12 * @version 1.0 */ -bool OH_Drawing_CanvasReadPixelsToBitmap(OH_Drawing_Canvas*, OH_Drawing_Bitmap*, int32_t srcX, int32_t srcY); +bool OH_Drawing_CanvasReadPixelsToBitmap(OH_Drawing_Canvas* canvas, + OH_Drawing_Bitmap* bitmap, int32_t srcX, int32_t srcY); /** * @brief Checks whether the drawable area is empty. diff --git a/graphic/graphic_2d/native_drawing/drawing_color.h b/graphic/graphic_2d/native_drawing/drawing_color.h index cb1b27e10..0f71c8873 100644 --- a/graphic/graphic_2d/native_drawing/drawing_color.h +++ b/graphic/graphic_2d/native_drawing/drawing_color.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_COLOR_H -#define C_INCLUDE_DRAWING_COLOR_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_COLOR_H +#define C_INCLUDE_DRAWING_COLOR_H + #include "drawing_types.h" #ifdef __cplusplus diff --git a/graphic/graphic_2d/native_drawing/drawing_color_filter.h b/graphic/graphic_2d/native_drawing/drawing_color_filter.h index 98907ba17..051ef91bd 100644 --- a/graphic/graphic_2d/native_drawing/drawing_color_filter.h +++ b/graphic/graphic_2d/native_drawing/drawing_color_filter.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_COLOR_FILTER_H -#define C_INCLUDE_DRAWING_COLOR_FILTER_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_COLOR_FILTER_H +#define C_INCLUDE_DRAWING_COLOR_FILTER_H + #include "drawing_types.h" #ifdef __cplusplus @@ -51,25 +51,25 @@ extern "C" { * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param color Indicates the color, which is a 32-bit (ARGB) variable. - * @param OH_Drawing_BlendMode Indicates the blend mode. + * @param blendMode Indicates the blend mode. * @return Returns the pointer to the OH_Drawing_ColorFilter object created. * @since 11 * @version 1.0 */ -OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateBlendMode(uint32_t color, OH_Drawing_BlendMode); +OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateBlendMode(uint32_t color, OH_Drawing_BlendMode blendMode); /** - * @brief Creates an OH_Drawing_ColorFilter applies the colorFilter1 and then applies colorFilter2. + * @brief Creates an OH_Drawing_ColorFilter applies the outerColorFilter and then applies innerColorFilter. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_ColorFilter Indicates the pointer to an OH_Drawing_ColorFilter object. - * @param OH_Drawing_ColorFilter Indicates the pointer to an OH_Drawing_ColorFilter object. + * @param outerColorFilter Indicates the pointer to an OH_Drawing_ColorFilter object. + * @param innerColorFilter Indicates the pointer to an OH_Drawing_ColorFilter object. * @return Returns the pointer to the OH_Drawing_ColorFilter object created. * @since 11 * @version 1.0 */ -OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateCompose(OH_Drawing_ColorFilter* colorFilter1, - OH_Drawing_ColorFilter* colorFilter2); +OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateCompose(OH_Drawing_ColorFilter* outerColorFilter, + OH_Drawing_ColorFilter* innerColorFilter); /** * @brief Creates an OH_Drawing_ColorFilter with a 5x4 color matrix. @@ -117,11 +117,11 @@ OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateLuma(void); * @brief Destroys an OH_Drawing_ColorFilter object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_ColorFilter Indicates the pointer to an OH_Drawing_ColorFilter object. + * @param colorFilter Indicates the pointer to an OH_Drawing_ColorFilter object. * @since 11 * @version 1.0 */ -void OH_Drawing_ColorFilterDestroy(OH_Drawing_ColorFilter*); +void OH_Drawing_ColorFilterDestroy(OH_Drawing_ColorFilter* colorFilter); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_color_space.h b/graphic/graphic_2d/native_drawing/drawing_color_space.h index c87705cbb..f2a2bc7a6 100755 --- a/graphic/graphic_2d/native_drawing/drawing_color_space.h +++ b/graphic/graphic_2d/native_drawing/drawing_color_space.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_COLOR_SPACE_H -#define C_INCLUDE_DRAWING_COLOR_SPACE_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_COLOR_SPACE_H +#define C_INCLUDE_DRAWING_COLOR_SPACE_H + #include "drawing_types.h" #ifdef __cplusplus @@ -70,11 +70,11 @@ OH_Drawing_ColorSpace* OH_Drawing_ColorSpaceCreateSrgbLinear(void); * @brief Destroy an OH_Drawing_ColorSpace object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_ColorSpace Indicates the pointer to an OH_Drawing_ColorSpace object. + * @param colorSpace Indicates the pointer to an OH_Drawing_ColorSpace object. * @since 12 * @version 1.0 */ -void OH_Drawing_ColorSpaceDestroy(OH_Drawing_ColorSpace*); +void OH_Drawing_ColorSpaceDestroy(OH_Drawing_ColorSpace* colorSpace); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_error_code.h b/graphic/graphic_2d/native_drawing/drawing_error_code.h index 817c8c614..38e135e3b 100644 --- a/graphic/graphic_2d/native_drawing/drawing_error_code.h +++ b/graphic/graphic_2d/native_drawing/drawing_error_code.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_ERROR_CODE_H -#define C_INCLUDE_DRAWING_ERROR_CODE_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_ERROR_CODE_H +#define C_INCLUDE_DRAWING_ERROR_CODE_H + #ifdef __cplusplus extern "C" { #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_filter.h b/graphic/graphic_2d/native_drawing/drawing_filter.h index a20fe1579..6f0ad102e 100644 --- a/graphic/graphic_2d/native_drawing/drawing_filter.h +++ b/graphic/graphic_2d/native_drawing/drawing_filter.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_FILTER_H -#define C_INCLUDE_DRAWING_FILTER_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_FILTER_H +#define C_INCLUDE_DRAWING_FILTER_H + #include "drawing_types.h" #ifdef __cplusplus @@ -60,55 +60,55 @@ OH_Drawing_Filter* OH_Drawing_FilterCreate(void); * @brief Sets an OH_Drawing_ImageFilter object for an OH_Drawing_Filter object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Filter Indicates the pointer to an OH_Drawing_Filter object. - * @param OH_Drawing_ImageFilter Indicates the pointer to an OH_Drawing_ImageFilter object. + * @param filter Indicates the pointer to an OH_Drawing_Filter object. + * @param imageFilter Indicates the pointer to an OH_Drawing_ImageFilter object. * @since 12 * @version 1.0 */ -void OH_Drawing_FilterSetImageFilter(OH_Drawing_Filter*, OH_Drawing_ImageFilter*); +void OH_Drawing_FilterSetImageFilter(OH_Drawing_Filter* filter, OH_Drawing_ImageFilter* imageFilter); /** * @brief Sets an OH_Drawing_MaskFilter object for an OH_Drawing_Filter object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Filter Indicates the pointer to an OH_Drawing_Filter object. - * @param OH_Drawing_MaskFilter Indicates the pointer to an OH_Drawing_MaskFilter object. + * @param filter Indicates the pointer to an OH_Drawing_Filter object. + * @param maskFilter Indicates the pointer to an OH_Drawing_MaskFilter object. * @since 11 * @version 1.0 */ -void OH_Drawing_FilterSetMaskFilter(OH_Drawing_Filter*, OH_Drawing_MaskFilter*); +void OH_Drawing_FilterSetMaskFilter(OH_Drawing_Filter* filter, OH_Drawing_MaskFilter* maskFilter); /** * @brief Sets an OH_Drawing_ColorFilter object for an OH_Drawing_Filter object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Filter Indicates the pointer to an OH_Drawing_Filter object. - * @param OH_Drawing_ColorFilter Indicates the pointer to an OH_Drawing_ColorFilter object. + * @param filter Indicates the pointer to an OH_Drawing_Filter object. + * @param colorFilter Indicates the pointer to an OH_Drawing_ColorFilter object. * @since 11 * @version 1.0 */ -void OH_Drawing_FilterSetColorFilter(OH_Drawing_Filter*, OH_Drawing_ColorFilter*); +void OH_Drawing_FilterSetColorFilter(OH_Drawing_Filter* filter, OH_Drawing_ColorFilter* colorFilter); /** * @brief Gets an OH_Drawing_ColorFilter object from an OH_Drawing_Filter object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Filter Indicates the pointer to an OH_Drawing_Filter object. - * @param OH_Drawing_ColorFilter Indicates the pointer to an OH_Drawing_ColorFilter object. + * @param filter Indicates the pointer to an OH_Drawing_Filter object. + * @param colorFilter Indicates the pointer to an OH_Drawing_ColorFilter object. * @since 12 * @version 1.0 */ -void OH_Drawing_FilterGetColorFilter(OH_Drawing_Filter*, OH_Drawing_ColorFilter*); +void OH_Drawing_FilterGetColorFilter(OH_Drawing_Filter* filter, OH_Drawing_ColorFilter* colorFilter); /** * @brief Destroys an OH_Drawing_Filter object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Filter Indicates the pointer to an OH_Drawing_Filter object. + * @param filter Indicates the pointer to an OH_Drawing_Filter object. * @since 11 * @version 1.0 */ -void OH_Drawing_FilterDestroy(OH_Drawing_Filter*); +void OH_Drawing_FilterDestroy(OH_Drawing_Filter* filter); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index ca4eac990..528e6943c 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_FONT_H -#define C_INCLUDE_DRAWING_FONT_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_FONT_H +#define C_INCLUDE_DRAWING_FONT_H + #include "drawing_error_code.h" #include "drawing_types.h" @@ -93,131 +93,131 @@ typedef enum { * @brief Sets whether the font baselines and pixels alignment when the transformation matrix is ​​axis aligned. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @param baselineSnap Indicates whether the font baselines and pixels alignment. * @since 12 * @version 1.0 */ -void OH_Drawing_FontSetBaselineSnap(OH_Drawing_Font*, bool baselineSnap); +void OH_Drawing_FontSetBaselineSnap(OH_Drawing_Font* font, bool baselineSnap); /** * @brief Gets whether the font baselines and pixels alignment when the transformation matrix is ​​axis aligned. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @return Returns true if the font baselines and pixels alignment; returns false otherwise. * @since 12 * @version 1.0 */ -bool OH_Drawing_FontIsBaselineSnap(const OH_Drawing_Font*); +bool OH_Drawing_FontIsBaselineSnap(const OH_Drawing_Font* font); /** * @brief Sets whether the font uses sub-pixel rendering. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @param isSubpixel Indicates whether the font uses sub-pixel rendering. * @since 12 * @version 1.0 */ -void OH_Drawing_FontSetSubpixel(OH_Drawing_Font*, bool isSubpixel); +void OH_Drawing_FontSetSubpixel(OH_Drawing_Font* font, bool isSubpixel); /** * @brief Gets whether the font uses sub-pixel rendering. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @return Returns true if the font uses sub-pixel rendering; returns false otherwise. * @since 12 * @version 1.0 */ -bool OH_Drawing_FontIsSubpixel(const OH_Drawing_Font*); +bool OH_Drawing_FontIsSubpixel(const OH_Drawing_Font* font); /** * @brief Sets whether the font outline is automatically adjusted. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @param isForceAutoHinting Indicates whether the font outline is automatically adjusted. * @since 12 * @version 1.0 */ -void OH_Drawing_FontSetForceAutoHinting(OH_Drawing_Font*, bool isForceAutoHinting); +void OH_Drawing_FontSetForceAutoHinting(OH_Drawing_Font* font, bool isForceAutoHinting); /** * @brief Gets whether the font outline is automatically adjusted. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @return Returns true if the font outline is automatically adjusted; returns false otherwise. * @since 12 * @version 1.0 */ -bool OH_Drawing_FontIsForceAutoHinting(const OH_Drawing_Font*); +bool OH_Drawing_FontIsForceAutoHinting(const OH_Drawing_Font* font); /** * @brief Sets an OH_Drawing_Typeface object for an OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. - * @param OH_Drawing_Typeface Indicates the pointer to an OH_Drawing_Typeface object. + * @param font Indicates the pointer to an OH_Drawing_Font object. + * @param typeface Indicates the pointer to an OH_Drawing_Typeface object. * @since 11 * @version 1.0 */ -void OH_Drawing_FontSetTypeface(OH_Drawing_Font*, OH_Drawing_Typeface*); +void OH_Drawing_FontSetTypeface(OH_Drawing_Font* font, OH_Drawing_Typeface* typeface); /** * @brief Gets an OH_Drawing_Typeface object from the OH_Drawing_Typeface object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @return OH_Drawing_Typeface Indicates the pointer to an OH_Drawing_Typeface object. * @since 12 * @version 1.0 */ -OH_Drawing_Typeface* OH_Drawing_FontGetTypeface(OH_Drawing_Font*); +OH_Drawing_Typeface* OH_Drawing_FontGetTypeface(OH_Drawing_Font* font); /** * @brief Sets text size for an OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @param textSize Indicates the text size. * @since 11 * @version 1.0 */ -void OH_Drawing_FontSetTextSize(OH_Drawing_Font*, float textSize); +void OH_Drawing_FontSetTextSize(OH_Drawing_Font* font, float textSize); /** * @brief Gets text size for an OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @return Returns the size of text. * @since 12 * @version 1.0 */ -float OH_Drawing_FontGetTextSize(const OH_Drawing_Font*); +float OH_Drawing_FontGetTextSize(const OH_Drawing_Font* font); /** * @brief Calculate number of glyphs represented by text. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @param text Indicates the character storage encoded with text encoding. * @param byteLength Indicates the text length in bytes. * @param encoding Indicates the text encoding. * @since 12 * @version 1.0 */ -int OH_Drawing_FontCountText(OH_Drawing_Font*, const void* text, size_t byteLength, +int OH_Drawing_FontCountText(OH_Drawing_Font* font, const void* text, size_t byteLength, OH_Drawing_TextEncoding encoding); /** * @brief Converts text into glyph indices. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @param text Indicates the character storage encoded with text encoding. * @param byteLength Indicates the text length in bytes. * @param encoding Indicates the text encoding. @@ -227,21 +227,21 @@ int OH_Drawing_FontCountText(OH_Drawing_Font*, const void* text, size_t byteLeng * @since 12 * @version 1.0 */ -uint32_t OH_Drawing_FontTextToGlyphs(const OH_Drawing_Font*, const void* text, uint32_t byteLength, +uint32_t OH_Drawing_FontTextToGlyphs(const OH_Drawing_Font* font, const void* text, uint32_t byteLength, OH_Drawing_TextEncoding encoding, uint16_t* glyphs, int maxGlyphCount); /** * @brief Retrieves the advance for each glyph in glyphs. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @param glyphs Indicates the array of glyph indices to be measured. * @param count Indicates the number of glyphs. * @param widths Indicates the text advances for each glyph returned to the caller. * @since 12 * @version 1.0 */ -void OH_Drawing_FontGetWidths(const OH_Drawing_Font*, const uint16_t* glyphs, int count, float* widths); +void OH_Drawing_FontGetWidths(const OH_Drawing_Font* font, const uint16_t* glyphs, int count, float* widths); /** * @brief Measures the width of a single character. @@ -284,165 +284,165 @@ OH_Drawing_ErrorCode OH_Drawing_FontMeasureText(const OH_Drawing_Font* font, con * @brief Enables or disables linearly scalable font for an OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @param isLinearText Indicates whether to enable linearly scalable font. * @since 11 * @version 1.0 */ -void OH_Drawing_FontSetLinearText(OH_Drawing_Font*, bool isLinearText); +void OH_Drawing_FontSetLinearText(OH_Drawing_Font* font, bool isLinearText); /** * @brief Gets whether the font is linearly scalable. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @return Returns true if the font is linearly scalable; returns false otherwise. * @since 12 * @version 1.0 */ -bool OH_Drawing_FontIsLinearText(const OH_Drawing_Font*); +bool OH_Drawing_FontIsLinearText(const OH_Drawing_Font* font); /** * @brief Sets text skew on x-axis for an OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @param skewX Indicates the additional shear on x-axis relative to y-axis. * @since 11 * @version 1.0 */ -void OH_Drawing_FontSetTextSkewX(OH_Drawing_Font*, float skewX); +void OH_Drawing_FontSetTextSkewX(OH_Drawing_Font* font, float skewX); /** * @brief Gets text skew on x-axis for an OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @return Returns additional skew on x-axis relative to y-axis. * @since 12 * @version 1.0 */ -float OH_Drawing_FontGetTextSkewX(const OH_Drawing_Font*); +float OH_Drawing_FontGetTextSkewX(const OH_Drawing_Font* font); /** * @brief Enables or disables to increase stroke width to approximate bold fonts for an OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @param isFakeBoldText Indicates whether to enable to increase stroke width. * @since 11 * @version 1.0 */ -void OH_Drawing_FontSetFakeBoldText(OH_Drawing_Font*, bool isFakeBoldText); +void OH_Drawing_FontSetFakeBoldText(OH_Drawing_Font* font, bool isFakeBoldText); /** * @brief Gets whether to increase the stroke width to approximate bold fonts. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @return Returns true to increase the stroke width to approximate bold fonts; returns false otherwise. * @since 12 * @version 1.0 */ -bool OH_Drawing_FontIsFakeBoldText(const OH_Drawing_Font*); +bool OH_Drawing_FontIsFakeBoldText(const OH_Drawing_Font* font); /** * @brief Sets text scale on x-axis for an OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @param scaleX Indicates the text horizontal scale. * @since 12 * @version 1.0 */ -void OH_Drawing_FontSetScaleX(OH_Drawing_Font*, float scaleX); +void OH_Drawing_FontSetScaleX(OH_Drawing_Font* font, float scaleX); /** * @brief Gets text scale on x-axis from an OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @return Returns text horizontal scale on x-axis. * @since 12 * @version 1.0 */ -float OH_Drawing_FontGetScaleX(const OH_Drawing_Font*); +float OH_Drawing_FontGetScaleX(const OH_Drawing_Font* font); /** * @brief Sets hinting pattern for an OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. - * @param OH_Drawing_FontHinting Indicates the font hinting pattern. + * @param font Indicates the pointer to an OH_Drawing_Font object. + * @param fontHinting Indicates the font hinting pattern. * @since 12 * @version 1.0 */ -void OH_Drawing_FontSetHinting(OH_Drawing_Font*, OH_Drawing_FontHinting); +void OH_Drawing_FontSetHinting(OH_Drawing_Font* font, OH_Drawing_FontHinting fontHinting); /** * @brief Gets hinting pattern from an OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @return Returns the font hinting pattern. * @since 12 * @version 1.0 */ -OH_Drawing_FontHinting OH_Drawing_FontGetHinting(const OH_Drawing_Font*); +OH_Drawing_FontHinting OH_Drawing_FontGetHinting(const OH_Drawing_Font* font); /** * @brief Sets whether to use bitmaps instead of outlines in the OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @param isEmbeddedBitmaps Indicates whether to use bitmaps instead of outlines. * @since 12 * @version 1.0 */ -void OH_Drawing_FontSetEmbeddedBitmaps(OH_Drawing_Font*, bool isEmbeddedBitmaps); +void OH_Drawing_FontSetEmbeddedBitmaps(OH_Drawing_Font* font, bool isEmbeddedBitmaps); /** * @brief Gets whether to use bitmaps instead of outlines in the OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @return Returns true if using bitmaps instead of outlines; returns false otherwise. * @since 12 * @version 1.0 */ -bool OH_Drawing_FontIsEmbeddedBitmaps(const OH_Drawing_Font*); +bool OH_Drawing_FontIsEmbeddedBitmaps(const OH_Drawing_Font* font); /** * @brief Sets the font edging effect for an OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. - * @param OH_Drawing_FontEdging Indicates the font edging effect. + * @param font Indicates the pointer to an OH_Drawing_Font object. + * @param fontEdging Indicates the font edging effect. * @since 12 * @version 1.0 */ -void OH_Drawing_FontSetEdging(OH_Drawing_Font*, OH_Drawing_FontEdging); +void OH_Drawing_FontSetEdging(OH_Drawing_Font* font, OH_Drawing_FontEdging fontEdging); /** * @brief Gets the font edging effect from an OH_Drawing_Font object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @return Returns the font edging effect. * @since 12 * @version 1.0 */ -OH_Drawing_FontEdging OH_Drawing_FontGetEdging(const OH_Drawing_Font*); +OH_Drawing_FontEdging OH_Drawing_FontGetEdging(const OH_Drawing_Font* font); /** * @brief Destroys an OH_Drawing_Font object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @since 11 * @version 1.0 */ -void OH_Drawing_FontDestroy(OH_Drawing_Font*); +void OH_Drawing_FontDestroy(OH_Drawing_Font* font); /** * @brief Defines a run, supplies storage for the metrics of an OH_Drawing_Font. @@ -489,13 +489,13 @@ typedef struct OH_Drawing_Font_Metrics { * @brief Obtains the metrics of a font. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. - * @param OH_Drawing_Font_Metrics Indicates the pointer to an OH_Drawing_Font_Metrics object. + * @param font Indicates the pointer to an OH_Drawing_Font object. + * @param fontMetrics Indicates the pointer to an OH_Drawing_Font_Metrics object. * @return Returns a float variable that recommended spacing between lines. * @since 12 * @version 1.0 */ -float OH_Drawing_FontGetMetrics(OH_Drawing_Font*, OH_Drawing_Font_Metrics*); +float OH_Drawing_FontGetMetrics(OH_Drawing_Font* font, OH_Drawing_Font_Metrics* fontMetrics); /** * @brief Retrieves the bound rect for each glyph in glyph array. diff --git a/graphic/graphic_2d/native_drawing/drawing_gpu_context.h b/graphic/graphic_2d/native_drawing/drawing_gpu_context.h index 9558108d2..8d5df8ea9 100644 --- a/graphic/graphic_2d/native_drawing/drawing_gpu_context.h +++ b/graphic/graphic_2d/native_drawing/drawing_gpu_context.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_GPU_CONTEXT_H -#define C_INCLUDE_DRAWING_GPU_CONTEXT_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_GPU_CONTEXT_H +#define C_INCLUDE_DRAWING_GPU_CONTEXT_H + #include "drawing_types.h" #ifdef __cplusplus @@ -61,22 +61,22 @@ typedef struct { * @brief Creates an OH_Drawing_GpuContext object, whose GPU backend context is GL. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_GpuContextOptions Indicates the GPU context options. + * @param gpuContextOptions Indicates the GPU context options. * @return Returns the pointer to the OH_Drawing_GpuContext object created. * @since 12 * @version 1.0 */ -OH_Drawing_GpuContext* OH_Drawing_GpuContextCreateFromGL(OH_Drawing_GpuContextOptions); +OH_Drawing_GpuContext* OH_Drawing_GpuContextCreateFromGL(OH_Drawing_GpuContextOptions gpuContextOptions); /** * @brief Destroys an OH_Drawing_GpuContext object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_GpuContext Indicates the pointer to an OH_Drawing_GpuContext object. + * @param gpuContext Indicates the pointer to an OH_Drawing_GpuContext object. * @since 12 * @version 1.0 */ -void OH_Drawing_GpuContextDestroy(OH_Drawing_GpuContext*); +void OH_Drawing_GpuContextDestroy(OH_Drawing_GpuContext* gpuContext); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_image.h b/graphic/graphic_2d/native_drawing/drawing_image.h index 07c96aecd..f4c9fed10 100644 --- a/graphic/graphic_2d/native_drawing/drawing_image.h +++ b/graphic/graphic_2d/native_drawing/drawing_image.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_IMAGE_H -#define C_INCLUDE_DRAWING_IMAGE_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_IMAGE_H +#define C_INCLUDE_DRAWING_IMAGE_H + #include "drawing_types.h" #ifdef __cplusplus @@ -60,56 +60,56 @@ OH_Drawing_Image* OH_Drawing_ImageCreate(void); * @brief Destroys an OH_Drawing_Image object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Image Indicates the pointer to an OH_Drawing_Image object. + * @param image Indicates the pointer to an OH_Drawing_Image object. * @since 12 * @version 1.0 */ -void OH_Drawing_ImageDestroy(OH_Drawing_Image*); +void OH_Drawing_ImageDestroy(OH_Drawing_Image* image); /** * @brief Rebuilds an OH_Drawing_Image object, sharing or copying bitmap pixels. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Image Indicates the pointer to an OH_Drawing_Image object. - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param image Indicates the pointer to an OH_Drawing_Image object. + * @param bitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @return Returns true if successed. * @since 12 * @version 1.0 */ -bool OH_Drawing_ImageBuildFromBitmap(OH_Drawing_Image*, OH_Drawing_Bitmap*); +bool OH_Drawing_ImageBuildFromBitmap(OH_Drawing_Image* image, OH_Drawing_Bitmap* bitmap); /** * @brief Gets pixel count in each row of image. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Image Indicates the pointer to an OH_Drawing_Image object. + * @param image Indicates the pointer to an OH_Drawing_Image object. * @return Returns the width. * @since 12 * @version 1.0 */ -int32_t OH_Drawing_ImageGetWidth(OH_Drawing_Image*); +int32_t OH_Drawing_ImageGetWidth(OH_Drawing_Image* image); /** * @brief Gets pixel row count of image. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Image Indicates the pointer to an OH_Drawing_Image object. + * @param image Indicates the pointer to an OH_Drawing_Image object. * @return Returns the height. * @since 12 * @version 1.0 */ -int32_t OH_Drawing_ImageGetHeight(OH_Drawing_Image*); +int32_t OH_Drawing_ImageGetHeight(OH_Drawing_Image* image); /** * @brief Gets the image info. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Image Indicates the pointer to an OH_Drawing_Image object. - * @param OH_Drawing_Image_Info Indicates the pointer to an OH_Drawing_Image_Info object. + * @param image Indicates the pointer to an OH_Drawing_Image object. + * @param imageInfo Indicates the pointer to an OH_Drawing_Image_Info object. * @since 12 * @version 1.0 */ -void OH_Drawing_ImageGetImageInfo(OH_Drawing_Image*, OH_Drawing_Image_Info*); +void OH_Drawing_ImageGetImageInfo(OH_Drawing_Image* image, OH_Drawing_Image_Info* imageInfo); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_image_filter.h b/graphic/graphic_2d/native_drawing/drawing_image_filter.h index d77292aa3..3fde3b724 100644 --- a/graphic/graphic_2d/native_drawing/drawing_image_filter.h +++ b/graphic/graphic_2d/native_drawing/drawing_image_filter.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_IMAGE_FILTER_H -#define C_INCLUDE_DRAWING_IMAGE_FILTER_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_IMAGE_FILTER_H +#define C_INCLUDE_DRAWING_IMAGE_FILTER_H + #include "drawing_shader_effect.h" #ifdef __cplusplus @@ -52,23 +52,23 @@ extern "C" { * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param sigmaX Indicates the Gaussian sigma value for blurring along the x axis. * @param sigmaY Indicates the Gaussian sigma value for blurring along the y axis. - * @param OH_Drawing_TileMode Indicates the tile mode applied at edges. - * @param OH_Drawing_ImageFilter Indicates the input filter that is blurred, uses source bitmap if this is null. + * @param tileMode Indicates the tile mode applied at edges. + * @param imageFilter Indicates the input filter that is blurred, uses source bitmap if this is null. * @return Returns the pointer to the OH_Drawing_ImageFilter object created. * If nullptr is returned, the creation fails. * The possible cause of the failure is that the available memory is empty. * @since 12 * @version 1.0 */ -OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateBlur(float sigmaX, float sigmaY, OH_Drawing_TileMode, - OH_Drawing_ImageFilter*); +OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateBlur(float sigmaX, float sigmaY, OH_Drawing_TileMode tileMode, + OH_Drawing_ImageFilter* imageFilter); /** * @brief Creates an OH_Drawing_ImageFilter object that applies the color filter to the input. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_ColorFilter Indicates the color filter that transforms the input image. - * @param OH_Drawing_ImageFilter Indicates the input filter, or uses the source bitmap if this is null. + * @param colorFilter Indicates the color filter that transforms the input image. + * @param imageFilter Indicates the input filter, or uses the source bitmap if this is null. * @return Returns the pointer to the OH_Drawing_ImageFilter object created. * If nullptr is returned, the creation fails. * The possible cause of the failure is that the available memory is empty or @@ -76,17 +76,18 @@ OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateBlur(float sigmaX, float sig * @since 12 * @version 1.0 */ -OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateFromColorFilter(OH_Drawing_ColorFilter*, OH_Drawing_ImageFilter*); +OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateFromColorFilter(OH_Drawing_ColorFilter* colorFilter, + OH_Drawing_ImageFilter* imageFilter); /** * @brief Destroys an OH_Drawing_ImageFilter object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_ImageFilter Indicates the pointer to an OH_Drawing_ImageFilter object. + * @param imageFilter Indicates the pointer to an OH_Drawing_ImageFilter object. * @since 12 * @version 1.0 */ -void OH_Drawing_ImageFilterDestroy(OH_Drawing_ImageFilter*); +void OH_Drawing_ImageFilterDestroy(OH_Drawing_ImageFilter* imageFilter); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_mask_filter.h b/graphic/graphic_2d/native_drawing/drawing_mask_filter.h index 86f487bfe..c265e1c90 100644 --- a/graphic/graphic_2d/native_drawing/drawing_mask_filter.h +++ b/graphic/graphic_2d/native_drawing/drawing_mask_filter.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_MASK_FILTER_H -#define C_INCLUDE_DRAWING_MASK_FILTER_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_MASK_FILTER_H +#define C_INCLUDE_DRAWING_MASK_FILTER_H + #include "drawing_types.h" #ifdef __cplusplus @@ -88,11 +88,11 @@ OH_Drawing_MaskFilter* OH_Drawing_MaskFilterCreateBlur(OH_Drawing_BlurType blurT * @brief Destroys an OH_Drawing_MaskFilter object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_MaskFilter Indicates the pointer to an OH_Drawing_MaskFilter object. + * @param maskFilter Indicates the pointer to an OH_Drawing_MaskFilter object. * @since 11 * @version 1.0 */ -void OH_Drawing_MaskFilterDestroy(OH_Drawing_MaskFilter*); +void OH_Drawing_MaskFilterDestroy(OH_Drawing_MaskFilter* maskFilter); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_matrix.h b/graphic/graphic_2d/native_drawing/drawing_matrix.h index f56827d85..bbf6645df 100644 --- a/graphic/graphic_2d/native_drawing/drawing_matrix.h +++ b/graphic/graphic_2d/native_drawing/drawing_matrix.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_MATRIX_H -#define C_INCLUDE_DRAWING_MATRIX_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_MATRIX_H +#define C_INCLUDE_DRAWING_MATRIX_H + #include "drawing_error_code.h" #include "drawing_types.h" @@ -62,7 +62,6 @@ OH_Drawing_Matrix* OH_Drawing_MatrixCreate(void); * rotate by degrees about a pivot point at (px, py). * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param deg angle of axes relative to upright axes * @param x pivot on x-axis. * @param y pivot on y-axis. @@ -76,7 +75,6 @@ OH_Drawing_Matrix* OH_Drawing_MatrixCreateRotation(float deg, float x, float y); * by sx and sy, about a pivot point at (px, py). * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param sx horizontal scale factor. * @param sy vertical scale factor. * @param px pivot on x-axis. @@ -91,7 +89,6 @@ OH_Drawing_Matrix* OH_Drawing_MatrixCreateScale(float sx, float sy, float px, fl * @brief Creates an OH_Drawing_Matrix object with translation. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param dx horizontal translation. * @param dy vertical translation. * @return Returns the pointer to the OH_Drawing_Matrix object created. @@ -104,7 +101,7 @@ OH_Drawing_Matrix* OH_Drawing_MatrixCreateTranslation(float dx, float dy); * @brief Sets the params for a matrix. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param scaleX horizontal scale factor to store * @param skewX horizontal skew factor to store * @param transX horizontal translation to store @@ -117,7 +114,7 @@ OH_Drawing_Matrix* OH_Drawing_MatrixCreateTranslation(float dx, float dy); * @since 11 * @version 1.0 */ -void OH_Drawing_MatrixSetMatrix(OH_Drawing_Matrix*, float scaleX, float skewX, float transX, +void OH_Drawing_MatrixSetMatrix(OH_Drawing_Matrix* matrix, float scaleX, float skewX, float transX, float skewY, float scaleY, float transY, float persp0, float persp1, float persp2); /** @@ -149,7 +146,7 @@ typedef enum { * @brief Sets matrix to scale and translate src rect to dst rect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param src Indicates the pointer to an OH_Drawing_Rect object rect to map from. * @param dst Indicates the pointer to an OH_Drawing_Rect object rect to map to. * @param stf Scales to fit enum method. @@ -161,7 +158,7 @@ typedef enum { * @since 12 * @version 1.0 */ -bool OH_Drawing_MatrixSetRectToRect(OH_Drawing_Matrix*, const OH_Drawing_Rect* src, +bool OH_Drawing_MatrixSetRectToRect(OH_Drawing_Matrix* matrix, const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, OH_Drawing_ScaleToFit stf); /** @@ -187,14 +184,14 @@ bool OH_Drawing_MatrixSetRectToRect(OH_Drawing_Matrix*, const OH_Drawing_Rect* s * | G H I | | 0 0 1 | | Gc+Hs -Gs+Hc G*dx+H*dy+I | * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param degree Indicates the angle of axes relative to upright axes. * @param px Indicates the pivot on x-axis. * @param py Indicates the pivot on y-axis. * @since 12 * @version 1.0 */ -void OH_Drawing_MatrixPreRotate(OH_Drawing_Matrix*, float degree, float px, float py); +void OH_Drawing_MatrixPreRotate(OH_Drawing_Matrix* matrix, float degree, float px, float py); /** * @brief Sets matrix to forward scale by sx and sy, about a pivot point at (px, py). @@ -216,7 +213,7 @@ void OH_Drawing_MatrixPreRotate(OH_Drawing_Matrix*, float degree, float px, floa * | G H I | | 0 0 1 | | G*sx H*sy G*dx+H*dy+I | * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param sx Horizontal scale factor. * @param sy Vertical scale factor. * @param px Pivot on x-axis. @@ -224,7 +221,7 @@ void OH_Drawing_MatrixPreRotate(OH_Drawing_Matrix*, float degree, float px, floa * @since 12 * @version 1.0 */ -void OH_Drawing_MatrixPreScale(OH_Drawing_Matrix*, float sx, float sy, float px, float py); +void OH_Drawing_MatrixPreScale(OH_Drawing_Matrix* matrix, float sx, float sy, float px, float py); /** * @brief Sets forward matrix to translate by dx and dy. @@ -238,13 +235,13 @@ void OH_Drawing_MatrixPreScale(OH_Drawing_Matrix*, float sx, float sy, float px, * | G H I | | 0 0 1 | | G H G*dx+H*dy+I | * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param dx Indicates the horizontal translation. * @param dy Indicates the vertical translation. * @since 12 * @version 1.0 */ -void OH_Drawing_MatrixPreTranslate(OH_Drawing_Matrix*, float dx, float dy); +void OH_Drawing_MatrixPreTranslate(OH_Drawing_Matrix* matrix, float dx, float dy); /** * @brief Sets matrix to matrix constructed from rotating by degrees about pivot point(px, py), @@ -269,14 +266,14 @@ void OH_Drawing_MatrixPreTranslate(OH_Drawing_Matrix*, float dx, float dy); * |0 0 1| |P Q R| | P Q R| * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param degree Indicates the angle of axes relative to upright axes. * @param px Indicates the pivot on x-axis. * @param py Indicates the pivot on y-axis. * @since 12 * @version 1.0 */ -void OH_Drawing_MatrixPostRotate(OH_Drawing_Matrix*, float degree, float px, float py); +void OH_Drawing_MatrixPostRotate(OH_Drawing_Matrix* matrix, float degree, float px, float py); /** * @brief Sets matrix to backward scale by sx and sy, about a pivot point at (px, py). @@ -293,7 +290,7 @@ void OH_Drawing_MatrixPostRotate(OH_Drawing_Matrix*, float degree, float px, flo * | 0 0 1 | | P Q R | | P Q R | * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param sx Horizontal scale factor. * @param sy Vertical scale factor. * @param px Pivot on x-axis. @@ -301,7 +298,7 @@ void OH_Drawing_MatrixPostRotate(OH_Drawing_Matrix*, float degree, float px, flo * @since 12 * @version 1.0 */ -void OH_Drawing_MatrixPostScale(OH_Drawing_Matrix*, float sx, float sy, float px, float py); +void OH_Drawing_MatrixPostScale(OH_Drawing_Matrix* matrix, float sx, float sy, float px, float py); /** * @brief Sets backward matrix to translate by (dx, dy). @@ -318,13 +315,13 @@ void OH_Drawing_MatrixPostScale(OH_Drawing_Matrix*, float sx, float sy, float px * | 0 0 1 | | P Q R | | P Q R | * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param dx Indicates the horizontal translation. * @param dy Indicates the vertical translation. * @since 12 * @version 1.0 */ -void OH_Drawing_MatrixPostTranslate(OH_Drawing_Matrix*, float dx, float dy); +void OH_Drawing_MatrixPostTranslate(OH_Drawing_Matrix* matrix, float dx, float dy); /** * @brief Reset matrix to identity, which has no effect on mapped point, sets matrix to: @@ -333,11 +330,11 @@ void OH_Drawing_MatrixPostTranslate(OH_Drawing_Matrix*, float dx, float dy); * | 0 0 1 | * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @since 12 * @version 1.0 */ -void OH_Drawing_MatrixReset(OH_Drawing_Matrix*); +void OH_Drawing_MatrixReset(OH_Drawing_Matrix* matrix); /** * @brief Sets matrix total to matrix a multiplied by matrix b. @@ -376,45 +373,45 @@ OH_Drawing_ErrorCode OH_Drawing_MatrixGetAll(OH_Drawing_Matrix* matrix, float va /** * @brief Get one matrix value. Index is between the range of 0-8. * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param index one of 0-8. * @return Returns value corresponding to index.Returns 0 if out of range. * @since 12 * @version 1.0 */ -float OH_Drawing_MatrixGetValue(OH_Drawing_Matrix*, int index); +float OH_Drawing_MatrixGetValue(OH_Drawing_Matrix* matrix, int index); /** * @brief Sets matrix to rotate by degrees about a pivot point at (px, py). The pivot point is unchanged * when mapped with matrix. Positive degrees rotates clockwise. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param degree Indicates the angle of axes relative to upright axes. * @param px Indicates the pivot on x-axis. * @param py Indicates the pivot on y-axis. * @since 12 * @version 1.0 */ -void OH_Drawing_MatrixRotate(OH_Drawing_Matrix*, float degree, float px, float py); +void OH_Drawing_MatrixRotate(OH_Drawing_Matrix* matrix, float degree, float px, float py); /** * @brief Sets matrix to translate by (dx, dy) * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param dx Indicates the horizontal translation. * @param dy Indicates the vertical translation. * @since 12 * @version 1.0 */ -void OH_Drawing_MatrixTranslate(OH_Drawing_Matrix*, float dx, float dy); +void OH_Drawing_MatrixTranslate(OH_Drawing_Matrix* matrix, float dx, float dy); /** * @brief Sets matrix to scale by sx and sy, about a pivot point at (px, py). * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param sx Indicates the horizontal scale factor. * @param sy Indicates the vertical scale factor. * @param px Indicates the pivot on x-axis. @@ -422,27 +419,27 @@ void OH_Drawing_MatrixTranslate(OH_Drawing_Matrix*, float dx, float dy); * @since 12 * @version 1.0 */ -void OH_Drawing_MatrixScale(OH_Drawing_Matrix*, float sx, float sy, float px, float py); +void OH_Drawing_MatrixScale(OH_Drawing_Matrix* matrix, float sx, float sy, float px, float py); /** * @brief Sets inverse to reciprocal matrix, returning true if matrix can be inverted. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param inverse Indicates the pointer to an OH_Drawing_Matrix object. * @return Returns true if the matrix is not nullptr and can be inverted; * returns false if the matrix is nullptr or cannot be inverted. * @since 12 * @version 1.0 */ -bool OH_Drawing_MatrixInvert(OH_Drawing_Matrix*, OH_Drawing_Matrix* inverse); +bool OH_Drawing_MatrixInvert(OH_Drawing_Matrix* matrix, OH_Drawing_Matrix* inverse); /** * @brief Sets the params of matrix to map src to dst. * Count must greater than or equal to zero, and less than or equal to four. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param src Points to map from. * @param dst Points to map to. * @param count Number of point in src and dst. @@ -450,47 +447,47 @@ bool OH_Drawing_MatrixInvert(OH_Drawing_Matrix*, OH_Drawing_Matrix* inverse); * @since 12 * @version 1.0 */ -bool OH_Drawing_MatrixSetPolyToPoly(OH_Drawing_Matrix*, const OH_Drawing_Point2D* src, +bool OH_Drawing_MatrixSetPolyToPoly(OH_Drawing_Matrix* matrix, const OH_Drawing_Point2D* src, const OH_Drawing_Point2D* dst, uint32_t count); /** * @brief Maps the src point array to the dst point array by matrix transformation. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param src Points to map from. * @param dst Points to map to. * @param count Number of point in src and dst. * @since 12 * @version 1.0 */ -void OH_Drawing_MatrixMapPoints(const OH_Drawing_Matrix*, const OH_Drawing_Point2D* src, +void OH_Drawing_MatrixMapPoints(const OH_Drawing_Matrix* matrix, const OH_Drawing_Point2D* src, OH_Drawing_Point2D* dst, int count); /** * @brief Sets dst to bounds of src corners mapped by matrix transformation. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param src Rect to map from. * @param dst Rect to map to. * @return Returns true if the mapped src is equal to the dst; returns false is not equal. * @since 12 * @version 1.0 */ -bool OH_Drawing_MatrixMapRect(const OH_Drawing_Matrix*, const OH_Drawing_Rect* src, OH_Drawing_Rect* dst); +bool OH_Drawing_MatrixMapRect(const OH_Drawing_Matrix* matrix, const OH_Drawing_Rect* src, OH_Drawing_Rect* dst); /** * @brief Returns true if the first matrix equals the second matrix. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param other Indicates the pointer to an OH_Drawing_Matrix object. * @return Returns true if the two matrices are equal; returns false if not equal. * @since 12 * @version 1.0 */ -bool OH_Drawing_MatrixIsEqual(OH_Drawing_Matrix*, OH_Drawing_Matrix* other); +bool OH_Drawing_MatrixIsEqual(OH_Drawing_Matrix* matrix, OH_Drawing_Matrix* other); /** * @brief Returns true if matrix is identity. @@ -499,22 +496,22 @@ bool OH_Drawing_MatrixIsEqual(OH_Drawing_Matrix*, OH_Drawing_Matrix* other); * | 0 0 1 | * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @return Returns true if matrix is identity; returns false if not identity. * @since 12 * @version 1.0 */ -bool OH_Drawing_MatrixIsIdentity(OH_Drawing_Matrix*); +bool OH_Drawing_MatrixIsIdentity(OH_Drawing_Matrix* matrix); /** * @brief Destroys an OH_Drawing_Matrix object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @since 11 * @version 1.0 */ -void OH_Drawing_MatrixDestroy(OH_Drawing_Matrix*); +void OH_Drawing_MatrixDestroy(OH_Drawing_Matrix* matrix); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_memory_stream.h b/graphic/graphic_2d/native_drawing/drawing_memory_stream.h index 37c578106..3188d3be9 100644 --- a/graphic/graphic_2d/native_drawing/drawing_memory_stream.h +++ b/graphic/graphic_2d/native_drawing/drawing_memory_stream.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_MEMORY_STREAM_H -#define C_INCLUDE_DRAWING_MEMORY_STREAM_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_MEMORY_STREAM_H +#define C_INCLUDE_DRAWING_MEMORY_STREAM_H + #include "drawing_types.h" #ifdef __cplusplus @@ -63,11 +63,11 @@ OH_Drawing_MemoryStream* OH_Drawing_MemoryStreamCreate(const void* data, size_t * @brief Destroys an OH_Drawing_MemoryStream object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_MemoryStream Indicates the pointer to an OH_Drawing_MemoryStream object. + * @param memoryStream Indicates the pointer to an OH_Drawing_MemoryStream object. * @since 12 * @version 1.0 */ -void OH_Drawing_MemoryStreamDestroy(OH_Drawing_MemoryStream*); +void OH_Drawing_MemoryStreamDestroy(OH_Drawing_MemoryStream* memoryStream); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_path.h b/graphic/graphic_2d/native_drawing/drawing_path.h index e10ef145a..3cc9269c9 100644 --- a/graphic/graphic_2d/native_drawing/drawing_path.h +++ b/graphic/graphic_2d/native_drawing/drawing_path.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_PATH_H -#define C_INCLUDE_DRAWING_PATH_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_PATH_H +#define C_INCLUDE_DRAWING_PATH_H + #include "drawing_types.h" #ifdef __cplusplus @@ -153,46 +153,46 @@ OH_Drawing_Path* OH_Drawing_PathCreate(void); * @brief Creates an OH_Drawing_Path copy object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Rect object. + * @param path Indicates the pointer to an OH_Drawing_Rect object. * @return Returns the pointer to the OH_Drawing_Path object created. * @since 12 * @version 1.0 */ -OH_Drawing_Path* OH_Drawing_PathCopy(OH_Drawing_Path*); +OH_Drawing_Path* OH_Drawing_PathCopy(OH_Drawing_Path* path); /** * @brief Destroys an OH_Drawing_Path object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @since 8 * @version 1.0 */ -void OH_Drawing_PathDestroy(OH_Drawing_Path*); +void OH_Drawing_PathDestroy(OH_Drawing_Path* path); /** * @brief Sets the start point of a path. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param x Indicates the x coordinate of the start point. * @param y Indicates the y coordinate of the start point. * @since 8 * @version 1.0 */ -void OH_Drawing_PathMoveTo(OH_Drawing_Path*, float x, float y); +void OH_Drawing_PathMoveTo(OH_Drawing_Path* path, float x, float y); /** * @brief Draws a line segment from the last point of a path to the target point. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param x Indicates the x coordinate of the target point. * @param y Indicates the y coordinate of the target point. * @since 8 * @version 1.0 */ -void OH_Drawing_PathLineTo(OH_Drawing_Path*, float x, float y); +void OH_Drawing_PathLineTo(OH_Drawing_Path* path, float x, float y); /** * @brief Draws an arc to a path. @@ -203,7 +203,7 @@ void OH_Drawing_PathLineTo(OH_Drawing_Path*, float x, float y); * By default, a line segment from the last point of the path to the start point of the arc is also added. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param x1 Indicates the x coordinate of the upper left corner of the rectangle. * @param y1 Indicates the y coordinate of the upper left corner of the rectangle. * @param x2 Indicates the x coordinate of the lower right corner of the rectangle. @@ -213,13 +213,14 @@ void OH_Drawing_PathLineTo(OH_Drawing_Path*, float x, float y); * @since 8 * @version 1.0 */ -void OH_Drawing_PathArcTo(OH_Drawing_Path*, float x1, float y1, float x2, float y2, float startDeg, float sweepDeg); +void OH_Drawing_PathArcTo(OH_Drawing_Path* path, + float x1, float y1, float x2, float y2, float startDeg, float sweepDeg); /** * @brief Draws a quadratic Bezier curve from the last point of a path to the target point. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param ctrlX Indicates the x coordinate of the control point. * @param ctrlY Indicates the y coordinate of the control point. * @param endX Indicates the x coordinate of the target point. @@ -227,13 +228,13 @@ void OH_Drawing_PathArcTo(OH_Drawing_Path*, float x1, float y1, float x2, float * @since 8 * @version 1.0 */ -void OH_Drawing_PathQuadTo(OH_Drawing_Path*, float ctrlX, float ctrlY, float endX, float endY); +void OH_Drawing_PathQuadTo(OH_Drawing_Path* path, float ctrlX, float ctrlY, float endX, float endY); /** * @brief Draws a conic from the last point of a path to the target point. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param ctrlX Indicates the x coordinate of the control point. * @param ctrlY Indicates the y coordinate of the control point. * @param endX Indicates the x coordinate of the target point. @@ -242,13 +243,13 @@ void OH_Drawing_PathQuadTo(OH_Drawing_Path*, float ctrlX, float ctrlY, float end * @since 12 * @version 1.0 */ -void OH_Drawing_PathConicTo(OH_Drawing_Path*, float ctrlX, float ctrlY, float endX, float endY, float weight); +void OH_Drawing_PathConicTo(OH_Drawing_Path* path, float ctrlX, float ctrlY, float endX, float endY, float weight); /** * @brief Draws a cubic Bezier curve from the last point of a path to the target point. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param ctrlX1 Indicates the x coordinate of the first control point. * @param ctrlY1 Indicates the y coordinate of the first control point. * @param ctrlX2 Indicates the x coordinate of the second control point. @@ -259,37 +260,37 @@ void OH_Drawing_PathConicTo(OH_Drawing_Path*, float ctrlX, float ctrlY, float en * @version 1.0 */ void OH_Drawing_PathCubicTo( - OH_Drawing_Path*, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY); + OH_Drawing_Path* path, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY); /** * @brief Sets the relative starting point of a path. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param x Indicates the x coordinate of the relative starting point. * @param y Indicates the y coordinate of the relative starting point. * @since 12 * @version 1.0 */ -void OH_Drawing_PathRMoveTo(OH_Drawing_Path*, float x, float y); +void OH_Drawing_PathRMoveTo(OH_Drawing_Path* path, float x, float y); /** * @brief Draws a line segment from the last point of a path to the relative target point. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param x Indicates the x coordinate of the relative target point. * @param y Indicates the y coordinate of the relative target point. * @since 12 * @version 1.0 */ -void OH_Drawing_PathRLineTo(OH_Drawing_Path*, float x, float y); +void OH_Drawing_PathRLineTo(OH_Drawing_Path* path, float x, float y); /** * @brief Draws a quadratic bezier curve from the last point of a path to the relative target point. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param ctrlX Indicates the x coordinate of the relative control point. * @param ctrlY Indicates the y coordinate of the relative control point. * @param endX Indicates the x coordinate of the relative target point. @@ -297,13 +298,13 @@ void OH_Drawing_PathRLineTo(OH_Drawing_Path*, float x, float y); * @since 12 * @version 1.0 */ -void OH_Drawing_PathRQuadTo(OH_Drawing_Path*, float ctrlX, float ctrlY, float endX, float endY); +void OH_Drawing_PathRQuadTo(OH_Drawing_Path* path, float ctrlX, float ctrlY, float endX, float endY); /** * @brief Draws a conic from the last point of a path to the relative target point. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param ctrlX Indicates the x coordinate of the relative control point. * @param ctrlY Indicates the y coordinate of the relative control point. * @param endX Indicates the x coordinate of the relative target point. @@ -312,13 +313,13 @@ void OH_Drawing_PathRQuadTo(OH_Drawing_Path*, float ctrlX, float ctrlY, float en * @since 12 * @version 1.0 */ -void OH_Drawing_PathRConicTo(OH_Drawing_Path*, float ctrlX, float ctrlY, float endX, float endY, float weight); +void OH_Drawing_PathRConicTo(OH_Drawing_Path* path, float ctrlX, float ctrlY, float endX, float endY, float weight); /** * @brief Draws a cubic bezier curve from the last point of a path to the relative target point. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param ctrlX1 Indicates the x coordinate of the first relative control point. * @param ctrlY1 Indicates the y coordinate of the first relative control point. * @param ctrlX2 Indicates the x coordinate of the second relative control point. @@ -328,76 +329,78 @@ void OH_Drawing_PathRConicTo(OH_Drawing_Path*, float ctrlX, float ctrlY, float e * @since 12 * @version 1.0 */ -void OH_Drawing_PathRCubicTo(OH_Drawing_Path*, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, +void OH_Drawing_PathRCubicTo(OH_Drawing_Path* path, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY); /** * @brief Adds a new contour to the path, defined by the rect, and wound in the specified direction. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param left Indicates the left coordinate of the upper left corner of the rectangle. * @param top Indicates the top coordinate of the upper top corner of the rectangle. * @param right Indicates the right coordinate of the lower right corner of the rectangle. * @param bottom Indicates the bottom coordinate of the lower bottom corner of the rectangle. - * @param OH_Drawing_PathDirection Indicates the path direction. + * @param pathDirection Indicates the path direction. * @since 12 * @version 1.0 */ -void OH_Drawing_PathAddRect(OH_Drawing_Path*, float left, float top, float right, float bottom, - OH_Drawing_PathDirection); +void OH_Drawing_PathAddRect(OH_Drawing_Path* path, float left, float top, float right, float bottom, + OH_Drawing_PathDirection pathDirection); /** * @brief Adds a new contour to the path, defined by the rect, and wound in the specified direction. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. - * @param OH_Drawing_PathDirection Indicates the path direction. + * @param path Indicates the pointer to an OH_Drawing_Path object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. + * @param pathDirection Indicates the path direction. * @param start Indicates initial corner of rect to add. * @since 12 * @version 1.0 */ -void OH_Drawing_PathAddRectWithInitialCorner(OH_Drawing_Path*, const OH_Drawing_Rect*, - OH_Drawing_PathDirection, uint32_t start); +void OH_Drawing_PathAddRectWithInitialCorner(OH_Drawing_Path* path, const OH_Drawing_Rect* rect, + OH_Drawing_PathDirection pathDirection, uint32_t start); /** * @brief Adds a new contour to the path, defined by the round rect, and wound in the specified direction. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_RoundRect Indicates the pointer to an OH_Drawing_RoundRect object. - * @param OH_Drawing_PathDirection Indicates the path direction. + * @param path Indicates the pointer to an OH_Drawing_Path object. + * @param roundRect Indicates the pointer to an OH_Drawing_RoundRect object. + * @param pathDirection Indicates the path direction. * @since 12 * @version 1.0 */ -void OH_Drawing_PathAddRoundRect(OH_Drawing_Path*, const OH_Drawing_RoundRect* roundRect, OH_Drawing_PathDirection); +void OH_Drawing_PathAddRoundRect(OH_Drawing_Path* path, + const OH_Drawing_RoundRect* roundRect, OH_Drawing_PathDirection pathDirection); /** * @brief Adds a oval to the path, defined by the rect, and wound in the specified direction. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param path Indicates the pointer to an OH_Drawing_Path object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @param start Index of initial point of ellipse. - * @param OH_Drawing_PathDirection Indicates the path direction. + * @param pathDirection Indicates the path direction. * @since 12 * @version 1.0 */ -void OH_Drawing_PathAddOvalWithInitialPoint(OH_Drawing_Path*, const OH_Drawing_Rect*, - uint32_t start, OH_Drawing_PathDirection); +void OH_Drawing_PathAddOvalWithInitialPoint(OH_Drawing_Path* path, const OH_Drawing_Rect* rect, + uint32_t start, OH_Drawing_PathDirection pathDirection); /** * @brief Adds a oval to the path, defined by the rect, and wound in the specified direction. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. - * @param OH_Drawing_PathDirection Indicates the path direction. + * @param path Indicates the pointer to an OH_Drawing_Path object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. + * @param pathDirection Indicates the path direction. * @since 12 * @version 1.0 */ -void OH_Drawing_PathAddOval(OH_Drawing_Path*, const OH_Drawing_Rect*, OH_Drawing_PathDirection); +void OH_Drawing_PathAddOval(OH_Drawing_Path* path, + const OH_Drawing_Rect* rect, OH_Drawing_PathDirection pathDirection); /** * @brief Appends arc to path, as the start of new contour.Arc added is part of ellipse bounded by oval, @@ -407,27 +410,27 @@ void OH_Drawing_PathAddOval(OH_Drawing_Path*, const OH_Drawing_Rect*, OH_Drawing * values are treated modulo 360, and arc may or may not draw depending on numeric rounding. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param path Indicates the pointer to an OH_Drawing_Path object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @param startAngle Indicates the starting angle of arc in degrees. * @param sweepAngle Indicates the sweep, in degrees. Positive is clockwise. * @since 12 * @version 1.0 */ -void OH_Drawing_PathAddArc(OH_Drawing_Path*, const OH_Drawing_Rect*, float startAngle, float sweepAngle); +void OH_Drawing_PathAddArc(OH_Drawing_Path* path, const OH_Drawing_Rect* rect, float startAngle, float sweepAngle); /** * @brief Appends src path to path, transformed by matrix. Transformed curves may have different verbs, * point, and conic weights. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param src Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_Matrix Indicates the length of the OH_Drawing_Matrix object. + * @param matrix Indicates the length of the OH_Drawing_Matrix object. * @since 12 * @version 1.0 */ -void OH_Drawing_PathAddPath(OH_Drawing_Path*, const OH_Drawing_Path* src, const OH_Drawing_Matrix*); +void OH_Drawing_PathAddPath(OH_Drawing_Path* path, const OH_Drawing_Path* src, const OH_Drawing_Matrix* matrix); /** * @brief Appends src path to path, transformed by matrix and mode. Transformed curves may have different verbs, @@ -436,13 +439,13 @@ void OH_Drawing_PathAddPath(OH_Drawing_Path*, const OH_Drawing_Path* src, const * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param path Indicates the pointer to an OH_Drawing_Path object. * @param src Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_Matrix Indicates the length of the OH_Drawing_Matrix object. - * @param OH_Drawing_PathAddMode Indicates the add path's add mode. + * @param matrix Indicates the length of the OH_Drawing_Matrix object. + * @param pathAddMode Indicates the add path's add mode. * @since 12 * @version 1.0 */ void OH_Drawing_PathAddPathWithMatrixAndMode(OH_Drawing_Path* path, const OH_Drawing_Path* src, - const OH_Drawing_Matrix*, OH_Drawing_PathAddMode); + const OH_Drawing_Matrix* matrix, OH_Drawing_PathAddMode pathAddMode); /** * @brief Appends src path to path, transformed by mode. Transformed curves may have different verbs, @@ -451,11 +454,12 @@ void OH_Drawing_PathAddPathWithMatrixAndMode(OH_Drawing_Path* path, const OH_Dra * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param path Indicates the pointer to an OH_Drawing_Path object. * @param src Indicates the pointer to an OH_Drawing_Path object, which is Appends src path to path. - * @param OH_Drawing_PathAddMode Indicates the add path's add mode. + * @param pathAddMode Indicates the add path's add mode. * @since 12 * @version 1.0 */ -void OH_Drawing_PathAddPathWithMode(OH_Drawing_Path* path, const OH_Drawing_Path* src, OH_Drawing_PathAddMode); +void OH_Drawing_PathAddPathWithMode(OH_Drawing_Path* path, + const OH_Drawing_Path* src, OH_Drawing_PathAddMode pathAddMode); /** * @brief Appends src path to path, transformed by offset and mode. Transformed curves may have different verbs, @@ -466,12 +470,12 @@ void OH_Drawing_PathAddPathWithMode(OH_Drawing_Path* path, const OH_Drawing_Path * @param src Indicates the pointer to an OH_Drawing_Path object. * @param dx Indicates offset added to src path x-axis coordinates. * @param dy Indicates offset added to src path y-axis coordinates. - * @param OH_Drawing_PathAddMode Indicates the add path's add mode. + * @param pathAddMode Indicates the add path's add mode. * @since 12 * @version 1.0 */ void OH_Drawing_PathAddPathWithOffsetAndMode(OH_Drawing_Path* path, const OH_Drawing_Path* src, float dx, float dy, - OH_Drawing_PathAddMode); + OH_Drawing_PathAddMode pathAddMode); /** * @brief Adds contour created from point array, adding (count - 1) line segments. @@ -494,11 +498,12 @@ void OH_Drawing_PathAddPolygon(OH_Drawing_Path* path, const OH_Drawing_Point2D* * @param x Indicates the x coordinate of the center of the circle. * @param y Indicates the y coordinate of the center of the circle. * @param radius Indicates the radius of the circle. - * @param OH_Drawing_PathDirection Indicates the path direction. + * @param pathDirection Indicates the path direction. * @since 12 * @version 1.0 */ -void OH_Drawing_PathAddCircle(OH_Drawing_Path* path, float x, float y, float radius, OH_Drawing_PathDirection); +void OH_Drawing_PathAddCircle(OH_Drawing_Path* path, + float x, float y, float radius, OH_Drawing_PathDirection pathDirection); /** * @brief Parses the svg path from the string. @@ -516,26 +521,26 @@ bool OH_Drawing_PathBuildFromSvgString(OH_Drawing_Path* path, const char* str); * @brief Return the status that point (x, y) is contained by path. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param x Indicates the x-axis value of containment test. * @param y Indicates the y-axis value of containment test. * @return Returns true if the point (x, y) is contained by path. * @since 12 * @version 1.0 */ -bool OH_Drawing_PathContains(OH_Drawing_Path*, float x, float y); +bool OH_Drawing_PathContains(OH_Drawing_Path* path, float x, float y); /** * @brief Transforms verb array, point array, and weight by matrix. transform may change verbs * and increase their number. path is replaced by transformed data. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param path Indicates the pointer to an OH_Drawing_Path object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @since 12 * @version 1.0 */ -void OH_Drawing_PathTransform(OH_Drawing_Path*, const OH_Drawing_Matrix*); +void OH_Drawing_PathTransform(OH_Drawing_Path* path, const OH_Drawing_Matrix* matrix); /** * @brief Transforms verb array, point array, and weight by matrix. @@ -543,58 +548,58 @@ void OH_Drawing_PathTransform(OH_Drawing_Path*, const OH_Drawing_Matrix*); * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param src Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * @param dst Indicates the pointer to an OH_Drawing_Path object. * @param applyPerspectiveClip Indicates whether to apply perspective clip. * @since 12 * @version 1.0 */ -void OH_Drawing_PathTransformWithPerspectiveClip(OH_Drawing_Path* src, const OH_Drawing_Matrix*, +void OH_Drawing_PathTransformWithPerspectiveClip(OH_Drawing_Path* src, const OH_Drawing_Matrix* matrix, OH_Drawing_Path* dst, bool applyPerspectiveClip); /** * @brief Sets FillType, the rule used to fill path. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_PathFillType Indicates the add path's fill type. + * @param path Indicates the pointer to an OH_Drawing_Path object. + * @param pathFillType Indicates the add path's fill type. * @since 12 * @version 1.0 */ -void OH_Drawing_PathSetFillType(OH_Drawing_Path*, OH_Drawing_PathFillType); +void OH_Drawing_PathSetFillType(OH_Drawing_Path* path, OH_Drawing_PathFillType pathFillType); /** * @brief Gets the length of the current path object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @param forceClosed Indicates whether free to modify/delete the path after this call. * @return Returns the length of the current path object. * @since 12 * @version 1.0 */ -float OH_Drawing_PathGetLength(OH_Drawing_Path*, bool forceClosed); +float OH_Drawing_PathGetLength(OH_Drawing_Path* path, bool forceClosed); /** * @brief Gets the smallest bounding box that contains the path. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param path Indicates the pointer to an OH_Drawing_Path object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @since 12 * @version 1.0 */ -void OH_Drawing_PathGetBounds(OH_Drawing_Path*, OH_Drawing_Rect*); +void OH_Drawing_PathGetBounds(OH_Drawing_Path* path, OH_Drawing_Rect* rect); /** * @brief Closes a path. A line segment from the start point to the last point of the path is added. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @since 8 * @version 1.0 */ -void OH_Drawing_PathClose(OH_Drawing_Path*); +void OH_Drawing_PathClose(OH_Drawing_Path* path); /** * @brief Offset path replaces dst. @@ -613,11 +618,11 @@ void OH_Drawing_PathOffset(OH_Drawing_Path* path, OH_Drawing_Path* dst, float dx * @brief Resets path data. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. + * @param path Indicates the pointer to an OH_Drawing_Path object. * @since 8 * @version 1.0 */ -void OH_Drawing_PathReset(OH_Drawing_Path*); +void OH_Drawing_PathReset(OH_Drawing_Path* path); /** * @brief Determines whether the path current contour is closed. diff --git a/graphic/graphic_2d/native_drawing/drawing_path_effect.h b/graphic/graphic_2d/native_drawing/drawing_path_effect.h index b3260d576..7e3bd8e16 100644 --- a/graphic/graphic_2d/native_drawing/drawing_path_effect.h +++ b/graphic/graphic_2d/native_drawing/drawing_path_effect.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_PATH_EFFECT_H -#define C_INCLUDE_DRAWING_PATH_EFFECT_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_PATH_EFFECT_H +#define C_INCLUDE_DRAWING_PATH_EFFECT_H + #include "drawing_types.h" #ifdef __cplusplus @@ -63,11 +63,11 @@ OH_Drawing_PathEffect* OH_Drawing_CreateDashPathEffect(float* intervals, int cou * @brief Destroys an OH_Drawing_PathEffect object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_PathEffect Indicates the pointer to an OH_Drawing_PathEffect object. + * @param pathEffect Indicates the pointer to an OH_Drawing_PathEffect object. * @since 12 * @version 1.0 */ -void OH_Drawing_PathEffectDestroy(OH_Drawing_PathEffect*); +void OH_Drawing_PathEffectDestroy(OH_Drawing_PathEffect* pathEffect); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_pen.h b/graphic/graphic_2d/native_drawing/drawing_pen.h index 304439aa9..7465f4eba 100644 --- a/graphic/graphic_2d/native_drawing/drawing_pen.h +++ b/graphic/graphic_2d/native_drawing/drawing_pen.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_PEN_H -#define C_INCLUDE_DRAWING_PEN_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_PEN_H +#define C_INCLUDE_DRAWING_PEN_H + #include "drawing_types.h" #ifdef __cplusplus @@ -60,115 +60,115 @@ OH_Drawing_Pen* OH_Drawing_PenCreate(void); * @brief Creates an OH_Drawing_Pen copy object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @return Returns the pointer to the OH_Drawing_Pen object created. * If nullptr is returned, the creation fails. * The possible cause of the failure is that the available memory is empty or a nullptr is passed. * @since 12 * @version 1.0 */ -OH_Drawing_Pen* OH_Drawing_PenCopy(OH_Drawing_Pen*); +OH_Drawing_Pen* OH_Drawing_PenCopy(OH_Drawing_Pen* pen); /** * @brief Destroys an OH_Drawing_Pen object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @since 8 * @version 1.0 */ -void OH_Drawing_PenDestroy(OH_Drawing_Pen*); +void OH_Drawing_PenDestroy(OH_Drawing_Pen* pen); /** * @brief Checks whether anti-aliasing is enabled for a pen. If anti-aliasing is enabled, * edges will be drawn with partial transparency. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @return Returns true if anti-aliasing is enabled; returns false otherwise. * @since 8 * @version 1.0 */ -bool OH_Drawing_PenIsAntiAlias(const OH_Drawing_Pen*); +bool OH_Drawing_PenIsAntiAlias(const OH_Drawing_Pen* pen); /** * @brief Enables or disables anti-aliasing for a pen. If anti-aliasing is enabled, * edges will be drawn with partial transparency. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. - * @param bool Specifies whether to enable anti-aliasing. The value true means + * @param pen Indicates the pointer to an OH_Drawing_Pen object. + * @param antiAlias Specifies whether to enable anti-aliasing. The value true means * to enable anti-aliasing, and false means the opposite. * @since 8 * @version 1.0 */ -void OH_Drawing_PenSetAntiAlias(OH_Drawing_Pen*, bool); +void OH_Drawing_PenSetAntiAlias(OH_Drawing_Pen* pen, bool antiAlias); /** * @brief Obtains the color of a pen. The color is used by the pen to outline a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @return Returns a 32-bit (ARGB) variable that describes the color. * @since 8 * @version 1.0 */ -uint32_t OH_Drawing_PenGetColor(const OH_Drawing_Pen*); +uint32_t OH_Drawing_PenGetColor(const OH_Drawing_Pen* pen); /** * @brief Sets the color for a pen. The color is used by the pen to outline a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @param color Indicates the color to set, which is a 32-bit (ARGB) variable. * @since 8 * @version 1.0 */ -void OH_Drawing_PenSetColor(OH_Drawing_Pen*, uint32_t color); +void OH_Drawing_PenSetColor(OH_Drawing_Pen* pen, uint32_t color); /** * @brief Obtains the alpha of a pen. The alpha is used by the pen to outline a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @return Returns a 8-bit variable that describes the alpha. * @since 11 * @version 1.0 */ -uint8_t OH_Drawing_PenGetAlpha(const OH_Drawing_Pen*); +uint8_t OH_Drawing_PenGetAlpha(const OH_Drawing_Pen* pen); /** * @brief Sets the alpha for a pen. The alpha is used by the pen to outline a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @param alpha Indicates the alpha to set, which is a 8-bit variable. * @since 11 * @version 1.0 */ -void OH_Drawing_PenSetAlpha(OH_Drawing_Pen*, uint8_t alpha); +void OH_Drawing_PenSetAlpha(OH_Drawing_Pen* pen, uint8_t alpha); /** * @brief Obtains the thickness of a pen. This thickness determines the width of the outline of a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @return Returns the thickness. * @since 8 * @version 1.0 */ -float OH_Drawing_PenGetWidth(const OH_Drawing_Pen*); +float OH_Drawing_PenGetWidth(const OH_Drawing_Pen* pen); /** * @brief Sets the thickness for a pen. This thickness determines the width of the outline of a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @param width Indicates the thickness to set, which is a variable. * @since 8 * @version 1.0 */ -void OH_Drawing_PenSetWidth(OH_Drawing_Pen*, float width); +void OH_Drawing_PenSetWidth(OH_Drawing_Pen* pen, float width); /** * @brief Obtains the stroke miter limit of a polyline drawn by a pen. @@ -177,12 +177,12 @@ void OH_Drawing_PenSetWidth(OH_Drawing_Pen*, float width); * and a mitered corner is displayed if the miter limit is not exceeded. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @return Returns the miter limit. * @since 8 * @version 1.0 */ -float OH_Drawing_PenGetMiterLimit(const OH_Drawing_Pen*); +float OH_Drawing_PenGetMiterLimit(const OH_Drawing_Pen* pen); /** * @brief Sets the stroke miter limit for a polyline drawn by a pen. @@ -191,12 +191,12 @@ float OH_Drawing_PenGetMiterLimit(const OH_Drawing_Pen*); * and a mitered corner is displayed if the miter limit is not exceeded. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @param miter Indicates a variable that describes the miter limit. * @since 8 * @version 1.0 */ -void OH_Drawing_PenSetMiterLimit(OH_Drawing_Pen*, float miter); +void OH_Drawing_PenSetMiterLimit(OH_Drawing_Pen* pen, float miter); /** * @brief Enumerates line cap styles of a pen. The line cap style defines @@ -226,23 +226,23 @@ typedef enum { * @brief Obtains the line cap style of a pen. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @return Returns the line cap style. * @since 8 * @version 1.0 */ -OH_Drawing_PenLineCapStyle OH_Drawing_PenGetCap(const OH_Drawing_Pen*); +OH_Drawing_PenLineCapStyle OH_Drawing_PenGetCap(const OH_Drawing_Pen* pen); /** * @brief Sets the line cap style for a pen. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. - * @param OH_Drawing_PenLineCapStyle Indicates a variable that describes the line cap style. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. + * @param capStyle Indicates a variable that describes the line cap style. * @since 8 * @version 1.0 */ -void OH_Drawing_PenSetCap(OH_Drawing_Pen*, OH_Drawing_PenLineCapStyle); +void OH_Drawing_PenSetCap(OH_Drawing_Pen* pen, OH_Drawing_PenLineCapStyle capStyle); /** * @brief Enumerates pen line join styles. The line join style defines @@ -267,117 +267,117 @@ typedef enum { * @brief Obtains the line join style of a pen. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @return Returns the line join style. * @since 8 * @version 1.0 */ -OH_Drawing_PenLineJoinStyle OH_Drawing_PenGetJoin(const OH_Drawing_Pen*); +OH_Drawing_PenLineJoinStyle OH_Drawing_PenGetJoin(const OH_Drawing_Pen* pen); /** * @brief Sets the line join style for a pen. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. - * @param OH_Drawing_PenLineJoinStyle Indicates a variable that describes the line join style. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. + * @param joinStyle Indicates a variable that describes the line join style. * @since 8 * @version 1.0 */ -void OH_Drawing_PenSetJoin(OH_Drawing_Pen*, OH_Drawing_PenLineJoinStyle); +void OH_Drawing_PenSetJoin(OH_Drawing_Pen* pen, OH_Drawing_PenLineJoinStyle joinStyle); /** * @brief Sets the shaderEffect for a pen. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. - * @param OH_Drawing_ShaderEffect Indicates the pointer to an OH_Drawing_ShaderEffect object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. + * @param shaderEffect Indicates the pointer to an OH_Drawing_ShaderEffect object. * @since 11 * @version 1.0 */ -void OH_Drawing_PenSetShaderEffect(OH_Drawing_Pen*, OH_Drawing_ShaderEffect*); +void OH_Drawing_PenSetShaderEffect(OH_Drawing_Pen* pen, OH_Drawing_ShaderEffect* shaderEffect); /** * @brief Sets the shadowLayer for a pen. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. - * @param OH_Drawing_ShadowLayer Indicates the pointer to an OH_Drawing_ShadowLayer object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. + * @param shadowLayer Indicates the pointer to an OH_Drawing_ShadowLayer object. * @since 12 * @version 1.0 */ -void OH_Drawing_PenSetShadowLayer(OH_Drawing_Pen*, OH_Drawing_ShadowLayer*); +void OH_Drawing_PenSetShadowLayer(OH_Drawing_Pen* pen, OH_Drawing_ShadowLayer* shadowLayer); /** * @brief Sets the pathEffect for a pen. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. - * @param OH_Drawing_PathEffect Indicates the pointer to an OH_Drawing_PathEffect object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pathEffect Indicates the pointer to an OH_Drawing_PathEffect object. * @since 12 * @version 1.0 */ -void OH_Drawing_PenSetPathEffect(OH_Drawing_Pen*, OH_Drawing_PathEffect*); +void OH_Drawing_PenSetPathEffect(OH_Drawing_Pen* pen, OH_Drawing_PathEffect* pathEffect); /** * @brief Sets the filter for a pen. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. - * @param OH_Drawing_Filter Indicates the pointer to an OH_Drawing_Filter object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. + * @param filter Indicates the pointer to an OH_Drawing_Filter object. * @since 11 * @version 1.0 */ -void OH_Drawing_PenSetFilter(OH_Drawing_Pen*, OH_Drawing_Filter*); +void OH_Drawing_PenSetFilter(OH_Drawing_Pen* pen, OH_Drawing_Filter* filter); /** * @brief Gets the filter from a pen. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. - * @param OH_Drawing_Filter Indicates the pointer to an OH_Drawing_Filter object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. + * @param filter Indicates the pointer to an OH_Drawing_Filter object. * @since 12 * @version 1.0 */ -void OH_Drawing_PenGetFilter(OH_Drawing_Pen*, OH_Drawing_Filter*); +void OH_Drawing_PenGetFilter(OH_Drawing_Pen* pen, OH_Drawing_Filter* filter); /** * @brief Sets a blender that implements the specified blendmode enum for a pen. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. - * @param OH_Drawing_BlendMode Indicates the blend mode. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. + * @param blendMode Indicates the blend mode. * @since 12 * @version 1.0 */ -void OH_Drawing_PenSetBlendMode(OH_Drawing_Pen*, OH_Drawing_BlendMode); +void OH_Drawing_PenSetBlendMode(OH_Drawing_Pen* pen, OH_Drawing_BlendMode blendMode); /** * @brief Gets the filled equivalent of the src path. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @param src Indicates the Path read to create a filled version. * @param dst Indicates the resulting Path. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object that limits the PathEffect area if + * @param rect Indicates the pointer to an OH_Drawing_Rect object that limits the PathEffect area if Pen has PathEffect. - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object that tranfomation applied to + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object that tranfomation applied to PathEffect if Pen has PathEffect. * @return Returns true if get successes; false if get fails. * @since 12 * @version 1.0 */ -bool OH_Drawing_PenGetFillPath(OH_Drawing_Pen*, const OH_Drawing_Path* src, OH_Drawing_Path* dst, - const OH_Drawing_Rect*, const OH_Drawing_Matrix*); +bool OH_Drawing_PenGetFillPath(OH_Drawing_Pen* pen, const OH_Drawing_Path* src, OH_Drawing_Path* dst, + const OH_Drawing_Rect* rect, const OH_Drawing_Matrix* matrix); /** * @brief Resets all pen contents to their initial values. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @since 12 * @version 1.0 */ -void OH_Drawing_PenReset(OH_Drawing_Pen*); +void OH_Drawing_PenReset(OH_Drawing_Pen* pen); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_pixel_map.h b/graphic/graphic_2d/native_drawing/drawing_pixel_map.h index ef29ce5b4..0c0eb5e09 100644 --- a/graphic/graphic_2d/native_drawing/drawing_pixel_map.h +++ b/graphic/graphic_2d/native_drawing/drawing_pixel_map.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_PIXEL_MAP_H -#define C_INCLUDE_DRAWING_PIXEL_MAP_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_PIXEL_MAP_H +#define C_INCLUDE_DRAWING_PIXEL_MAP_H + #include "drawing_types.h" #ifdef __cplusplus @@ -64,36 +64,36 @@ typedef struct OH_PixelmapNative OH_PixelmapNative; * @brief Gets an OH_Drawing_PixelMap object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param NativePixelMap_ Indicates a pointer to an native pixelmap supported by image framework. + * @param nativePixelMap Indicates a pointer to an native pixelmap supported by image framework. * @return Returns the pointer to the OH_Drawing_PixelMap object. * @since 12 * @version 1.0 */ -OH_Drawing_PixelMap* OH_Drawing_PixelMapGetFromNativePixelMap(NativePixelMap_*); +OH_Drawing_PixelMap* OH_Drawing_PixelMapGetFromNativePixelMap(NativePixelMap_* nativePixelMap); /** * @brief Gets an OH_Drawing_PixelMap object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_PixelmapNative Indicates a pointer to the OH_PixelmapNative object supported by image framework. + * @param pixelmapNative Indicates a pointer to the OH_PixelmapNative object supported by image framework. * @return Returns the pointer to the OH_Drawing_PixelMap object. * If nullptr is returned, the get operation fails. * The possible cause of the failure is that a nullptr is passed. * @since 12 * @version 1.0 */ -OH_Drawing_PixelMap* OH_Drawing_PixelMapGetFromOhPixelMapNative(OH_PixelmapNative*); +OH_Drawing_PixelMap* OH_Drawing_PixelMapGetFromOhPixelMapNative(OH_PixelmapNative* pixelmapNative); /** * @brief Dissolves the relationship between OH_Drawing_PixelMap object and NativePixelMap_ or OH_PixelmapNative which is build by 'GetFrom' function. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_PixelMap Indicates a pointer to the OH_Drawing_PixelMap. + * @param pixelMap Indicates a pointer to the OH_Drawing_PixelMap. * @since 12 * @version 1.0 */ -void OH_Drawing_PixelMapDissolve(OH_Drawing_PixelMap*); +void OH_Drawing_PixelMapDissolve(OH_Drawing_PixelMap* pixelMap); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_point.h b/graphic/graphic_2d/native_drawing/drawing_point.h index 47756fb65..d3c8f5a46 100644 --- a/graphic/graphic_2d/native_drawing/drawing_point.h +++ b/graphic/graphic_2d/native_drawing/drawing_point.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_POINT_H -#define C_INCLUDE_DRAWING_POINT_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_POINT_H +#define C_INCLUDE_DRAWING_POINT_H + #include "drawing_error_code.h" #include "drawing_types.h" @@ -106,11 +106,11 @@ OH_Drawing_ErrorCode OH_Drawing_PointSet(OH_Drawing_Point* point, float x, float * @brief Destroys an OH_Drawing_Point object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Point Indicates the pointer to an OH_Drawing_Point object. + * @param point Indicates the pointer to an OH_Drawing_Point object. * @since 11 * @version 1.0 */ -void OH_Drawing_PointDestroy(OH_Drawing_Point*); +void OH_Drawing_PointDestroy(OH_Drawing_Point* point); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_record_cmd.h b/graphic/graphic_2d/native_drawing/drawing_record_cmd.h index 63c03f03b..95ae73385 100644 --- a/graphic/graphic_2d/native_drawing/drawing_record_cmd.h +++ b/graphic/graphic_2d/native_drawing/drawing_record_cmd.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_RECORD_CMD_H -#define C_INCLUDE_DRAWING_RECORD_CMD_H - /** * @addtogroup Drawing * @{ @@ -33,11 +30,16 @@ * * @brief Declares functions related to the RecordCmd object in the drawing module. * + * @kit ArkGraphics2D * @library libnative_drawing.so + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @since 13 * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_RECORD_CMD_H +#define C_INCLUDE_DRAWING_RECORD_CMD_H + #include "drawing_types.h" #include "drawing_error_code.h" diff --git a/graphic/graphic_2d/native_drawing/drawing_rect.h b/graphic/graphic_2d/native_drawing/drawing_rect.h index d247e88f7..8e6f1ab10 100644 --- a/graphic/graphic_2d/native_drawing/drawing_rect.h +++ b/graphic/graphic_2d/native_drawing/drawing_rect.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_RECT_H -#define C_INCLUDE_DRAWING_RECT_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_RECT_H +#define C_INCLUDE_DRAWING_RECT_H + #include "drawing_types.h" #ifdef __cplusplus @@ -133,65 +133,66 @@ void OH_Drawing_RectSetBottom(OH_Drawing_Rect* rect, float bottom); * @brief Get the left position of the rect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @return Return the left position of the rect. * @since 12 * @version 1.0 */ -float OH_Drawing_RectGetLeft(OH_Drawing_Rect*); +float OH_Drawing_RectGetLeft(OH_Drawing_Rect* rect); /** * @brief Get the top position of the rect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @return Return the top position of the rect. * @since 12 * @version 1.0 */ -float OH_Drawing_RectGetTop(OH_Drawing_Rect*); +float OH_Drawing_RectGetTop(OH_Drawing_Rect* rect); /** * @brief Get the right position of the rect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @return Return the right position of the rect. * @since 12 * @version 1.0 */ -float OH_Drawing_RectGetRight(OH_Drawing_Rect*); +float OH_Drawing_RectGetRight(OH_Drawing_Rect* rect); /** * @brief Get the bottom position of the rect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @return Return the bottom position of the rect. * @since 12 * @version 1.0 */ -float OH_Drawing_RectGetBottom(OH_Drawing_Rect*); +float OH_Drawing_RectGetBottom(OH_Drawing_Rect* rect); /** * @brief Get the height position of the rect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @since 12 * @version 1.0 */ -float OH_Drawing_RectGetHeight(OH_Drawing_Rect*); +float OH_Drawing_RectGetHeight(OH_Drawing_Rect* rect); -/* @brief Get the width position of the rect. +/** + * @brief Get the width position of the rect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @return Returns the width. * @since 12 * @version 1.0 */ -float OH_Drawing_RectGetWidth(OH_Drawing_Rect*); +float OH_Drawing_RectGetWidth(OH_Drawing_Rect* rect); /** * @brief Copy the original rectangular object to the destination rectangular object. @@ -208,11 +209,11 @@ void OH_Drawing_RectCopy(OH_Drawing_Rect* src, OH_Drawing_Rect* dst); * @brief Destroys an OH_Drawing_Rect object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @since 11 * @version 1.0 */ -void OH_Drawing_RectDestroy(OH_Drawing_Rect*); +void OH_Drawing_RectDestroy(OH_Drawing_Rect* rect); /** * @brief Creates an OH_Drawing_Array object, which is used to store multiple OH_Drawing_Rect object. diff --git a/graphic/graphic_2d/native_drawing/drawing_region.h b/graphic/graphic_2d/native_drawing/drawing_region.h index 39eb09315..ea27f3bce 100644 --- a/graphic/graphic_2d/native_drawing/drawing_region.h +++ b/graphic/graphic_2d/native_drawing/drawing_region.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_REGION_H -#define C_INCLUDE_DRAWING_REGION_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_REGION_H +#define C_INCLUDE_DRAWING_REGION_H + #include "drawing_types.h" #ifdef __cplusplus @@ -94,8 +94,8 @@ OH_Drawing_Region* OH_Drawing_RegionCreate(void); * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param region Indicates the pointer to an OH_Drawing_Region object. - * @param int32_t x-coordinate. - * @param int32_t y-coordinate. + * @param x x-coordinate. + * @param y y-coordinate. * @return Returns true if (x, y) is inside region; returns false otherwise. * @since 12 * @version 1.0 @@ -119,8 +119,8 @@ bool OH_Drawing_RegionOp(OH_Drawing_Region* region, const OH_Drawing_Region* oth * @brief Sets the region to the specified rect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Region Indicates the pointer to an OH_Drawing_Region object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param region Indicates the pointer to an OH_Drawing_Region object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @return Return true if constructed Region is not empty. * @since 12 * @version 1.0 @@ -144,11 +144,11 @@ bool OH_Drawing_RegionSetPath(OH_Drawing_Region* region, const OH_Drawing_Path* * @brief Destroys an OH_Drawing_Region object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Region Indicates the pointer to an OH_Drawing_Region object. + * @param region Indicates the pointer to an OH_Drawing_Region object. * @since 12 * @version 1.0 */ -void OH_Drawing_RegionDestroy(OH_Drawing_Region*); +void OH_Drawing_RegionDestroy(OH_Drawing_Region* region); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_round_rect.h b/graphic/graphic_2d/native_drawing/drawing_round_rect.h index b60f49183..e3dec061f 100644 --- a/graphic/graphic_2d/native_drawing/drawing_round_rect.h +++ b/graphic/graphic_2d/native_drawing/drawing_round_rect.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_ROUND_RECT_H -#define C_INCLUDE_DRAWING_ROUND_RECT_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_ROUND_RECT_H +#define C_INCLUDE_DRAWING_ROUND_RECT_H + #include "drawing_error_code.h" #include "drawing_types.h" @@ -76,48 +76,49 @@ typedef enum { * @brief Creates an OH_Drawing_RoundRect object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @param xRad Indicates the corner radii on x-axis. * @param yRad Indicates the corner radii on y-axis. * @return Returns the pointer to the OH_Drawing_RoundRect object created. * @since 11 * @version 1.0 */ -OH_Drawing_RoundRect* OH_Drawing_RoundRectCreate(const OH_Drawing_Rect*, float xRad, float yRad); +OH_Drawing_RoundRect* OH_Drawing_RoundRectCreate(const OH_Drawing_Rect* rect, float xRad, float yRad); /** * @brief Sets the radiusX and radiusY for a specific corner position. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_RoundRect Indicates the pointer to an OH_Drawing_Rect object. + * @param roundRect Indicates the pointer to an OH_Drawing_Rect object. * @param pos Indicates the corner radii position. - * @param OH_Drawing_Corner_Radii Indicates the corner radii on x-axis and y-axis. + * @param radii Indicates the corner radii on x-axis and y-axis. * @since 12 * @version 1.0 */ -void OH_Drawing_RoundRectSetCorner(OH_Drawing_RoundRect*, OH_Drawing_CornerPos pos, OH_Drawing_Corner_Radii); +void OH_Drawing_RoundRectSetCorner(OH_Drawing_RoundRect* roundRect, + OH_Drawing_CornerPos pos, OH_Drawing_Corner_Radii radii); /** * @brief Gets an OH_Drawing_Corner_Radii struct, the point is round corner radiusX and radiusY. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_RoundRect Indicates the pointer to an OH_Drawing_RoundRect object. + * @param roundRect Indicates the pointer to an OH_Drawing_RoundRect object. * @param pos Indicates the corner radii position. * @return Returns the corner radii of OH_Drawing_Corner_Radii struct. * @since 12 * @version 1.0 */ -OH_Drawing_Corner_Radii OH_Drawing_RoundRectGetCorner(OH_Drawing_RoundRect*, OH_Drawing_CornerPos pos); +OH_Drawing_Corner_Radii OH_Drawing_RoundRectGetCorner(OH_Drawing_RoundRect* roundRect, OH_Drawing_CornerPos pos); /** * @brief Destroys an OH_Drawing_RoundRect object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_RoundRect Indicates the pointer to an OH_Drawing_RoundRect object. + * @param roundRect Indicates the pointer to an OH_Drawing_RoundRect object. * @since 11 * @version 1.0 */ -void OH_Drawing_RoundRectDestroy(OH_Drawing_RoundRect*); +void OH_Drawing_RoundRectDestroy(OH_Drawing_RoundRect* roundRect); /** * @brief Translates round rect by (dx, dy). diff --git a/graphic/graphic_2d/native_drawing/drawing_sampling_options.h b/graphic/graphic_2d/native_drawing/drawing_sampling_options.h index b613776cf..ee55c81b1 100644 --- a/graphic/graphic_2d/native_drawing/drawing_sampling_options.h +++ b/graphic/graphic_2d/native_drawing/drawing_sampling_options.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_SAMPLING_OPTIONS_H -#define C_INCLUDE_DRAWING_SAMPLING_OPTIONS_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_SAMPLING_OPTIONS_H +#define C_INCLUDE_DRAWING_SAMPLING_OPTIONS_H + #include "drawing_types.h" #ifdef __cplusplus @@ -78,23 +78,24 @@ typedef enum { * @brief Creates an OH_Drawing_SamplingOptions object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FilterMode sampling filter mode. - * @param OH_Drawing_MipmapMode sampling mipmap mode.. + * @param filterMode sampling filter mode. + * @param mipmapMode sampling mipmap mode.. * @return Returns the pointer to the OH_Drawing_SamplingOptions object created. * @since 12 * @version 1.0 */ -OH_Drawing_SamplingOptions* OH_Drawing_SamplingOptionsCreate(OH_Drawing_FilterMode, OH_Drawing_MipmapMode); +OH_Drawing_SamplingOptions* OH_Drawing_SamplingOptionsCreate(OH_Drawing_FilterMode filterMode, + OH_Drawing_MipmapMode mipmapMode); /** * @brief Destroys an OH_Drawing_SamplingOptions object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_SamplingOptions Indicates the pointer to an OH_Drawing_SamplingOptions object. + * @param samplingOptions Indicates the pointer to an OH_Drawing_SamplingOptions object. * @since 12 * @version 1.0 */ -void OH_Drawing_SamplingOptionsDestroy(OH_Drawing_SamplingOptions*); +void OH_Drawing_SamplingOptionsDestroy(OH_Drawing_SamplingOptions* samplingOptions); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_shader_effect.h b/graphic/graphic_2d/native_drawing/drawing_shader_effect.h index f3a6245c0..b42156a5f 100644 --- a/graphic/graphic_2d/native_drawing/drawing_shader_effect.h +++ b/graphic/graphic_2d/native_drawing/drawing_shader_effect.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_SHADER_EFFECT_H -#define C_INCLUDE_DRAWING_SHADER_EFFECT_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_SHADER_EFFECT_H +#define C_INCLUDE_DRAWING_SHADER_EFFECT_H + #include "drawing_types.h" #ifdef __cplusplus @@ -94,13 +94,14 @@ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateColorShader(const uint32_t * @param colors Indicates the colors to be distributed between the two points. * @param pos Indicates the relative position of each corresponding color in the colors array. * @param size Indicates the number of colors and pos. - * @param OH_Drawing_TileMode Indicates the tile mode. + * @param tileMode Indicates the tile mode. * @return Returns the pointer to the OH_Drawing_ShaderEffect object created. * @since 11 * @version 1.0 */ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateLinearGradient(const OH_Drawing_Point* startPt, - const OH_Drawing_Point* endPt, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode); + const OH_Drawing_Point* endPt, const uint32_t* colors, + const float* pos, uint32_t size, OH_Drawing_TileMode tileMode); /** * @brief Creates an OH_Drawing_ShaderEffect that generates a linear gradient between the two specified points. @@ -112,8 +113,8 @@ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateLinearGradient(const OH_Dr * @param pos Indicates the relative position of each corresponding color in the colors array. * If pos is nullptr, the colors are evenly distributed between the start and end point. * @param size Indicates the number of colors and pos(if pos is not nullptr). - * @param OH_Drawing_TileMode Indicates the tile mode. - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object, + * @param tileMode Indicates the tile mode. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object, which represents the local matrix of the created OH_Drawing_ShaderEffect object. If matrix is nullptr, defaults to the identity matrix. * @return Returns the pointer to the OH_Drawing_ShaderEffect object created. @@ -124,7 +125,7 @@ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateLinearGradient(const OH_Dr */ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix( const OH_Drawing_Point2D* startPt, const OH_Drawing_Point2D* endPt, const uint32_t* colors, const float* pos, - uint32_t size, OH_Drawing_TileMode, const OH_Drawing_Matrix*); + uint32_t size, OH_Drawing_TileMode tileMode, const OH_Drawing_Matrix* matrix); /** * @brief Creates an OH_Drawing_ShaderEffect that generates a radial gradient given the center and radius. @@ -135,13 +136,13 @@ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMat * @param colors Indicates the colors to be distributed between the two points. * @param pos Indicates the relative position of each corresponding color in the colors array. * @param size Indicates the number of colors and pos. - * @param OH_Drawing_TileMode Indicates the tile mode. + * @param tileMode Indicates the tile mode. * @return Returns the pointer to the OH_Drawing_ShaderEffect object created. * @since 11 * @version 1.0 */ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateRadialGradient(const OH_Drawing_Point* centerPt, float radius, - const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode); + const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode tileMode); /** * @brief Creates an OH_Drawing_ShaderEffect that generates a radial gradient given the center and radius. @@ -152,8 +153,8 @@ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateRadialGradient(const OH_Dr * @param colors Indicates the colors to be distributed between the two points. * @param pos Indicates the relative position of each corresponding color in the colors array. * @param size Indicates the number of colors and pos. - * @param OH_Drawing_TileMode Indicates the tile mode. - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object, + * @param tileMode Indicates the tile mode. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object, which represents the local matrix of the created OH_Drawing_ShaderEffect object. If matrix is nullptr, defaults to the identity matrix. * @return Returns the pointer to the OH_Drawing_ShaderEffect object created. @@ -164,7 +165,7 @@ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateRadialGradient(const OH_Dr */ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMatrix( const OH_Drawing_Point2D* centerPt, float radius, const uint32_t* colors, const float* pos, uint32_t size, - OH_Drawing_TileMode, const OH_Drawing_Matrix*); + OH_Drawing_TileMode tileMode, const OH_Drawing_Matrix* matrix); /** * @brief Creates an OH_Drawing_ShaderEffect that generates a sweep gradient given a center. @@ -174,30 +175,31 @@ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMat * @param colors Indicates the colors to be distributed between the two points. * @param pos Indicates the relative position of each corresponding color in the colors array. * @param size Indicates the number of colors and pos. - * @param OH_Drawing_TileMode Indicates the tile mode. + * @param tileMode Indicates the tile mode. * @return Returns the pointer to the OH_Drawing_ShaderEffect object created. * @since 11 * @version 1.0 */ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateSweepGradient(const OH_Drawing_Point* centerPt, - const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode); + const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode tileMode); /** * @brief Creates an OH_Drawing_ShaderEffect that generates a image shader. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Image Indicates the pointer to an OH_Drawing_Image object. + * @param image Indicates the pointer to an OH_Drawing_Image object. * @param tileX Indicates the tileX. * @param tileY Indicates the tileY. - * @param OH_Drawing_SamplingOptions Indicates the pointer to an OH_Drawing_SamplingOptions object. - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param samplingOptions Indicates the pointer to an OH_Drawing_SamplingOptions object. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object. * If matrix is nullptr, defaults to the identity matrix. * @return Returns the pointer to the OH_Drawing_ShaderEffect object created. * @since 12 * @version 1.0 */ -OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateImageShader(OH_Drawing_Image*, - OH_Drawing_TileMode tileX, OH_Drawing_TileMode tileY, const OH_Drawing_SamplingOptions*, const OH_Drawing_Matrix*); +OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateImageShader(OH_Drawing_Image* image, + OH_Drawing_TileMode tileX, OH_Drawing_TileMode tileY, const OH_Drawing_SamplingOptions* samplingOptions, + const OH_Drawing_Matrix* matrix); /** * @brief Creates an OH_Drawing_ShaderEffect that generates a conical gradient given two circles. @@ -210,8 +212,8 @@ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateImageShader(OH_Drawing_Ima * @param colors Indicates the colors to be distributed between the two points. * @param pos Indicates the relative position of each corresponding color in the colors array. * @param size Indicates the number of colors and pos. - * @param OH_Drawing_TileMode Indicates the tile mode. - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object, + * @param tileMode Indicates the tile mode. + * @param matrix Indicates the pointer to an OH_Drawing_Matrix object, which represents the local matrix of the created OH_Drawing_ShaderEffect object. If matrix is nullptr, defaults to the identity matrix. * @return Returns the pointer to the OH_Drawing_ShaderEffect object created. @@ -222,17 +224,17 @@ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateImageShader(OH_Drawing_Ima */ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateTwoPointConicalGradient(const OH_Drawing_Point2D* startPt, float startRadius, const OH_Drawing_Point2D* endPt, float endRadius, const uint32_t* colors, const float* pos, - uint32_t size, OH_Drawing_TileMode, const OH_Drawing_Matrix*); + uint32_t size, OH_Drawing_TileMode tileMode, const OH_Drawing_Matrix* matrix); /** * @brief Destroys an OH_Drawing_ShaderEffect object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_ShaderEffect Indicates the pointer to an OH_Drawing_ShaderEffect object. + * @param shaderEffect Indicates the pointer to an OH_Drawing_ShaderEffect object. * @since 11 * @version 1.0 */ -void OH_Drawing_ShaderEffectDestroy(OH_Drawing_ShaderEffect*); +void OH_Drawing_ShaderEffectDestroy(OH_Drawing_ShaderEffect* shaderEffect); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_shadow_layer.h b/graphic/graphic_2d/native_drawing/drawing_shadow_layer.h index 6b78e034a..143e72801 100644 --- a/graphic/graphic_2d/native_drawing/drawing_shadow_layer.h +++ b/graphic/graphic_2d/native_drawing/drawing_shadow_layer.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_SHADOW_LAYER_H -#define C_INCLUDE_DRAWING_SHADOW_LAYER_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_SHADOW_LAYER_H +#define C_INCLUDE_DRAWING_SHADOW_LAYER_H + #include "drawing_types.h" #ifdef __cplusplus @@ -64,11 +64,11 @@ OH_Drawing_ShadowLayer* OH_Drawing_ShadowLayerCreate(float blurRadius, float x, * @brief Destroys an OH_Drawing_ShadowLayer object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_ShadowLayer Indicates the pointer to an OH_Drawing_ShadowLayer object. + * @param shadowLayer Indicates the pointer to an OH_Drawing_ShadowLayer object. * @since 12 * @version 1.0 */ -void OH_Drawing_ShadowLayerDestroy(OH_Drawing_ShadowLayer*); +void OH_Drawing_ShadowLayerDestroy(OH_Drawing_ShadowLayer* shadowLayer); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_surface.h b/graphic/graphic_2d/native_drawing/drawing_surface.h index b388ead2a..d8aa609ad 100644 --- a/graphic/graphic_2d/native_drawing/drawing_surface.h +++ b/graphic/graphic_2d/native_drawing/drawing_surface.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_GPU_SURFACE_H -#define C_INCLUDE_DRAWING_GPU_SURFACE_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_GPU_SURFACE_H +#define C_INCLUDE_DRAWING_GPU_SURFACE_H + #include "drawing_types.h" #ifdef __cplusplus @@ -50,37 +50,37 @@ extern "C" { * @brief Creates an OH_Drawing_Surface object on GPU indicated by context. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_GpuContext Indicates the pointer to an OH_Drawing_GpuContext object. - * @param bool Indicates whether an allocation should count against a cache budget. - * @param OH_Drawing_Image_Info Indicates the image info. + * @param gpuContext Indicates the pointer to an OH_Drawing_GpuContext object. + * @param flag Indicates whether an allocation should count against a cache budget. + * @param imageInfo Indicates the image info. * @return Returns the pointer to the OH_Drawing_Surface object created. * @since 12 * @version 1.0 */ OH_Drawing_Surface* OH_Drawing_SurfaceCreateFromGpuContext( - OH_Drawing_GpuContext*, bool, OH_Drawing_Image_Info); + OH_Drawing_GpuContext* gpuContext, bool flag, OH_Drawing_Image_Info imageInfo); /** * @brief Gets the canvas that draws into surface. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Surface Indicates the pointer to an OH_Drawing_Surface object. + * @param surface Indicates the pointer to an OH_Drawing_Surface object. * @return Returns the pointer to the OH_Drawing_Canvas object. The returned pointer does not need to be managed * by the caller. * @since 12 * @version 1.0 */ -OH_Drawing_Canvas* OH_Drawing_SurfaceGetCanvas(OH_Drawing_Surface*); +OH_Drawing_Canvas* OH_Drawing_SurfaceGetCanvas(OH_Drawing_Surface* surface); /** * @brief Destroys an OH_Drawing_Surface object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Surface Indicates the pointer to an OH_Drawing_Surface object. + * @param surface Indicates the pointer to an OH_Drawing_Surface object. * @since 12 * @version 1.0 */ -void OH_Drawing_SurfaceDestroy(OH_Drawing_Surface*); +void OH_Drawing_SurfaceDestroy(OH_Drawing_Surface* surface); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_text_blob.h b/graphic/graphic_2d/native_drawing/drawing_text_blob.h index b5b11d7af..5a0dbdfd6 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_blob.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_blob.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_TEXT_BLOB_H -#define C_INCLUDE_DRAWING_TEXT_BLOB_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_TEXT_BLOB_H +#define C_INCLUDE_DRAWING_TEXT_BLOB_H + #include "drawing_types.h" #ifdef __cplusplus @@ -62,14 +62,14 @@ OH_Drawing_TextBlobBuilder* OH_Drawing_TextBlobBuilderCreate(void); * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param text Indicates the the pointer to text. * @param byteLength Indicates the text length. - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. - * @param OH_Drawing_TextEncoding Indicates the pointer to an OH_Drawing_TextEncoding object. + * @param font Indicates the pointer to an OH_Drawing_Font object. + * @param textEncoding Indicates the pointer to an OH_Drawing_TextEncoding object. * @return Returns the pointer to the OH_Drawing_TextBlob object created. * @since 12 * @version 1.0 */ OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromText(const void* text, size_t byteLength, - const OH_Drawing_Font*, OH_Drawing_TextEncoding); + const OH_Drawing_Font* font, OH_Drawing_TextEncoding textEncoding); /** * @brief Creates an OH_Drawing_TextBlob object from pos text. @@ -77,51 +77,51 @@ OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromText(const void* text, size_t * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param text Indicates the the pointer to text. * @param byteLength Indicates the text length. - * @param OH_Drawing_Point2D Indicates the pointer to an OH_Drawing_Point2D array object. - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. - * @param OH_Drawing_TextEncoding Indicates the pointer to an OH_Drawing_TextEncoding object. + * @param point2D Indicates the pointer to an OH_Drawing_Point2D array object. + * @param font Indicates the pointer to an OH_Drawing_Font object. + * @param textEncoding Indicates the pointer to an OH_Drawing_TextEncoding object. * @return Returns the pointer to the OH_Drawing_TextBlob object created. * @since 12 * @version 1.0 */ OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromPosText(const void* text, size_t byteLength, - OH_Drawing_Point2D*, const OH_Drawing_Font*, OH_Drawing_TextEncoding); + OH_Drawing_Point2D* point2D, const OH_Drawing_Font* font, OH_Drawing_TextEncoding textEncoding); /** * @brief Creates an OH_Drawing_TextBlob object from pos text. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param str Indicates the the pointer to text. - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. - * @param OH_Drawing_TextEncoding Indicates the pointer to an OH_Drawing_TextEncoding object. + * @param font Indicates the pointer to an OH_Drawing_Font object. + * @param textEncoding Indicates the pointer to an OH_Drawing_TextEncoding object. * @return Returns the pointer to the OH_Drawing_TextBlob object created. * @since 12 * @version 1.0 */ OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromString(const char* str, - const OH_Drawing_Font*, OH_Drawing_TextEncoding); + const OH_Drawing_Font* font, OH_Drawing_TextEncoding textEncoding); /** * @brief Gets the bounds of textblob, assigned to the pointer to an OH_Drawing_Rect object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextBlob Indicates the pointer to an OH_Drawing_TextBlob object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. + * @param textBlob Indicates the pointer to an OH_Drawing_TextBlob object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. * @since 12 * @version 1.0 */ -void OH_Drawing_TextBlobGetBounds(OH_Drawing_TextBlob*, OH_Drawing_Rect*); +void OH_Drawing_TextBlobGetBounds(OH_Drawing_TextBlob* textBlob, OH_Drawing_Rect* rect); /** * @brief Gets a non-zero value unique among all OH_Drawing_TextBlob objects. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextBlob Indicates the pointer to an OH_Drawing_TextBlob object. + * @param textBlob Indicates the pointer to an OH_Drawing_TextBlob object. * @return Returns identifier for the OH_Drawing_TextBlob object. * @since 12 * @version 1.0 */ -uint32_t OH_Drawing_TextBlobUniqueID(const OH_Drawing_TextBlob*); +uint32_t OH_Drawing_TextBlobUniqueID(const OH_Drawing_TextBlob* textBlob); /** * @brief Defines a run, supplies storage for glyphs and positions. @@ -145,46 +145,46 @@ typedef struct { * by the caller and is forbidden to be used after OH_Drawing_TextBlobBuilderMake is called. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextBlobBuilder Indicates the pointer to an OH_Drawing_TextBlobBuilder object. - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param textBlobBuilder Indicates the pointer to an OH_Drawing_TextBlobBuilder object. + * @param font Indicates the pointer to an OH_Drawing_Font object. * @param count Indicates the number of glyphs. - * @param OH_Drawing_Rect Indicates the optional run bounding box. + * @param rect Indicates the optional run bounding box. * @since 11 * @version 1.0 */ -const OH_Drawing_RunBuffer* OH_Drawing_TextBlobBuilderAllocRunPos(OH_Drawing_TextBlobBuilder*, const OH_Drawing_Font*, - int32_t count, const OH_Drawing_Rect*); +const OH_Drawing_RunBuffer* OH_Drawing_TextBlobBuilderAllocRunPos(OH_Drawing_TextBlobBuilder* textBlobBuilder, + const OH_Drawing_Font* font, int32_t count, const OH_Drawing_Rect* rect); /** * @brief Make an OH_Drawing_TextBlob from OH_Drawing_TextBlobBuilder. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextBlobBuilder Indicates the pointer to an OH_Drawing_TextBlobBuilder object. + * @param textBlobBuilder Indicates the pointer to an OH_Drawing_TextBlobBuilder object. * @return Returns the pointer to the OH_Drawing_TextBlob object. * @since 11 * @version 1.0 */ -OH_Drawing_TextBlob* OH_Drawing_TextBlobBuilderMake(OH_Drawing_TextBlobBuilder*); +OH_Drawing_TextBlob* OH_Drawing_TextBlobBuilderMake(OH_Drawing_TextBlobBuilder* textBlobBuilder); /** * @brief Destroys an OH_Drawing_TextBlob object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextBlob Indicates the pointer to an OH_Drawing_TextBlob object. + * @param textBlob Indicates the pointer to an OH_Drawing_TextBlob object. * @since 11 * @version 1.0 */ -void OH_Drawing_TextBlobDestroy(OH_Drawing_TextBlob*); +void OH_Drawing_TextBlobDestroy(OH_Drawing_TextBlob* textBlob); /** * @brief Destroys an OH_Drawing_TextBlobBuilder object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextBlobBuilder Indicates the pointer to an OH_Drawing_TextBlobBuilder object. + * @param textBlobBuilder Indicates the pointer to an OH_Drawing_TextBlobBuilder object. * @since 11 * @version 1.0 */ -void OH_Drawing_TextBlobBuilderDestroy(OH_Drawing_TextBlobBuilder*); +void OH_Drawing_TextBlobBuilderDestroy(OH_Drawing_TextBlobBuilder* textBlobBuilder); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_typeface.h b/graphic/graphic_2d/native_drawing/drawing_typeface.h index fa3d016e9..0b5e8d965 100644 --- a/graphic/graphic_2d/native_drawing/drawing_typeface.h +++ b/graphic/graphic_2d/native_drawing/drawing_typeface.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_TYPEFACE_H -#define C_INCLUDE_DRAWING_TYPEFACE_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_TYPEFACE_H +#define C_INCLUDE_DRAWING_TYPEFACE_H + #include "drawing_error_code.h" #include "drawing_types.h" @@ -112,23 +112,23 @@ OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromCurrent(const OH_Drawing_Typef * it or free it again. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_MemoryStream Indicates the pointer to an OH_Drawing_MemoryStream object. + * @param memoryStream Indicates the pointer to an OH_Drawing_MemoryStream object. * @param index memory stream index. * @return Returns the pointer to the OH_Drawing_Typeface object created. * @since 12 * @version 1.0 */ -OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromStream(OH_Drawing_MemoryStream*, int32_t index); +OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromStream(OH_Drawing_MemoryStream* memoryStream, int32_t index); /** * @brief Destroys an OH_Drawing_Typeface object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typeface Indicates the pointer to an OH_Drawing_Typeface object. + * @param typeface Indicates the pointer to an OH_Drawing_Typeface object. * @since 11 * @version 1.0 */ -void OH_Drawing_TypefaceDestroy(OH_Drawing_Typeface*); +void OH_Drawing_TypefaceDestroy(OH_Drawing_Typeface* typeface); /** * @brief Creates an OH_Drawing_FontArguments object. diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h index 1a4d8499c..3827d52ea 100644 --- a/graphic/graphic_2d/native_drawing/drawing_types.h +++ b/graphic/graphic_2d/native_drawing/drawing_types.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_TYPES_H -#define C_INCLUDE_DRAWING_TYPES_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_TYPES_H +#define C_INCLUDE_DRAWING_TYPES_H + #include #include #include -- Gitee From 7edc35c7f5ae973d192cebbd25a6c177764703d7 Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Thu, 14 Nov 2024 03:35:30 +0000 Subject: [PATCH 404/620] ad Signed-off-by: Feng Lin --- multimedia/media_foundation/native_averrors.h | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/multimedia/media_foundation/native_averrors.h b/multimedia/media_foundation/native_averrors.h index 1bb0f8062..d14fb900d 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -108,7 +108,7 @@ typedef enum OH_AVErrCode { */ AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION = 301, /** - * @error the address of server is incorrect, and IO can not find host. + * @error can not find host, maybe the address of server is incorrect. * @since 14 */ AV_ERR_IO_CANNOT_FIND_HOST = 5411001, @@ -143,19 +143,19 @@ typedef enum OH_AVErrCode { */ AV_ERR_IO_RESOURCE_NOT_FOUND = 5411007, /** - * @error the server failS to verify the client certificate because the certificate is not carried, + * @error the server failed to verify the client certificate because the certificate is not carried, * the certificate is invalid, or the certificate is expired. * @since 14 */ AV_ERR_IO_SSL_CLIENT_CERT_NEEDED = 5411008, /** - * @error the client fails to verify the server certificate because the certificate is not carried, + * @error the client failed to verify the server certificate because the certificate is not carried, * the certificate is invalid, or the certificate is expired. * @since 14 */ AV_ERR_IO_SSL_CONNECT_FAIL = 5411009, /** - * @error IO SSL server cert untrusted. + * @error SSL server cert untrusted. * @since 14 */ AV_ERR_IO_SSL_SERVER_CERT_UNTRUSTED = 5411010, @@ -164,21 +164,6 @@ typedef enum OH_AVErrCode { * @since 14 */ AV_ERR_IO_UNSUPPORTED_REQUEST = 5411011, - /** - * @error file data is incorrect, and no specific data can be provided. - * @since 14 - */ - AV_ERR_IO_DATA_ABNORMAL = 5411012, - /** - * @error audio device error. - * @since 14 - */ - AV_ERR_IO_AUDIO_DEVICE_ERROR = 5411020, - /** - * @error video device error. - * @since 14 - */ - AV_ERR_IO_VIDEO_DEVICE_ERROR = 5411030, } OH_AVErrCode; #ifdef __cplusplus -- Gitee From 793a3dcc973dbf813b497bbed17c430deef9f7d3 Mon Sep 17 00:00:00 2001 From: lwx1281857 Date: Thu, 14 Nov 2024 14:53:07 +0800 Subject: [PATCH 405/620] Description:Code optimization Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: lwx1281857 --- startup/init/syscap/include/deviceinfo.h | 8 ++++---- startup/init/syscap/include/syscap_ndk.h | 10 +++++----- startup/init/syscap/init_sync.h | 11 ++++++----- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/startup/init/syscap/include/deviceinfo.h b/startup/init/syscap/include/deviceinfo.h index 0725cd540..05f1bbd2b 100644 --- a/startup/init/syscap/include/deviceinfo.h +++ b/startup/init/syscap/include/deviceinfo.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef DEVICEINFO_CSDK_H -#define DEVICEINFO_CSDK_H - /** * @addtogroup DeviceInfo * @{ @@ -34,6 +31,9 @@ * @since 10 */ +#ifndef DEVICEINFO_CSDK_H +#define DEVICEINFO_CSDK_H + #ifdef __cplusplus #if __cplusplus extern "C" { @@ -245,5 +245,5 @@ const char *OH_GetDistributionOSReleaseType(void); } #endif #endif -/** @} */ #endif +/** @} */ diff --git a/startup/init/syscap/include/syscap_ndk.h b/startup/init/syscap/include/syscap_ndk.h index d821c3a35..590e70eab 100644 --- a/startup/init/syscap/include/syscap_ndk.h +++ b/startup/init/syscap/include/syscap_ndk.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef SYSCAP_NDK_H -#define SYSCAP_NDK_H - /** * @addtogroup SyscapNdk * @{ @@ -29,11 +26,14 @@ * @file deviceinfo.h * @kit BasicServicesKit * @brief Declares APIs for acquiring the set of system capabilities . - * @library na + * @library NA * @syscap SystemCapability.Startup.SystemInfo * @since 10 */ +#ifndef SYSCAP_NDK_H +#define SYSCAP_NDK_H + #include #ifdef __cplusplus @@ -49,5 +49,5 @@ bool canIUse(const char *cap); } #endif #endif +#endif /** @} */ -#endif \ No newline at end of file diff --git a/startup/init/syscap/init_sync.h b/startup/init/syscap/init_sync.h index ca4836b27..4ddd56808 100644 --- a/startup/init/syscap/init_sync.h +++ b/startup/init/syscap/init_sync.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef BASE_STARTUP_INITLITE_NOTIFY_H -#define BASE_STARTUP_INITLITE_NOTIFY_H - /** * @addtogroup InitSync * @{ @@ -29,11 +26,14 @@ * @file init_sync.h * @kit BasicServicesKit * @brief Declares APIs for notifying events to the Init process. - * @library na + * @library NA * @syscap SystemCapability.Startup.SystemInfo * @since 10 */ +#ifndef BASE_STARTUP_INITLITE_NOTIFY_H +#define BASE_STARTUP_INITLITE_NOTIFY_H + #ifdef __cplusplus #if __cplusplus extern "C" { @@ -63,5 +63,6 @@ extern int NotifyInit(unsigned long event); } #endif #endif -/** @} */ + #endif // BASE_STARTUP_INITLITE_NOTIFY_H +/** @} */ -- Gitee From 322bbf0fde077d29a58225c0df6e0d168f02fb18 Mon Sep 17 00:00:00 2001 From: sqwlly Date: Thu, 14 Nov 2024 07:08:09 +0000 Subject: [PATCH 406/620] add new interface sdk c Signed-off-by: s30029175 Signed-off-by: sqwlly Change-Id: Ifaaa642c8c002ad6f3e0ab6f9191decce3bd7144 --- .../native_image/libnative_image.ndk.json | 1 + graphic/graphic_2d/native_image/native_image.h | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/graphic/graphic_2d/native_image/libnative_image.ndk.json b/graphic/graphic_2d/native_image/libnative_image.ndk.json index 1a8c6688d..02e835ae7 100644 --- a/graphic/graphic_2d/native_image/libnative_image.ndk.json +++ b/graphic/graphic_2d/native_image/libnative_image.ndk.json @@ -11,6 +11,7 @@ { "name": "OH_NativeImage_UnsetOnFrameAvailableListener" }, { "name": "OH_NativeImage_Destroy" }, { "name": "OH_NativeImage_GetTransformMatrixV2" }, + { "name": "OH_NativeImage_GetBufferMatrix" }, { "first_introduced": "12", "name": "OH_NativeImage_AcquireNativeWindowBuffer" diff --git a/graphic/graphic_2d/native_image/native_image.h b/graphic/graphic_2d/native_image/native_image.h index 25d335441..ae394d97e 100644 --- a/graphic/graphic_2d/native_image/native_image.h +++ b/graphic/graphic_2d/native_image/native_image.h @@ -239,6 +239,19 @@ void OH_NativeImage_Destroy(OH_NativeImage** image); */ int32_t OH_NativeImage_GetTransformMatrixV2(OH_NativeImage* image, float matrix[16]); +/** + * @brief Return the crop and transform matrix of the texture image set by the most recent call to \n + * OH_NativeImage_UpdateSurfaceImage. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeImage + * @param image Indicates the pointer to a OH_NativeImage instance. + * @param matrix Indicates the retrieved 4*4 transform matrix . + * @return Returns an error code, 0 is success, otherwise, failed. + * @since 14 + * @version 1.0 + */ +int32_t OH_NativeImage_GetBufferMatrix(OH_NativeImage* image, float matrix[16]); + /** * @brief Acquire an OHNativeWindowBuffer through an OH_NativeImage instance for content consumer.\n * This method can not be used at the same time with OH_NativeImage_UpdateSurfaceImage.\n -- Gitee From 09011c6fc99fb2f85ebadaa457424f1639827124 Mon Sep 17 00:00:00 2001 From: sqwlly Date: Thu, 14 Nov 2024 07:42:56 +0000 Subject: [PATCH 407/620] add new interface sdk c Signed-off-by: s30029175 Signed-off-by: sqwlly Change-Id: I39c3c1b42617703c73f053f53cef8b2f5b399c96 --- .../graphic_2d/native_image/native_image.h | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/graphic/graphic_2d/native_image/native_image.h b/graphic/graphic_2d/native_image/native_image.h index ae394d97e..4d604e8be 100644 --- a/graphic/graphic_2d/native_image/native_image.h +++ b/graphic/graphic_2d/native_image/native_image.h @@ -240,15 +240,27 @@ void OH_NativeImage_Destroy(OH_NativeImage** image); int32_t OH_NativeImage_GetTransformMatrixV2(OH_NativeImage* image, float matrix[16]); /** - * @brief Return the crop and transform matrix of the texture image set by the most recent call to \n + * @brief Obtains both the cropping information and transform matrix of the texture image. + * + * This API is an enhanced version of OH_NativeImage_GetTransformMatrix. In addition to the transform matrix, + * it also returns the cropping information of the texture image that was set in the most recent call to * OH_NativeImage_UpdateSurfaceImage. * + * The transform matrix is a 4x4 matrix that combines both the geometric transformation and texture + * coordinates transformation. The first 12 elements represent the geometric transformation (rotation, + * scaling, translation), and the last 4 elements contain texture coordinate mapping information. + * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage - * @param image Indicates the pointer to a OH_NativeImage instance. - * @param matrix Indicates the retrieved 4*4 transform matrix . - * @return Returns an error code, 0 is success, otherwise, failed. + * @param image Pointer to an OH_NativeImage instance. + * @param matrix A float array of size 16 to store the retrieved 4x4 transform matrix. The matrix includes + * both geometric transformation and texture coordinates transformation. + * @return Returns 0 if successful, otherwise returns a negative error code: + * - Returns -1 if any parameter is invalid + * - Returns -2 if the image has not been updated with OH_NativeImage_UpdateSurfaceImage * @since 14 * @version 1.0 + * @see OH_NativeImage_UpdateSurfaceImage + * @see OH_NativeImage_GetTransformMatrix */ int32_t OH_NativeImage_GetBufferMatrix(OH_NativeImage* image, float matrix[16]); -- Gitee From 49ebf6a4892c253e9c08dc1a5ea3def20316ac3d Mon Sep 17 00:00:00 2001 From: lihui Date: Tue, 12 Nov 2024 12:01:55 +0800 Subject: [PATCH 408/620] api lint alarm fix Signed-off-by: lihui --- graphic/graphic_2d/native_buffer/buffer_common.h | 6 +++--- graphic/graphic_2d/native_buffer/native_buffer.h | 6 +++--- graphic/graphic_2d/native_image/native_image.h | 6 +++--- graphic/graphic_2d/native_vsync/native_vsync.h | 7 ++++--- graphic/graphic_2d/native_window/buffer_handle.h | 7 ++++--- graphic/graphic_2d/native_window/external_window.h | 6 +++--- graphic/graphic_2d/native_window/graphic_error_code.h | 6 +++--- 7 files changed, 23 insertions(+), 21 deletions(-) diff --git a/graphic/graphic_2d/native_buffer/buffer_common.h b/graphic/graphic_2d/native_buffer/buffer_common.h index d67646240..20b22fd87 100644 --- a/graphic/graphic_2d/native_buffer/buffer_common.h +++ b/graphic/graphic_2d/native_buffer/buffer_common.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NDK_INCLUDE_BUFFER_COMMON_H_ -#define NDK_INCLUDE_BUFFER_COMMON_H_ - /** * @addtogroup OH_NativeBuffer * @{ @@ -39,6 +36,9 @@ * @version 1.0 */ +#ifndef NDK_INCLUDE_BUFFER_COMMON_H_ +#define NDK_INCLUDE_BUFFER_COMMON_H_ + #ifdef __cplusplus extern "C" { #endif diff --git a/graphic/graphic_2d/native_buffer/native_buffer.h b/graphic/graphic_2d/native_buffer/native_buffer.h index 154df76d3..2ca2fc617 100644 --- a/graphic/graphic_2d/native_buffer/native_buffer.h +++ b/graphic/graphic_2d/native_buffer/native_buffer.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NDK_INCLUDE_NATIVE_BUFFER_H_ -#define NDK_INCLUDE_NATIVE_BUFFER_H_ - /** * @addtogroup OH_NativeBuffer * @{ @@ -39,6 +36,9 @@ * @version 1.0 */ +#ifndef NDK_INCLUDE_NATIVE_BUFFER_H_ +#define NDK_INCLUDE_NATIVE_BUFFER_H_ + #include #include #include diff --git a/graphic/graphic_2d/native_image/native_image.h b/graphic/graphic_2d/native_image/native_image.h index 25d335441..38702c9e1 100644 --- a/graphic/graphic_2d/native_image/native_image.h +++ b/graphic/graphic_2d/native_image/native_image.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NDK_INCLUDE_NATIVE_IMAGE_H_ -#define NDK_INCLUDE_NATIVE_IMAGE_H_ - /** * @addtogroup OH_NativeImage * @{ @@ -39,6 +36,9 @@ * @version 1.0 */ +#ifndef NDK_INCLUDE_NATIVE_IMAGE_H_ +#define NDK_INCLUDE_NATIVE_IMAGE_H_ + #include #ifdef __cplusplus diff --git a/graphic/graphic_2d/native_vsync/native_vsync.h b/graphic/graphic_2d/native_vsync/native_vsync.h index 791fbfd36..5e57713bf 100644 --- a/graphic/graphic_2d/native_vsync/native_vsync.h +++ b/graphic/graphic_2d/native_vsync/native_vsync.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NDK_INCLUDE_NATIVE_VSYNC_H_ -#define NDK_INCLUDE_NATIVE_VSYNC_H_ - /** * @addtogroup NativeVsync * @{ @@ -39,6 +36,9 @@ * @version 1.0 */ +#ifndef NDK_INCLUDE_NATIVE_VSYNC_H_ +#define NDK_INCLUDE_NATIVE_VSYNC_H_ + #ifdef __cplusplus extern "C" { #endif @@ -144,4 +144,5 @@ int OH_NativeVSync_DVSyncSwitch(OH_NativeVSync* nativeVsync, bool enable); } #endif +/** @} */ #endif \ No newline at end of file diff --git a/graphic/graphic_2d/native_window/buffer_handle.h b/graphic/graphic_2d/native_window/buffer_handle.h index a5e3a13cf..441af5e75 100644 --- a/graphic/graphic_2d/native_window/buffer_handle.h +++ b/graphic/graphic_2d/native_window/buffer_handle.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef INCLUDE_BUFFER_HANDLE_H -#define INCLUDE_BUFFER_HANDLE_H - /** * @addtogroup NativeWindow * @{ @@ -39,6 +36,9 @@ * @version 1.0 */ +#ifndef INCLUDE_BUFFER_HANDLE_H +#define INCLUDE_BUFFER_HANDLE_H + #include #ifdef __cplusplus @@ -65,4 +65,5 @@ typedef struct { } #endif +/** @} */ #endif // INCLUDE_BUFFER_HANDLE_H diff --git a/graphic/graphic_2d/native_window/external_window.h b/graphic/graphic_2d/native_window/external_window.h index 47a407ff0..54ae4efe5 100644 --- a/graphic/graphic_2d/native_window/external_window.h +++ b/graphic/graphic_2d/native_window/external_window.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NDK_INCLUDE_EXTERNAL_NATIVE_WINDOW_H_ -#define NDK_INCLUDE_EXTERNAL_NATIVE_WINDOW_H_ - /** * @addtogroup NativeWindow * @{ @@ -39,6 +36,9 @@ * @version 1.0 */ +#ifndef NDK_INCLUDE_EXTERNAL_NATIVE_WINDOW_H_ +#define NDK_INCLUDE_EXTERNAL_NATIVE_WINDOW_H_ + #include #include "buffer_handle.h" #include "../native_buffer/buffer_common.h" diff --git a/graphic/graphic_2d/native_window/graphic_error_code.h b/graphic/graphic_2d/native_window/graphic_error_code.h index 1b5e9deb0..1c16d7b95 100644 --- a/graphic/graphic_2d/native_window/graphic_error_code.h +++ b/graphic/graphic_2d/native_window/graphic_error_code.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef INCLUDE_GRAPHIC_ERROR_CODE_H -#define INCLUDE_GRAPHIC_ERROR_CODE_H - /** * @addtogroup NativeWindow * @{ @@ -39,6 +36,9 @@ * @version 1.0 */ +#ifndef INCLUDE_GRAPHIC_ERROR_CODE_H +#define INCLUDE_GRAPHIC_ERROR_CODE_H + #include #ifdef __cplusplus -- Gitee From 04616bdf3ba3451fffbc320d4688ee911d736438 Mon Sep 17 00:00:00 2001 From: liuchungang Date: Thu, 14 Nov 2024 17:18:15 +0800 Subject: [PATCH 409/620] fix addtogroup and file tag Signed-off-by: liuchungang --- resourceschedule/qos_manager/c/qos.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/resourceschedule/qos_manager/c/qos.h b/resourceschedule/qos_manager/c/qos.h index e7bd4183a..8cc30a051 100644 --- a/resourceschedule/qos_manager/c/qos.h +++ b/resourceschedule/qos_manager/c/qos.h @@ -13,8 +13,6 @@ * limitations under the License. */ -#ifndef QOS_H -#define QOS_H /** * @addtogroup QoS * @{ @@ -39,6 +37,10 @@ * @syscap SystemCapability.Resourceschedule.QoS.Core * @since 12 */ + +#ifndef QOS_H +#define QOS_H + #ifdef __cplusplus extern "C" { #endif @@ -115,4 +117,5 @@ int OH_QoS_GetThreadQoS(QoS_Level *level); #ifdef __cplusplus }; #endif -#endif //QOS_H +#endif // QOS_H +/** @} */ -- Gitee From aa1df25dab292cecf957d7e3921ee08bcbca5c2a Mon Sep 17 00:00:00 2001 From: shilong Date: Thu, 14 Nov 2024 12:08:09 +0000 Subject: [PATCH 410/620] =?UTF-8?q?=E5=8A=A0=E4=B8=8A@error=E6=A0=87?= =?UTF-8?q?=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- .../external_device_manager/hid/hid_ddk_types.h | 14 +++++++------- .../external_device_manager/usb/usb_ddk_types.h | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/external_device_manager/hid/hid_ddk_types.h b/drivers/external_device_manager/hid/hid_ddk_types.h index 2bd632dc2..01dfc5d9b 100644 --- a/drivers/external_device_manager/hid/hid_ddk_types.h +++ b/drivers/external_device_manager/hid/hid_ddk_types.h @@ -589,19 +589,19 @@ typedef struct Hid_EventProperties { * @version 1.0 */ typedef enum { - /** Operation successful */ + /** @error Operation successful */ HID_DDK_SUCCESS = 0, - /** Permission denied */ + /** @error Permission denied */ HID_DDK_NO_PERM = 201, - /** Invalid parameter */ + /** @error Invalid parameter */ HID_DDK_INVALID_PARAMETER = 401, - /** Operation failed */ + /** @error Operation failed */ HID_DDK_FAILURE = 27300001, - /** Null pointer exception */ + /** @error Null pointer exception */ HID_DDK_NULL_PTR = 27300002, - /** Invalid operation */ + /** @error Invalid operation */ HID_DDK_INVALID_OPERATION = 27300003, - /** Timeout */ + /** @error Timeout */ HID_DDK_TIMEOUT = 27300004, } Hid_DdkErrCode; #ifdef __cplusplus diff --git a/drivers/external_device_manager/usb/usb_ddk_types.h b/drivers/external_device_manager/usb/usb_ddk_types.h index 808d834f1..ef63f7458 100644 --- a/drivers/external_device_manager/usb/usb_ddk_types.h +++ b/drivers/external_device_manager/usb/usb_ddk_types.h @@ -296,20 +296,20 @@ typedef struct UsbDeviceMemMap { * @version 1.0 */ typedef enum { - /** The operation is successful. */ + /** @error The operation is successful. */ USB_DDK_SUCCESS = 0, - /** Permission denied. */ + /** @error Permission denied. */ USB_DDK_NO_PERM = 201, - /** Invalid parameter. */ + /** @error Invalid parameter. */ USB_DDK_INVALID_PARAMETER = 401, - /** Memory-related error, for example, insufficient memory, memory data copy failure, or memory application failure. + /** @error Memory-related error, for example, insufficient memory, memory data copy failure, or memory application failure. */ USB_DDK_MEMORY_ERROR = 27400001, - /** Invalid operation. */ + /** @error Invalid operation. */ USB_DDK_INVALID_OPERATION = 27400002, - /** I/O error */ + /** @error I/O error */ USB_DDK_IO_FAILED = 27400003, - /** Transmission timeout. */ + /** @error Transmission timeout. */ USB_DDK_TIMEOUT = 27400004, } UsbDdkErrCode; #ifdef __cplusplus -- Gitee From 432dd37775a74b073937e3f47104b04400b0c8de Mon Sep 17 00:00:00 2001 From: shilong Date: Thu, 14 Nov 2024 12:10:21 +0000 Subject: [PATCH 411/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- drivers/external_device_manager/usb/usb_ddk_types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/external_device_manager/usb/usb_ddk_types.h b/drivers/external_device_manager/usb/usb_ddk_types.h index ef63f7458..6e66eca30 100644 --- a/drivers/external_device_manager/usb/usb_ddk_types.h +++ b/drivers/external_device_manager/usb/usb_ddk_types.h @@ -302,7 +302,8 @@ typedef enum { USB_DDK_NO_PERM = 201, /** @error Invalid parameter. */ USB_DDK_INVALID_PARAMETER = 401, - /** @error Memory-related error, for example, insufficient memory, memory data copy failure, or memory application failure. + /** @error Memory-related error, for example, insufficient memory, memory data copy failure,\n + * or memory application failure. */ USB_DDK_MEMORY_ERROR = 27400001, /** @error Invalid operation. */ -- Gitee From b687b016f1056284308528b566468724f45bf009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E9=82=B5=E5=AE=89?= Date: Wed, 13 Nov 2024 16:40:50 +0800 Subject: [PATCH 412/620] add ndk interface BlurWithTileMode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 肖邵安 --- .../graphic_2d/native_effect/effect_filter.h | 14 ++++++++++++++ .../graphic_2d/native_effect/effect_types.h | 18 ++++++++++++++++++ .../native_effect/libnative_effect.ndk.json | 1 + 3 files changed, 33 insertions(+) diff --git a/graphic/graphic_2d/native_effect/effect_filter.h b/graphic/graphic_2d/native_effect/effect_filter.h index f743d587e..42ea52a71 100644 --- a/graphic/graphic_2d/native_effect/effect_filter.h +++ b/graphic/graphic_2d/native_effect/effect_filter.h @@ -77,6 +77,20 @@ EffectErrorCode OH_Filter_Release(OH_Filter* filter); */ EffectErrorCode OH_Filter_Blur(OH_Filter* filter, float radius); +/** + * @brief Creates a blur effect and then add to the filter. + * + * @syscap SystemCapability.Multimedia.Image.Core + * @param filter The OH_Filter pointer will be operated. + * @param radius The radius of the blur effect. + * @param tileMode The tileMode of the blur effect. + * @return BlurWithTileMode result code. + * {@link EFFECT_SUCCESS} if the operation is successful. + * {@link EFFECT_BAD_PARAMETER} if parameter is invalid. + * @since 14 + */ +EffectErrorCode OH_Filter_BlurWithTileMode(OH_Filter* filter, float radius, EffectTileMode tileMode); + /** * @brief Creates a brighten effect and then add to the filter. * diff --git a/graphic/graphic_2d/native_effect/effect_types.h b/graphic/graphic_2d/native_effect/effect_types.h index 3d40a63fb..6e6bf8d5f 100644 --- a/graphic/graphic_2d/native_effect/effect_types.h +++ b/graphic/graphic_2d/native_effect/effect_types.h @@ -88,6 +88,24 @@ typedef enum { EFFECT_UNKNOWN_ERROR = 7600901, } EffectErrorCode; +/** + * @brief Defines a effect filter tile mode. + * + * @since 14 + */ +typedef enum { + /** Replicate the edge color if the shader draws outside of its original bounds */ + CLAMP = 0, + /** Repeat the shader's image horizontally and vertically */ + REPEAT, + /** Repeat the shader's image horizontally and vertically, + * alternating mirror images so that adjacent images always seam + */ + MIRROR, + /** Only draw within the original domain, return transparent-black everywhere else */ + DECAL, +} EffectTileMode; + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_effect/libnative_effect.ndk.json b/graphic/graphic_2d/native_effect/libnative_effect.ndk.json index 83a34f0a7..c97ec522d 100644 --- a/graphic/graphic_2d/native_effect/libnative_effect.ndk.json +++ b/graphic/graphic_2d/native_effect/libnative_effect.ndk.json @@ -2,6 +2,7 @@ { "name": "OH_Filter_CreateEffect" }, { "name": "OH_Filter_Release" }, { "name": "OH_Filter_Blur" }, + { "name": "OH_Filter_BlurWithTileMode" }, { "name": "OH_Filter_Brighten" }, { "name": "OH_Filter_GrayScale" }, { "name": "OH_Filter_Invert" }, -- Gitee From a09089567585055bcc3228a4842b434d221cd3f2 Mon Sep 17 00:00:00 2001 From: shilong Date: Thu, 14 Nov 2024 12:12:19 +0000 Subject: [PATCH 413/620] =?UTF-8?q?=E6=A0=87=E7=82=B9=E7=AC=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- drivers/external_device_manager/usb/usb_ddk_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/external_device_manager/usb/usb_ddk_types.h b/drivers/external_device_manager/usb/usb_ddk_types.h index 6e66eca30..0b582335e 100644 --- a/drivers/external_device_manager/usb/usb_ddk_types.h +++ b/drivers/external_device_manager/usb/usb_ddk_types.h @@ -308,7 +308,7 @@ typedef enum { USB_DDK_MEMORY_ERROR = 27400001, /** @error Invalid operation. */ USB_DDK_INVALID_OPERATION = 27400002, - /** @error I/O error */ + /** @error I/O error. */ USB_DDK_IO_FAILED = 27400003, /** @error Transmission timeout. */ USB_DDK_TIMEOUT = 27400004, -- Gitee From de1ba1dccea8223e5484d7ff81661bbe6141d4d5 Mon Sep 17 00:00:00 2001 From: lihui Date: Fri, 15 Nov 2024 10:18:43 +0800 Subject: [PATCH 414/620] api lint fix 1115 Signed-off-by: lihui --- graphic/graphic_2d/native_vsync/native_vsync.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_vsync/native_vsync.h b/graphic/graphic_2d/native_vsync/native_vsync.h index bb77a0108..fbb7432de 100644 --- a/graphic/graphic_2d/native_vsync/native_vsync.h +++ b/graphic/graphic_2d/native_vsync/native_vsync.h @@ -64,7 +64,7 @@ OH_NativeVSync* OH_NativeVSync_Create(const char* name, unsigned int length); * @brief Delete the NativeVsync instance. * * @syscap SystemCapability.Graphic.Graphic2D.NativeVsync - * @param window Indicates the pointer to a NativeVsync instance. + * @param nativeVsync Indicates the pointer to a NativeVsync instance. * @since 9 * @version 1.0 */ -- Gitee From c3f14a5af623274273611fd4950f4f46cf3132aa Mon Sep 17 00:00:00 2001 From: wangdongqi Date: Fri, 15 Nov 2024 10:58:55 +0800 Subject: [PATCH 415/620] Signed-off-by: wangdongqi Changes to be committed: --- inputmethod/include/inputmethod_text_avoid_info_capi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inputmethod/include/inputmethod_text_avoid_info_capi.h b/inputmethod/include/inputmethod_text_avoid_info_capi.h index a22590f6a..407197a67 100644 --- a/inputmethod/include/inputmethod_text_avoid_info_capi.h +++ b/inputmethod/include/inputmethod_text_avoid_info_capi.h @@ -61,7 +61,7 @@ InputMethod_TextAvoidInfo *OH_TextAvoidInfo_Create(double positionY, double heig /** * @brief Destroy a {@link InputMethod_TextAvoidInfo} instance. * - * @param options Represents a pointer to an {@link InputMethod_TextAvoidInfo} instance which will be destroyed. + * @param info Represents a pointer to an {@link InputMethod_TextAvoidInfo} instance which will be destroyed. * @since 12 */ void OH_TextAvoidInfo_Destroy(InputMethod_TextAvoidInfo *info); -- Gitee From 8e91bf66708020a4597a83275a745590d801183b Mon Sep 17 00:00:00 2001 From: hhl Date: Fri, 15 Nov 2024 11:05:09 +0800 Subject: [PATCH 416/620] fix issues Signed-off-by: hhl --- hiviewdfx/hicollie/include/hicollie/hicollie.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hiviewdfx/hicollie/include/hicollie/hicollie.h b/hiviewdfx/hicollie/include/hicollie/hicollie.h index de146b7fe..8ad4bddcf 100644 --- a/hiviewdfx/hicollie/include/hicollie/hicollie.h +++ b/hiviewdfx/hicollie/include/hicollie/hicollie.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef HIVIEWDFX_HICOLLIE_H -#define HIVIEWDFX_HICOLLIE_H - /** * @addtogroup HiCollie * @{ @@ -41,6 +38,9 @@ * @since 12 */ +#ifndef HIVIEWDFX_HICOLLIE_H +#define HIVIEWDFX_HICOLLIE_H + #include #include -- Gitee From 4dca656b6a7334b99d1e498532ada8e75b61740a Mon Sep 17 00:00:00 2001 From: liuzerun Date: Fri, 15 Nov 2024 03:07:26 +0000 Subject: [PATCH 417/620] =?UTF-8?q?API=20=E8=A7=84=E8=8C=83=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuzerun --- filemanagement/environment/include/oh_environment.h | 5 +++-- filemanagement/fileio/include/error_code.h | 6 +++--- filemanagement/fileio/include/oh_fileio.h | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/filemanagement/environment/include/oh_environment.h b/filemanagement/environment/include/oh_environment.h index 92bbebde7..71d1e8495 100644 --- a/filemanagement/environment/include/oh_environment.h +++ b/filemanagement/environment/include/oh_environment.h @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef FILE_MANAGEMENT_ENVIRONMENT_OH_ENVIRONMENT_H -#define FILE_MANAGEMENT_ENVIRONMENT_OH_ENVIRONMENT_H /** * @addtogroup Environment @@ -33,6 +31,9 @@ * @since 12 */ +#ifndef FILE_MANAGEMENT_ENVIRONMENT_OH_ENVIRONMENT_H +#define FILE_MANAGEMENT_ENVIRONMENT_OH_ENVIRONMENT_H + #include "error_code.h" #ifdef __cplusplus diff --git a/filemanagement/fileio/include/error_code.h b/filemanagement/fileio/include/error_code.h index 27944b431..2fb9847fe 100644 --- a/filemanagement/fileio/include/error_code.h +++ b/filemanagement/fileio/include/error_code.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef FILE_MANAGEMENT_FILEIO_ERROR_CODE_H -#define FILE_MANAGEMENT_FILEIO_ERROR_CODE_H - /** * @addtogroup FileIO * @{ @@ -33,6 +30,9 @@ * @since 12 */ +#ifndef FILE_MANAGEMENT_FILEIO_ERROR_CODE_H +#define FILE_MANAGEMENT_FILEIO_ERROR_CODE_H + #ifdef __cplusplus extern "C" { #endif diff --git a/filemanagement/fileio/include/oh_fileio.h b/filemanagement/fileio/include/oh_fileio.h index 845b9c0f9..5fa1677da 100644 --- a/filemanagement/fileio/include/oh_fileio.h +++ b/filemanagement/fileio/include/oh_fileio.h @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef FILE_MANAGEMENT_FILEIO_OH_FILEIO_H -#define FILE_MANAGEMENT_FILEIO_OH_FILEIO_H /** * @addtogroup FileIO @@ -32,6 +30,9 @@ * @since 12 */ +#ifndef FILE_MANAGEMENT_FILEIO_OH_FILEIO_H +#define FILE_MANAGEMENT_FILEIO_OH_FILEIO_H + #include "error_code.h" #ifdef __cplusplus -- Gitee From 512508aec458e6fe30f88b5fae2d012a4560a233 Mon Sep 17 00:00:00 2001 From: s00659936 <282229496@qq.com> Date: Sat, 9 Nov 2024 10:58:20 +0800 Subject: [PATCH 418/620] add addtogroup Signed-off-by: s00659936 <282229496@qq.com> Change-Id: If723cfaaa9240e53d954a1e8de3e69f126526a2e --- telephony/cellular_data/include/telephony_data.h | 14 ++++++++++++-- telephony/core_service/include/telephony_radio.h | 14 ++++++++++++-- .../core_service/include/telephony_radio_type.h | 14 ++++++++++++-- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/telephony/cellular_data/include/telephony_data.h b/telephony/cellular_data/include/telephony_data.h index 801f8e819..502beb9e3 100755 --- a/telephony/cellular_data/include/telephony_data.h +++ b/telephony/cellular_data/include/telephony_data.h @@ -13,8 +13,14 @@ * limitations under the License. */ -#ifndef NATIVE_TELEPHONY_DATA_API_H -#define NATIVE_TELEPHONY_DATA_API_H +/** + * @addtogroup Telephony + * @{ + * + * @brief Provides C interface for the telephony cellular data. + * + * @since 13 + */ /** * @file telephony_data.h @@ -27,6 +33,9 @@ * @since 13 */ +#ifndef NATIVE_TELEPHONY_DATA_API_H +#define NATIVE_TELEPHONY_DATA_API_H + #include #ifdef __cplusplus @@ -47,3 +56,4 @@ int32_t OH_Telephony_GetDefaultCellularDataSlotId(void); #endif #endif // NATIVE_TELEPHONY_DATA_API_H +/** @} */ diff --git a/telephony/core_service/include/telephony_radio.h b/telephony/core_service/include/telephony_radio.h index 26746d4be..11d6a809b 100755 --- a/telephony/core_service/include/telephony_radio.h +++ b/telephony/core_service/include/telephony_radio.h @@ -13,8 +13,14 @@ * limitations under the License. */ -#ifndef NATIVE_TELEPHONY_RADIO_API_H -#define NATIVE_TELEPHONY_RADIO_API_H +/** + * @addtogroup Telephony + * @{ + * + * @brief Provides C interface for the telephony radio. + * + * @since 13 + */ /** * @file telephony_radio.h @@ -27,6 +33,9 @@ * @since 13 */ +#ifndef NATIVE_TELEPHONY_RADIO_API_H +#define NATIVE_TELEPHONY_RADIO_API_H + #include "telephony_radio_type.h" #include "stdint.h" @@ -72,3 +81,4 @@ Telephony_RadioResult OH_Telephony_GetNetworkStateForSlot(int32_t slotId, Teleph #endif #endif // NATIVE_TELEPHONY_RADIO_API_H +/** @} */ diff --git a/telephony/core_service/include/telephony_radio_type.h b/telephony/core_service/include/telephony_radio_type.h index 15877c912..72dc1aa81 100755 --- a/telephony/core_service/include/telephony_radio_type.h +++ b/telephony/core_service/include/telephony_radio_type.h @@ -13,8 +13,14 @@ * limitations under the License. */ -#ifndef NATIVE_TELEPHONY_RADIO_TYPE_H -#define NATIVE_TELEPHONY_RADIO_TYPE_H +/** + * @addtogroup Telephony + * @{ + * + * @brief Provides the data structures for the C APIs of the the telephony radio. + * + * @since 13 + */ /** * @file telephony_radio_type.h @@ -27,6 +33,9 @@ * @since 13 */ +#ifndef NATIVE_TELEPHONY_RADIO_TYPE_H +#define NATIVE_TELEPHONY_RADIO_TYPE_H + #ifdef __cplusplus extern "C" { #endif @@ -155,3 +164,4 @@ typedef struct { #endif #endif // NATIVE_TELEPHONY_RADIO_TYPE_H +/** @} */ -- Gitee From 30be433ec6fefa107484158d6be1a65b1dce61e0 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Fri, 15 Nov 2024 15:38:11 +0800 Subject: [PATCH 419/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changleipeng Change-Id: I692072399873075e219d3e5868acccb81b475941 --- graphic/graphic_2d/native_drawing/drawing_font.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index ca4eac990..ef6abe0cf 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -538,7 +538,8 @@ OH_Drawing_ErrorCode OH_Drawing_FontGetPathForGlyph(const OH_Drawing_Font* font, * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param font Indicates the pointer to an OH_Drawing_Font object. * @param text Indicates the character storage encoded with text encoding. - * @param byteLength Indicates the text length in bytes. + * @param byteLength Indicates to get the byte length of the corresponding text path. If this byte length is greater + * than the byte length of the text string, undefined behavior will occur. * @param encoding OH_Drawing_TextEncoding Indicates the text encoding. * @param x Indicates x coordinates of the text. * @param y Indicates y coordinates of the text. -- Gitee From 329d66c7f426c0d5c37e4144898336500b31d8b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E9=82=B5=E5=AE=89?= Date: Sat, 16 Nov 2024 09:39:35 +0800 Subject: [PATCH 420/620] effect ndk @file @addtogroup fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 肖邵安 --- graphic/graphic_2d/native_effect/effect_filter.h | 6 +++--- graphic/graphic_2d/native_effect/effect_types.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/graphic/graphic_2d/native_effect/effect_filter.h b/graphic/graphic_2d/native_effect/effect_filter.h index 42ea52a71..065643a8f 100644 --- a/graphic/graphic_2d/native_effect/effect_filter.h +++ b/graphic/graphic_2d/native_effect/effect_filter.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_EFFECT_FILTER_H -#define C_INCLUDE_EFFECT_FILTER_H - /** * @addtogroup image * @{ @@ -37,6 +34,9 @@ * @since 12 */ +#ifndef C_INCLUDE_EFFECT_FILTER_H +#define C_INCLUDE_EFFECT_FILTER_H + #include "effect_types.h" #ifdef __cplusplus extern "C" { diff --git a/graphic/graphic_2d/native_effect/effect_types.h b/graphic/graphic_2d/native_effect/effect_types.h index 6e6bf8d5f..d84b05e13 100644 --- a/graphic/graphic_2d/native_effect/effect_types.h +++ b/graphic/graphic_2d/native_effect/effect_types.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_EFFECT_TYPES_H -#define C_INCLUDE_EFFECT_TYPES_H - /** * @addtogroup image * @{ @@ -37,6 +34,9 @@ * @since 12 */ +#ifndef C_INCLUDE_EFFECT_TYPES_H +#define C_INCLUDE_EFFECT_TYPES_H + #include #include -- Gitee From fd6c430fa4ade2c1848079a7a02d5a4a84c9948a Mon Sep 17 00:00:00 2001 From: xwx1135370 Date: Sat, 16 Nov 2024 14:01:51 +0800 Subject: [PATCH 421/620] =?UTF-8?q?=E3=80=90windows=E3=80=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0python3=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue:https://gitee.com/openharmony/interface_sdk_c/issues/IB4SU5?from=project-issue Signed-off-by: xwx1135370 --- third_party/musl/ndk_script/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/third_party/musl/ndk_script/BUILD.gn b/third_party/musl/ndk_script/BUILD.gn index a71e33565..c62a9b632 100644 --- a/third_party/musl/ndk_script/BUILD.gn +++ b/third_party/musl/ndk_script/BUILD.gn @@ -106,6 +106,7 @@ if (host_os == "mac") { "${windows_x86_64_toolchain_dir}/llvm/include", "${windows_x86_64_toolchain_dir}/llvm/lib", "${windows_x86_64_toolchain_dir}/llvm/libexec", + "${windows_x86_64_toolchain_dir}/llvm/python3", "${windows_x86_64_toolchain_dir}/llvm/script", "${windows_x86_64_toolchain_dir}/llvm/share", ] -- Gitee From 110b2befa723e180ba85dc2d5646c332de5da7e5 Mon Sep 17 00:00:00 2001 From: SuRuoyan Date: Sat, 16 Nov 2024 21:03:43 +0800 Subject: [PATCH 422/620] add AAC profile HE-AAC and HE-AAC v2 Signed-off-by: SuRuoyan --- multimedia/av_codec/native_avcodec_base.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 147a7268e..a9dbbaa7d 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -987,6 +987,16 @@ typedef enum OH_MediaType { */ typedef enum OH_AACProfile { AAC_PROFILE_LC = 0, + /** + * High-Efficiency AAC profile, contain the audio object types: AAC LC, SBR + * @since 14 + */ + AAC_PROFILE_HE = 3, + /** + * High-Efficiency AAC v2 profile, contain the audio object types: AAC LC, SBR, PS + * @since 14 + */ + AAC_PROFILE_HE_V2 = 4, } OH_AACProfile; /** -- Gitee From debe7f537c3cb81b10b4b11fcbda036192464ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=9C=AA=E6=9D=A5?= Date: Mon, 18 Nov 2024 09:51:54 +0800 Subject: [PATCH 423/620] =?UTF-8?q?api=20Lint=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 徐未来 --- BasicServicesKit/time_service.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BasicServicesKit/time_service.h b/BasicServicesKit/time_service.h index b33159e86..29f45020d 100644 --- a/BasicServicesKit/time_service.h +++ b/BasicServicesKit/time_service.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef TIME_SERVICE_H -#define TIME_SERVICE_H - /** * @addtogroup TimeService * @{ @@ -33,6 +30,9 @@ * @since 12 */ +#ifndef TIME_SERVICE_H +#define TIME_SERVICE_H + #include #ifdef __cplusplus -- Gitee From bce2fdff17c69455fa1dfdaf8924cba7d9487ca5 Mon Sep 17 00:00:00 2001 From: yuhaoqiang Date: Mon, 18 Nov 2024 09:59:59 +0800 Subject: [PATCH 424/620] =?UTF-8?q?=E8=A7=84=E8=8C=83=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuhaoqiang --- hiviewdfx/hidebug/include/hidebug/hidebug.h | 5 +++-- hiviewdfx/hidebug/include/hidebug/hidebug_type.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug.h b/hiviewdfx/hidebug/include/hidebug/hidebug.h index 7f234b359..5cea6408a 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug.h @@ -13,8 +13,6 @@ * limitations under the License. */ -#ifndef HIVIEWDFX_HIDEBUG_H -#define HIVIEWDFX_HIDEBUG_H /** * @addtogroup HiDebug * @{ @@ -37,6 +35,9 @@ * @since 12 */ +#ifndef HIVIEWDFX_HIDEBUG_H +#define HIVIEWDFX_HIDEBUG_H + #include #include "hidebug_type.h" diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h index 6976244e2..e38ad40e0 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h @@ -13,8 +13,6 @@ * limitations under the License. */ -#ifndef HIVIEWDFX_HIDEBUG_TYPE_H -#define HIVIEWDFX_HIDEBUG_TYPE_H /** * @addtogroup HiDebug * @{ @@ -37,6 +35,9 @@ * @since 12 */ +#ifndef HIVIEWDFX_HIDEBUG_TYPE_H +#define HIVIEWDFX_HIDEBUG_TYPE_H + #include #ifdef __cplusplus -- Gitee From 0440066ed8c4304dd9847282a5b50bb27b2431e8 Mon Sep 17 00:00:00 2001 From: jiangwei Date: Mon, 18 Nov 2024 10:36:00 +0800 Subject: [PATCH 425/620] =?UTF-8?q?fix:=20trace.h=E5=A4=B4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=B8=85=E7=90=86app=20lint=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jiangwei --- hiviewdfx/hitrace/include/hitrace/trace.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hiviewdfx/hitrace/include/hitrace/trace.h b/hiviewdfx/hitrace/include/hitrace/trace.h index e771136da..d9ebed256 100644 --- a/hiviewdfx/hitrace/include/hitrace/trace.h +++ b/hiviewdfx/hitrace/include/hitrace/trace.h @@ -13,8 +13,6 @@ * limitations under the License. */ -#ifndef HIVIEWDFX_HITRACE_H -#define HIVIEWDFX_HITRACE_H /** * @addtogroup Hitrace * @{ @@ -64,6 +62,10 @@ * @syscap SystemCapability.HiviewDFX.HiTrace * @since 10 */ + +#ifndef HIVIEWDFX_HITRACE_H +#define HIVIEWDFX_HITRACE_H + #include #include -- Gitee From 321c12dae3b0b8787e08bad8f8c927cbebc7a0eb Mon Sep 17 00:00:00 2001 From: shenshiyi2 Date: Mon, 18 Nov 2024 10:47:20 +0800 Subject: [PATCH 426/620] =?UTF-8?q?=E5=9B=BE=E5=BD=A2API=20Lint=E6=95=B4?= =?UTF-8?q?=E6=94=B9=20pixelmap=5Fnative.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenshiyi2 --- multimedia/image_framework/include/image/pixelmap_native.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 1599a6621..fb16d8c0d 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -19,7 +19,7 @@ * * @brief Provides APIs for obtaining pixel map data and information. * - * @Syscap SystemCapability.Multimedia.Image.Core + * @syscap SystemCapability.Multimedia.Image.Core * @since 12 */ @@ -30,7 +30,7 @@ * * @library libpixelmap.so * @kit ImageKit - * @Syscap SystemCapability.Multimedia.Image.Core + * @syscap SystemCapability.Multimedia.Image.Core * @since 12 */ @@ -571,7 +571,7 @@ Image_ErrorCode OH_PixelmapImageInfo_GetPixelFormat(OH_Pixelmap_ImageInfo *info, * @brief Get density number for imageinfo struct. * * @param info The imageinfo pointer will be operated. - * @param density The number of imageinfo density. + * @param alphaType The number of image alphaType. * @return Returns {@link Image_ErrorCode} * @since 12 */ -- Gitee From 8fcbe451c61d6bb27303fb160669ae2c628e90ba Mon Sep 17 00:00:00 2001 From: zww Date: Mon, 18 Nov 2024 15:43:43 +0800 Subject: [PATCH 427/620] huks api lint fix Signed-off-by: zww --- security/huks/include/native_huks_api.h | 11 +++++++---- security/huks/include/native_huks_param.h | 9 ++++++--- security/huks/include/native_huks_type.h | 9 ++++++--- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/security/huks/include/native_huks_api.h b/security/huks/include/native_huks_api.h index d806c778b..9bde4391f 100644 --- a/security/huks/include/native_huks_api.h +++ b/security/huks/include/native_huks_api.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NATIVE_HUKS_API_H -#define NATIVE_HUKS_API_H - /** * @addtogroup HuksKeyApi * @{ @@ -34,12 +31,18 @@ * * @brief Defines the Universal Keystore Kit APIs. * + * @library libhuks_ndk.z.so + * @syscap SystemCapability.Security.Huks + * * include "huks/include/native_huks_type.h" * @kit UniversalKeystoreKit * @since 9 * @version 1.0 */ +#ifndef NATIVE_HUKS_API_H +#define NATIVE_HUKS_API_H + #include "native_huks_type.h" #ifdef __cplusplus @@ -309,7 +312,7 @@ struct OH_Huks_Result OH_Huks_AnonAttestKeyItem(const struct OH_Huks_Blob *keyAl * @param handle Indicates the pointer to the handle of the key session obtained. * This handle is required for subsequent operations, including {@link OH_Huks_UpdateSession}, * {@link OH_Huks_FinishSession}, and {@link OH_Huks_AbortSession}. - * @param challenge Indicates the pointer to the challenge value obtained. + * @param token Indicates the pointer to the token used for key access control. * @return {@link OH_Huks_ErrCode#OH_HUKS_SUCCESS} 0 - If the operation is successful. * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_ILLEGAL_ARGUMENT} 401 - If keyAlias or paramSet or handle or * token is invalid. diff --git a/security/huks/include/native_huks_param.h b/security/huks/include/native_huks_param.h index 9b8cf1f60..8866a8b56 100644 --- a/security/huks/include/native_huks_param.h +++ b/security/huks/include/native_huks_param.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NATIVE_HUKS_PARAM_H -#define NATIVE_HUKS_PARAM_H - /** * @addtogroup HuksParamSetApi * @{ @@ -36,12 +33,18 @@ * * @brief Provides APIs for constructing, using, and destroying parameter sets. * + * @library libhuks_ndk.z.so + * @syscap SystemCapability.Security.Huks + * * include "huks/include/native_huks_type.h" * @kit UniversalKeystoreKit * @since 9 * @version 1.0 */ +#ifndef NATIVE_HUKS_PARAM_H +#define NATIVE_HUKS_PARAM_H + #include "native_huks_type.h" #ifdef __cplusplus diff --git a/security/huks/include/native_huks_type.h b/security/huks/include/native_huks_type.h index 765dc5a87..b7d00d8ca 100644 --- a/security/huks/include/native_huks_type.h +++ b/security/huks/include/native_huks_type.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NATIVE_OH_HUKS_TYPE_H -#define NATIVE_OH_HUKS_TYPE_H - /** * @addtogroup HuksTypeApi * @{ @@ -33,11 +30,17 @@ * * @brief Defines the structure and enumeration. * + * @library libhuks_ndk.z.so + * @syscap SystemCapability.Security.Huks + * * @kit UniversalKeystoreKit * @since 9 * @version 1.0 */ +#ifndef NATIVE_OH_HUKS_TYPE_H +#define NATIVE_OH_HUKS_TYPE_H + #include #include #include -- Gitee From c57861befb944ffa5a7d76c77267f8472a1843d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=BE=8E=E4=BA=AE?= Date: Mon, 18 Nov 2024 08:39:06 +0000 Subject: [PATCH 428/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周澎亮 --- multimodalinput/kits/c/input/oh_input_manager.h | 16 ++++++++-------- multimodalinput/kits/c/input/oh_key_code.h | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 0a2b5b471..90b91d7cb 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OH_INPUT_MANAGER_H -#define OH_INPUT_MANAGER_H - /** * @addtogroup input * @{ @@ -35,6 +32,9 @@ * @since 12 */ +#ifndef OH_INPUT_MANAGER_H +#define OH_INPUT_MANAGER_H + #include #include "oh_axis_type.h" @@ -674,7 +674,7 @@ int32_t OH_Input_GetMouseEventAxisType(const struct Input_MouseEvent* mouseEvent * @brief Sets the axis value for a mouse axis event. * * @param mouseEvent Mouse event object. - * @param axisType Axis value. A positive value means scrolling forward, + * @param axisValue Axis value. A positive value means scrolling forward, * and a negative number means scrolling backward. * @syscap SystemCapability.MultimodalInput.Input.Core * @since 12 @@ -704,7 +704,7 @@ void OH_Input_SetMouseEventActionTime(struct Input_MouseEvent* mouseEvent, int64 /** * @brief Obtains the time when a mouse event occurs. * - * @param keyEvent Mouse event object. + * @param mouseEvent Mouse event object. * @return Returns the time when the mouse event occurs. * @syscap SystemCapability.MultimodalInput.Input.Core * @since 12 @@ -825,7 +825,7 @@ int32_t OH_Input_GetTouchEventDisplayY(const struct Input_TouchEvent* touchEvent /** * @brief Sets the time when a touch event occurs. * - * @param keyEvent Touch event object. + * @param touchEvent Touch event object. * @param actionTime Time when the touch event occurs. * @syscap SystemCapability.MultimodalInput.Input.Core * @since 12 @@ -835,7 +835,7 @@ void OH_Input_SetTouchEventActionTime(struct Input_TouchEvent* touchEvent, int64 /** * @brief Obtains the time when a touch event occurs. * - * @param keyEvent touch event object. + * @param touchEvent touch event object. * @return Returns the time when the touch event occurs. * @syscap SystemCapability.MultimodalInput.Input.Core * @since 12 @@ -1050,7 +1050,7 @@ Input_Result OH_Input_SetAxisEventSourceType(Input_AxisEvent* axisEvent, InputEv * @brief Obtains the axis event source type. * * @param axisEvent Axis event object. - * @param axisEventType Axis event source type. The values are defined in {@link InputEvent_SourceType}. + * @param sourceType Axis event source type. The values are defined in {@link InputEvent_SourceType}. * @return OH_Input_GetAxisEventSourceType function result code. * {@link INPUT_SUCCESS} Obtains the axis event source type success.\n * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL or the sourceType is NULL.\n diff --git a/multimodalinput/kits/c/input/oh_key_code.h b/multimodalinput/kits/c/input/oh_key_code.h index 29233f311..32b3b9bcf 100644 --- a/multimodalinput/kits/c/input/oh_key_code.h +++ b/multimodalinput/kits/c/input/oh_key_code.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OH_KEY_CODE_H -#define OH_KEY_CODE_H - /** * @addtogroup input * @{ @@ -35,6 +32,9 @@ * @since 12 */ +#ifndef OH_KEY_CODE_H +#define OH_KEY_CODE_H + #ifdef __cplusplus extern "C" { #endif -- Gitee From 2ceac6193f8a7e9ece035e4bfb1cc5ce62a02862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=90=BC=E6=B4=81?= Date: Mon, 18 Nov 2024 07:03:02 +0000 Subject: [PATCH 429/620] 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张琼洁 --- .../relational_store/include/data_asset.h | 11 ++++++++--- .../relational_store/include/oh_cursor.h | 11 +++++++---- .../relational_store/include/oh_predicates.h | 11 +++++++---- .../relational_store/include/oh_value_object.h | 11 +++++++---- .../relational_store/include/oh_values_bucket.h | 11 +++++++---- .../relational_store/include/relational_store.h | 13 ++++++++----- .../include/relational_store_error_code.h | 12 +++++++----- 7 files changed, 51 insertions(+), 29 deletions(-) diff --git a/distributeddatamgr/relational_store/include/data_asset.h b/distributeddatamgr/relational_store/include/data_asset.h index a8bc9e16a..19f24afae 100644 --- a/distributeddatamgr/relational_store/include/data_asset.h +++ b/distributeddatamgr/relational_store/include/data_asset.h @@ -13,8 +13,6 @@ * limitations under the License. */ -#ifndef DATA_ASSET_H -#define DATA_ASSET_H /** * @addtogroup RDB * @{ @@ -32,10 +30,14 @@ * * @brief Provides the data type of asset. * @kit ArkData - * @library libnative_rdb_ndk.z.so + * @library libnative_rdb_ndk.so * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 11 */ + +#ifndef DATA_ASSET_H +#define DATA_ASSET_H + #include #include #ifdef __cplusplus @@ -350,4 +352,7 @@ int OH_Data_Asset_DestroyMultiple(Data_Asset **assets, uint32_t count); #ifdef __cplusplus }; #endif + +/** @} */ + #endif // DATA_ASSET_H diff --git a/distributeddatamgr/relational_store/include/oh_cursor.h b/distributeddatamgr/relational_store/include/oh_cursor.h index 30d208ab4..9e14c2e2a 100644 --- a/distributeddatamgr/relational_store/include/oh_cursor.h +++ b/distributeddatamgr/relational_store/include/oh_cursor.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OH_CURSOR_H -#define OH_CURSOR_H - /** * @addtogroup RDB * @{ @@ -25,7 +22,6 @@ * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ @@ -35,9 +31,14 @@ * @brief Provides functions and enumerations related to the resultSet. * * @kit ArkData + * @library libnative_rdb_ndk.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ +#ifndef OH_CURSOR_H +#define OH_CURSOR_H + #include #include #include @@ -292,4 +293,6 @@ typedef struct OH_Cursor { }; #endif +/** @} */ + #endif // OH_CURSOR_H diff --git a/distributeddatamgr/relational_store/include/oh_predicates.h b/distributeddatamgr/relational_store/include/oh_predicates.h index 71f496459..b7777b3a6 100644 --- a/distributeddatamgr/relational_store/include/oh_predicates.h +++ b/distributeddatamgr/relational_store/include/oh_predicates.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OH_PREDICATES_H -#define OH_PREDICATES_H - /** * @addtogroup RDB * @{ @@ -25,7 +22,6 @@ * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ @@ -35,9 +31,14 @@ * @brief Declared predicate related functions and enumerations. * * @kit ArkData + * @library libnative_rdb_ndk.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ +#ifndef OH_PREDICATES_H +#define OH_PREDICATES_H + #include #include #include "database/rdb/oh_value_object.h" @@ -401,4 +402,6 @@ typedef struct OH_Predicates { }; #endif +/** @} */ + #endif // OH_PREDICATES_H diff --git a/distributeddatamgr/relational_store/include/oh_value_object.h b/distributeddatamgr/relational_store/include/oh_value_object.h index dbe5d0d18..b9da7f7c3 100644 --- a/distributeddatamgr/relational_store/include/oh_value_object.h +++ b/distributeddatamgr/relational_store/include/oh_value_object.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OH_VALUE_OBJECT_H -#define OH_VALUE_OBJECT_H - /** * @addtogroup RDB * @{ @@ -25,7 +22,6 @@ * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ @@ -35,9 +31,14 @@ * @brief Provides numeric type conversion functions. * * @kit ArkData + * @library libnative_rdb_ndk.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ +#ifndef OH_VALUE_OBJECT_H +#define OH_VALUE_OBJECT_H + #include #ifdef __cplusplus extern "C" { @@ -118,4 +119,6 @@ typedef struct OH_VObject { }; #endif +/** @} */ + #endif // OH_VALUE_OBJECT_H diff --git a/distributeddatamgr/relational_store/include/oh_values_bucket.h b/distributeddatamgr/relational_store/include/oh_values_bucket.h index db822d1de..f01fd551b 100644 --- a/distributeddatamgr/relational_store/include/oh_values_bucket.h +++ b/distributeddatamgr/relational_store/include/oh_values_bucket.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OH_VALUES_BUCKET_H -#define OH_VALUES_BUCKET_H - /** * @addtogroup RDB * @{ @@ -25,7 +22,6 @@ * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ @@ -35,9 +31,14 @@ * @brief Define the type of stored key value pairs. * * @kit ArkData + * @library libnative_rdb_ndk.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ +#ifndef OH_VALUES_BUCKET_H +#define OH_VALUES_BUCKET_H + #include #include "database/data/data_asset.h" #ifdef __cplusplus @@ -173,4 +174,6 @@ int OH_VBucket_PutAssets(OH_VBucket *bucket, const char *field, Data_Asset **val }; #endif +/** @} */ + #endif // OH_VALUES_BUCKET_H diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index b8be9a6aa..8f4d63962 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef RELATIONAL_STORE_H -#define RELATIONAL_STORE_H - /** * @addtogroup RDB * @{ @@ -25,7 +22,6 @@ * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ @@ -35,9 +31,14 @@ * @brief Provides database related functions and enumerations. * * @kit ArkData + * @library libnative_rdb_ndk.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ +#ifndef RELATIONAL_STORE_H +#define RELATIONAL_STORE_H + #include "database/rdb/oh_cursor.h" #include "database/rdb/oh_predicates.h" #include "database/rdb/oh_value_object.h" @@ -212,7 +213,7 @@ int OH_Rdb_DestroyConfig(OH_Rdb_ConfigV2 *config); * * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. * Indicates the configuration of the database related to this RDB store. - * @param dataBaseDir Indicates the directory of the database. + * @param databaseDir Indicates the directory of the database. * @return Returns the status code of the execution. Successful execution returns RDB_OK, * {@link RDB_OK} - success. * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. @@ -1250,4 +1251,6 @@ OH_Cursor *OH_Rdb_QueryLockedRow( }; #endif +/** @} */ + #endif // RELATIONAL_STORE_H diff --git a/distributeddatamgr/relational_store/include/relational_store_error_code.h b/distributeddatamgr/relational_store/include/relational_store_error_code.h index 9fc2f6d2d..83b18cc8f 100644 --- a/distributeddatamgr/relational_store/include/relational_store_error_code.h +++ b/distributeddatamgr/relational_store/include/relational_store_error_code.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef RELATIONAL_STORE_ERRNO_CODE_H -#define RELATIONAL_STORE_ERRNO_CODE_H - /** * @addtogroup RDB * @{ @@ -25,20 +22,23 @@ * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ - /** * @file relational_store_error_code.h * * @brief Declaration error code information. * * @kit ArkData + * @library libnative_rdb_ndk.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ +#ifndef RELATIONAL_STORE_ERRNO_CODE_H +#define RELATIONAL_STORE_ERRNO_CODE_H + #ifdef __cplusplus extern "C" { #endif @@ -314,4 +314,6 @@ typedef enum OH_Rdb_ErrCode { }; #endif +/** @} */ + #endif // RELATIONAL_STORE_ERRNO_CODE_H \ No newline at end of file -- Gitee From db8f0ef009f4f1bdb411233f6fb51d823360dde6 Mon Sep 17 00:00:00 2001 From: shenshiyi2 Date: Mon, 18 Nov 2024 17:26:57 +0800 Subject: [PATCH 430/620] =?UTF-8?q?=E5=9B=BE=E5=BD=A2API=20Lint=E6=95=B4?= =?UTF-8?q?=E6=94=B9=20image=5Fcommon.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenshiyi2 --- multimedia/image_framework/include/image/image_common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index b6cf5943d..43c3af017 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -27,6 +27,7 @@ * * @brief Declares the common enums and structs used by the image interface. * + * @library libpixelmap.so * @kit ImageKit * @syscap SystemCapability.Multimedia.Image.Core * @since 12 -- Gitee From 1b990c459eb2f64b28f6e3c41d8cb4b7ecaf81d5 Mon Sep 17 00:00:00 2001 From: liujiaxing19 Date: Tue, 19 Nov 2024 10:57:41 +0800 Subject: [PATCH 431/620] =?UTF-8?q?hiAppEvent=E6=8E=A5=E5=8F=A3APILint?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liujiaxing19 Change-Id: Ia7f9ad69973e11c65e5e33b1c827dfe53c197da0 --- hiviewdfx/hiappevent/include/hiappevent/hiappevent.h | 5 +++-- hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h | 6 +++--- hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h | 6 +++--- hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h | 7 ++++--- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h index e4f847bac..e3c82e39f 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h @@ -13,8 +13,6 @@ * limitations under the License. */ -#ifndef HIVIEWDFX_HIAPPEVENT_H -#define HIVIEWDFX_HIAPPEVENT_H /** * @addtogroup HiAppEvent * @{ @@ -75,6 +73,9 @@ * @version 1.0 */ +#ifndef HIVIEWDFX_HIAPPEVENT_H +#define HIVIEWDFX_HIAPPEVENT_H + #include #include diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h index 7a6d6a2f8..1c0a4cb6b 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef HIVIEWDFX_HIAPPEVENT_CONFIG_H -#define HIVIEWDFX_HIAPPEVENT_CONFIG_H - /** * @addtogroup HiAppEvent * @{ @@ -49,6 +46,9 @@ * @version 1.0 */ +#ifndef HIVIEWDFX_HIAPPEVENT_CONFIG_H +#define HIVIEWDFX_HIAPPEVENT_CONFIG_H + #ifdef __cplusplus extern "C" { #endif diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h index c14564794..59a5aabe5 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef HIVIEWDFX_HIAPPEVENT_EVENT_H -#define HIVIEWDFX_HIAPPEVENT_EVENT_H - /** * @addtogroup HiAppEvent * @{ @@ -52,6 +49,9 @@ * @version 1.0 */ +#ifndef HIVIEWDFX_HIAPPEVENT_EVENT_H +#define HIVIEWDFX_HIAPPEVENT_EVENT_H + #ifdef __cplusplus extern "C" { #endif diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h index ec984a36a..5f9c10cb1 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef HIVIEWDFX_HIAPPEVENT_PARAM_H -#define HIVIEWDFX_HIAPPEVENT_PARAM_H - /** * @addtogroup HiAppEvent * @{ @@ -51,6 +48,10 @@ * @since 8 * @version 1.0 */ + +#ifndef HIVIEWDFX_HIAPPEVENT_PARAM_H +#define HIVIEWDFX_HIAPPEVENT_PARAM_H + #ifdef __cplusplus extern "C" { #endif -- Gitee From 9360e40985e473ed8b57b7a4a4da24fb8762aab7 Mon Sep 17 00:00:00 2001 From: liufei Date: Tue, 19 Nov 2024 11:05:26 +0800 Subject: [PATCH 432/620] api lint Signed-off-by: liufei --- .../native_drawing/drawing_font_collection.h | 22 +- .../native_drawing/drawing_font_mgr.h | 61 +- .../native_drawing/drawing_register_font.h | 6 +- .../native_drawing/drawing_text_declaration.h | 6 +- .../drawing_text_font_descriptor.h | 33 +- .../drawing_text_lineTypography.h | 8 +- .../native_drawing/drawing_text_typography.h | 928 +++++++++--------- 7 files changed, 546 insertions(+), 518 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_font_collection.h b/graphic/graphic_2d/native_drawing/drawing_font_collection.h index 5f7277d72..a6097dad1 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font_collection.h +++ b/graphic/graphic_2d/native_drawing/drawing_font_collection.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_FONT_COLLECTION_H -#define C_INCLUDE_DRAWING_FONT_COLLECTION_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_FONT_COLLECTION_H +#define C_INCLUDE_DRAWING_FONT_COLLECTION_H + #include "drawing_text_declaration.h" #ifdef __cplusplus @@ -59,31 +59,31 @@ OH_Drawing_FontCollection* OH_Drawing_CreateFontCollection(void); * @brief Releases the memory occupied by an OH_Drawing_FontCollection object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontCollection Indicates the pointer to an OH_Drawing_FontCollection object. + * @param fontCollection Indicates the pointer to an OH_Drawing_FontCollection object. * @since 8 * @version 1.0 */ -void OH_Drawing_DestroyFontCollection(OH_Drawing_FontCollection*); +void OH_Drawing_DestroyFontCollection(OH_Drawing_FontCollection* fontCollection); /** * @brief Disable the font collection fallback. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontCollection Indicates the pointer to an OH_Drawing_FontCollection object. + * @param fontCollection Indicates the pointer to an OH_Drawing_FontCollection object. * @since 12 * @version 1.0 */ -void OH_Drawing_DisableFontCollectionFallback(OH_Drawing_FontCollection*); +void OH_Drawing_DisableFontCollectionFallback(OH_Drawing_FontCollection* fontCollection); /** * @brief Disable the font collection systemfont. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontCollection Indicates the pointer to an OH_Drawing_FontCollection object. + * @param fontCollection Indicates the pointer to an OH_Drawing_FontCollection object. * @since 12 * @version 1.0 */ -void OH_Drawing_DisableFontCollectionSystemFont(OH_Drawing_FontCollection*); +void OH_Drawing_DisableFontCollectionSystemFont(OH_Drawing_FontCollection* fontCollection); /** * @brief Creates an OH_Drawing_FontCollection object with shared usage between @@ -100,11 +100,11 @@ OH_Drawing_FontCollection* OH_Drawing_CreateSharedFontCollection(void); * @brief Clear font caches. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontCollection Indicates the pointer to an OH_Drawing_FontCollection object. + * @param fontCollection Indicates the pointer to an OH_Drawing_FontCollection object. * @since 12 * @version 1.0 */ -void OH_Drawing_ClearFontCaches(OH_Drawing_FontCollection*); +void OH_Drawing_ClearFontCaches(OH_Drawing_FontCollection* fontCollection); #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_font_mgr.h b/graphic/graphic_2d/native_drawing/drawing_font_mgr.h index 15b931f80..04d880558 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font_mgr.h +++ b/graphic/graphic_2d/native_drawing/drawing_font_mgr.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_FONT_MGR_H -#define C_INCLUDE_DRAWING_FONT_MGR_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_FONT_MGR_H +#define C_INCLUDE_DRAWING_FONT_MGR_H + #include "drawing_types.h" #include "drawing_text_typography.h" #include @@ -62,34 +62,34 @@ OH_Drawing_FontMgr* OH_Drawing_FontMgrCreate(void); * @brief Releases the memory occupied by an OH_Drawing_FontMgr object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontMgr Indicates the pointer to an OH_Drawing_FontMgr object. + * @param drawingFontMgr Indicates the pointer to an OH_Drawing_FontMgr object. * @since 12 * @version 1.0 */ -void OH_Drawing_FontMgrDestroy(OH_Drawing_FontMgr*); +void OH_Drawing_FontMgrDestroy(OH_Drawing_FontMgr* drawingFontMgr); /** * @brief Gets the count of font families. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontMgr Indicates the pointer to an OH_Drawing_FontMgr object. + * @param drawingFontMgr Indicates the pointer to an OH_Drawing_FontMgr object. * @return Returns the count of font families. * @since 12 * @version 1.0 */ -int OH_Drawing_FontMgrGetFamilyCount(OH_Drawing_FontMgr*); +int OH_Drawing_FontMgrGetFamilyCount(OH_Drawing_FontMgr* drawingFontMgr); /** * @brief Gets the font family name by the index. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontMgr Indicates the pointer to an OH_Drawing_FontMgr object. + * @param drawingFontMgr Indicates the pointer to an OH_Drawing_FontMgr object. * @param index Indicates the index to get the font family name. * @return Returns the font family name corresponding to the index value. * @since 12 * @version 1.0 */ -char* OH_Drawing_FontMgrGetFamilyName(OH_Drawing_FontMgr*, int index); +char* OH_Drawing_FontMgrGetFamilyName(OH_Drawing_FontMgr* drawingFontMgr, int index); /** * @brief Releases the memory occupied by font family name. @@ -105,57 +105,57 @@ void OH_Drawing_FontMgrDestroyFamilyName(char* familyName); * @brief Creates an OH_Drawing_FontStyleSet object by OH_Drawing_FontMgr object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontMgr Indicates the pointer to an OH_Drawing_FontMgr object. + * @param drawingFontMgr Indicates the pointer to an OH_Drawing_FontMgr object. * @param index Indicates the index used to get the font style set object from the font manager object. * @return Returns the pointer to the OH_Drawing_FontStyleSet object created. * @since 12 * @version 1.0 */ -OH_Drawing_FontStyleSet* OH_Drawing_FontMgrCreateFontStyleSet(OH_Drawing_FontMgr*, int index); +OH_Drawing_FontStyleSet* OH_Drawing_FontMgrCreateFontStyleSet(OH_Drawing_FontMgr* drawingFontMgr, int index); /** * @brief Releases the memory occupied by an OH_Drawing_FontStyleSet object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontStyleSet Indicates the pointer to an OH_Drawing_FontStyleSet object. + * @param drawingFontStyleSet Indicates the pointer to an OH_Drawing_FontStyleSet object. * @since 12 * @version 1.0 */ -void OH_Drawing_FontMgrDestroyFontStyleSet(OH_Drawing_FontStyleSet*); +void OH_Drawing_FontMgrDestroyFontStyleSet(OH_Drawing_FontStyleSet* drawingFontStyleSet); /** * @brief Get the pointer to an OH_Drawing_FontStyleSet object for the given font style set family name. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontMgr Indicates the pointer to an OH_Drawing_FontMgr object. + * @param drawingFontMgr Indicates the pointer to an OH_Drawing_FontMgr object. * @param familyName Indicates the family name of a font style set to be matched. * @return Returns the pointer to the OH_Drawing_FontStyleSet object matched. * @since 12 * @version 1.0 */ -OH_Drawing_FontStyleSet* OH_Drawing_FontMgrMatchFamily(OH_Drawing_FontMgr*, const char* familyName); +OH_Drawing_FontStyleSet* OH_Drawing_FontMgrMatchFamily(OH_Drawing_FontMgr* drawingFontMgr, const char* familyName); /** * @brief Get the pointer to an OH_Drawing_Typeface object based on the given font style and family name. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontMgr Indicates the pointer to an OH_Drawing_FontMgr object. + * @param drawingFontMgr Indicates the pointer to an OH_Drawing_FontMgr object. * @param familyName Indicates the family name of a font style set to be matched. - * @param OH_Drawing_FontStyleStruct Indicates an OH_Drawing_FontStyleStruct object. + * @param fontStyle Indicates an OH_Drawing_FontStyleStruct object. * @return Returns the pointer to the OH_Drawing_Typeface object matched. * @since 12 * @version 1.0 */ -OH_Drawing_Typeface* OH_Drawing_FontMgrMatchFamilyStyle(OH_Drawing_FontMgr*, +OH_Drawing_Typeface* OH_Drawing_FontMgrMatchFamilyStyle(OH_Drawing_FontMgr* drawingFontMgr, const char* familyName, OH_Drawing_FontStyleStruct fontStyle); /** * @brief Get the pointer to an OH_Drawing_Typeface object for the given character. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontMgr Indicates the pointer to an OH_Drawing_FontMgr object. + * @param drawingFontMgr Indicates the pointer to an OH_Drawing_FontMgr object. * @param familyName Indicates the family name of a font style set to be matched. - * @param OH_Drawing_FontStyleStruct Indicates an OH_Drawing_FontStyleStruct object. + * @param fontStyle Indicates an OH_Drawing_FontStyleStruct object. * @param bcp47 Indicates an array of languages which indicate the language of character. * @param bcp47Count Indicates the array size of bcp47. * @param character Indicates a UTF8 value to be matched. @@ -163,33 +163,34 @@ OH_Drawing_Typeface* OH_Drawing_FontMgrMatchFamilyStyle(OH_Drawing_FontMgr*, * @since 12 * @version 1.0 */ -OH_Drawing_Typeface* OH_Drawing_FontMgrMatchFamilyStyleCharacter(OH_Drawing_FontMgr*, const char* familyName, - OH_Drawing_FontStyleStruct fontStyle, const char* bcp47[], int bcp47Count, int32_t character); +OH_Drawing_Typeface* OH_Drawing_FontMgrMatchFamilyStyleCharacter(OH_Drawing_FontMgr* drawingFontMgr, + const char* familyName, OH_Drawing_FontStyleStruct fontStyle, + const char* bcp47[], int bcp47Count, int32_t character); /** * @brief Create a typeface for the given index. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontStyleSet Indicates the pointer to an OH_Drawing_FontStyleSet object. + * @param fontStyleSet Indicates the pointer to an OH_Drawing_FontStyleSet object. * @param index Indicates the index of the typeface in this fontStyleSet. * @return If successful, return a pointer to OH_Drawing_Typeface object; if failed, return nullptr. * @since 12 * @version 1.0 */ -OH_Drawing_Typeface* OH_Drawing_FontStyleSetCreateTypeface(OH_Drawing_FontStyleSet*, int index); +OH_Drawing_Typeface* OH_Drawing_FontStyleSetCreateTypeface(OH_Drawing_FontStyleSet* fontStyleSet, int index); /** * @brief Get font style for the specified typeface. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontStyleSet Indicates the pointer to an OH_Drawing_FontStyleSet object. + * @param fontStyleSet Indicates the pointer to an OH_Drawing_FontStyleSet object. * @param index Indicates the index of the typeface in this fontStyleSet. * @param styleName Indicates the style name returned. * @return Return the OH_Drawing_FontStyleStruct structure. * @since 12 * @version 1.0 */ -OH_Drawing_FontStyleStruct OH_Drawing_FontStyleSetGetStyle(OH_Drawing_FontStyleSet*, int32_t index, +OH_Drawing_FontStyleStruct OH_Drawing_FontStyleSetGetStyle(OH_Drawing_FontStyleSet* fontStyleSet, int32_t index, char** styleName); /** @@ -206,25 +207,25 @@ void OH_Drawing_FontStyleSetFreeStyleName(char** styleName); * @brief Get the closest matching typeface. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontStyleSet Indicates the pointer to an OH_Drawing_FontStyleSet object. + * @param fontStyleSet Indicates the pointer to an OH_Drawing_FontStyleSet object. * @param fontStyleStruct Indicates the OH_Drawing_FontStyleStruct structure. * @return A pointer to matched OH_Drawing_Typeface. * @since 12 * @version 1.0 */ -OH_Drawing_Typeface* OH_Drawing_FontStyleSetMatchStyle(OH_Drawing_FontStyleSet*, +OH_Drawing_Typeface* OH_Drawing_FontStyleSetMatchStyle(OH_Drawing_FontStyleSet* fontStyleSet, OH_Drawing_FontStyleStruct fontStyleStruct); /** * @brief Get the count of typeface. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontStyleSet Indicates the pointer to an OH_Drawing_FontStyleSet object. + * @param fontStyleSet Indicates the pointer to an OH_Drawing_FontStyleSet object. * @return The count of typeface in this font style set. * @since 12 * @version 1.0 */ -int OH_Drawing_FontStyleSetCount(OH_Drawing_FontStyleSet*); +int OH_Drawing_FontStyleSetCount(OH_Drawing_FontStyleSet* fontStyleSet); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_register_font.h b/graphic/graphic_2d/native_drawing/drawing_register_font.h index 02f0e9826..2ffdbbfec 100644 --- a/graphic/graphic_2d/native_drawing/drawing_register_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_register_font.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_REGISTER_FONT_H -#define C_INCLUDE_DRAWING_REGISTER_FONT_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_REGISTER_FONT_H +#define C_INCLUDE_DRAWING_REGISTER_FONT_H + #include "drawing_text_declaration.h" #include "drawing_types.h" diff --git a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h index 24ec0b365..505001519 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_TEXT_DECLARATION_H -#define C_INCLUDE_DRAWING_TEXT_DECLARATION_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_TEXT_DECLARATION_H +#define C_INCLUDE_DRAWING_TEXT_DECLARATION_H + #ifdef __cplusplus extern "C" { #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h index e6c262107..2ae193b58 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h @@ -69,69 +69,70 @@ typedef enum { * font descriptors. If the match fails, return nullptr. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontDescriptor The pointer to the OH_Drawing_FontDescriptor object. It is recommended to + * @param desc The pointer to the OH_Drawing_FontDescriptor object. It is recommended to * use OH_Drawing_CreateFontDescriptor to obtain a valid OH_Drawing_FontDescriptor instance. * If you create your own OH_Drawing_FontDescriptor object, ensure that fields not intended for matching are * set to their default values. - * @param size_t Indicates the count of obtained OH_Drawing_FontDescriptor. + * @param num Indicates the count of obtained OH_Drawing_FontDescriptor. * @return Returns an array of OH_Drawing_FontDescriptor. Released through the * OH_Drawing_DestroyFontDescriptors interface after use. * @since 14 */ -OH_Drawing_FontDescriptor* OH_Drawing_MatchFontDescriptors(OH_Drawing_FontDescriptor*, size_t*); +OH_Drawing_FontDescriptor* OH_Drawing_MatchFontDescriptors(OH_Drawing_FontDescriptor* desc, size_t* num); /** * @brief Releases the OH_Drawing_FontDescriptor array. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontDescriptor OH_Drawing_FontDescriptor object array. - * @param size_t Represents the number of members of the OH_Drawing_FontDescriptor array. + * @param descriptors OH_Drawing_FontDescriptor object array. + * @param num Represents the number of members of the OH_Drawing_FontDescriptor array. * @since 14 */ -void OH_Drawing_DestroyFontDescriptors(OH_Drawing_FontDescriptor*, size_t); +void OH_Drawing_DestroyFontDescriptors(OH_Drawing_FontDescriptor* descriptors, size_t num); /** * @brief Get the OH_Drawing_FontDescriptor object by the font full name and the font type, supporting generic * fonts, stylish fonts, and installed fonts. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_String Indicates the full name object OH_Drawing_String. - * @param OH_Drawing_SystemFontType Indicates enumerates of system font type object OH_Drawing_SystemFontType. + * @param fullName Indicates the full name object OH_Drawing_String. + * @param fontType Indicates enumerates of system font type object OH_Drawing_SystemFontType. * @return Returns the pointer to a font descriptor object OH_Drawing_FontDescriptor. * @since 14 */ -OH_Drawing_FontDescriptor* OH_Drawing_GetFontDescriptorByFullName(const OH_Drawing_String*, OH_Drawing_SystemFontType); +OH_Drawing_FontDescriptor* OH_Drawing_GetFontDescriptorByFullName(const OH_Drawing_String* fullName, + OH_Drawing_SystemFontType fontType); /** * @brief Obtain the corresponding font full name array by the font type. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_SystemFontType Indicates enumerates of system font type object OH_Drawing_SystemFontType. + * @param fontType Indicates enumerates of system font type object OH_Drawing_SystemFontType. * @return Returns the pointer to full name array object OH_Drawing_Array. * @since 14 */ -OH_Drawing_Array* OH_Drawing_GetSystemFontFullNamesByType(OH_Drawing_SystemFontType); +OH_Drawing_Array* OH_Drawing_GetSystemFontFullNamesByType(OH_Drawing_SystemFontType fontType); /** * @brief Get the specified full name object OH_Drawing_String by index from the * OH_Drawing_Array object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Array Indicates an array of full name object OH_Drawing_Array. - * @param size_t The index of full name. + * @param fullNameArray Indicates an array of full name object OH_Drawing_Array. + * @param index The index of full name. * @return Returns a full name object OH_Drawing_String. * @since 14 */ -const OH_Drawing_String* OH_Drawing_GetSystemFontFullNameByIndex(OH_Drawing_Array*, size_t); +const OH_Drawing_String* OH_Drawing_GetSystemFontFullNameByIndex(OH_Drawing_Array* fullNameArray, size_t index); /** * @brief Releases the memory occupied by an array of font full names. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Array Indicates an array of full name object OH_Drawing_Array. + * @param fullNameArray Indicates an array of full name object OH_Drawing_Array. * @since 14 */ -void OH_Drawing_DestroySystemFontFullNames(OH_Drawing_Array*); +void OH_Drawing_DestroySystemFontFullNames(OH_Drawing_Array* fullNameArray); #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h b/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h index 6d20d529b..d37e6e3b2 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h @@ -50,7 +50,7 @@ extern "C" { * @brief Creates an OH_Drawing_LineTypography object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyCreate Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @param handler Indicates the pointer to an OH_Drawing_TypographyCreate object. * @return Returns the pointer to the OH_Drawing_LineTypography object created. * @since 14 */ @@ -60,7 +60,7 @@ OH_Drawing_LineTypography* OH_Drawing_CreateLineTypography(OH_Drawing_Typography * @brief Releases the memory occupied by an OH_Drawing_LineTypography object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_LineTypography Indicates the pointer to an OH_Drawing_LineTypography object. + * @param lineTypography Indicates the pointer to an OH_Drawing_LineTypography object. * @since 14 */ void OH_Drawing_DestroyLineTypography(OH_Drawing_LineTypography* lineTypography); @@ -69,7 +69,7 @@ void OH_Drawing_DestroyLineTypography(OH_Drawing_LineTypography* lineTypography) * @brief Calculate the line breakpoint based on the width provided. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyCreate Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @param lineTypography Indicates the pointer to an OH_Drawing_TypographyCreate object. * @param startIndex Indicates the starting point for the line-break calculations. * @param width Indicates the requested line-break width. * @return Returns the count of the characters from startIndex that would cause the line break. @@ -82,7 +82,7 @@ size_t OH_Drawing_LineTypographyGetLineBreak(OH_Drawing_LineTypography* lineTypo * @brief Creates a text line object based on the text range provided. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_LineTypography Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @param lineTypography Indicates the pointer to an OH_Drawing_TypographyCreate object. * @param startIndex Indicates the starting index of the text range. * @param count Indicates the characters count of the text range. * @return Returns the pointer to the OH_Drawing_TextLine object created. diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 59d6488ea..10f1c9071 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef C_INCLUDE_DRAWING_TEXT_TYPOGRAPHY_H -#define C_INCLUDE_DRAWING_TEXT_TYPOGRAPHY_H - /** * @addtogroup Drawing * @{ @@ -40,6 +37,9 @@ * @version 1.0 */ +#ifndef C_INCLUDE_DRAWING_TEXT_TYPOGRAPHY_H +#define C_INCLUDE_DRAWING_TEXT_TYPOGRAPHY_H + #ifdef __cplusplus #include #include @@ -60,6 +60,9 @@ extern "C" { /** * @brief Enumerates text directions. + * + * @since 8 + * @version 1.0 */ enum OH_Drawing_TextDirection { /** Right to left (RTL) */ @@ -70,6 +73,9 @@ enum OH_Drawing_TextDirection { /** * @brief Enumerates text alignment modes. + * + * @since 8 + * @version 1.0 */ enum OH_Drawing_TextAlign { /** Left-aligned */ @@ -101,6 +107,9 @@ enum OH_Drawing_TextAlign { /** * @brief Enumerates font weights. + * + * @since 8 + * @version 1.0 */ enum OH_Drawing_FontWeight { /** Thin */ @@ -125,6 +134,9 @@ enum OH_Drawing_FontWeight { /** * @brief Enumerates text baselines. + * + * @since 8 + * @version 1.0 */ enum OH_Drawing_TextBaseline { /** Alphabetic, where the letters in alphabets like English sit on. */ @@ -135,6 +147,9 @@ enum OH_Drawing_TextBaseline { /** * @brief Enumerates text decorations. + * + * @since 8 + * @version 1.0 */ enum OH_Drawing_TextDecoration { /** No decoration. */ @@ -149,6 +164,9 @@ enum OH_Drawing_TextDecoration { /** * @brief Enumerates font styles. + * + * @since 8 + * @version 1.0 */ enum OH_Drawing_FontStyle { /** Normal style */ @@ -625,44 +643,44 @@ OH_Drawing_TypographyStyle* OH_Drawing_CreateTypographyStyle(void); * @brief Releases the memory occupied by an OH_Drawing_TypographyStyle object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. * @since 8 * @version 1.0 */ -void OH_Drawing_DestroyTypographyStyle(OH_Drawing_TypographyStyle*); +void OH_Drawing_DestroyTypographyStyle(OH_Drawing_TypographyStyle* style); /** * @brief Sets the text direction. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. - * @param int Indicates the text direction to set. For details, see the enum OH_Drawing_TextDirection. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param direction Indicates the text direction to set. For details, see the enum OH_Drawing_TextDirection. * @since 8 * @version 1.0 */ -void OH_Drawing_SetTypographyTextDirection(OH_Drawing_TypographyStyle*, int /* OH_Drawing_TextDirection */); +void OH_Drawing_SetTypographyTextDirection(OH_Drawing_TypographyStyle* style, int direction); /** * @brief Sets the text alignment mode. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. - * @param int Indicates the text alignment mode to set. For details, see the enum OH_Drawing_TextAlign. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param align Indicates the text alignment mode to set. For details, see the enum OH_Drawing_TextAlign. * @since 8 * @version 1.0 */ -void OH_Drawing_SetTypographyTextAlign(OH_Drawing_TypographyStyle*, int /* OH_Drawing_TextAlign */); +void OH_Drawing_SetTypographyTextAlign(OH_Drawing_TypographyStyle* style, int align); /** * @brief Sets the maximum number of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. - * @param int Indicates the maximum number of lines to set. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param lineNumber Indicates the maximum number of lines to set. * @since 8 * @version 1.0 */ -void OH_Drawing_SetTypographyTextMaxLines(OH_Drawing_TypographyStyle*, int /* maxLines */); +void OH_Drawing_SetTypographyTextMaxLines(OH_Drawing_TypographyStyle* style, int lineNumber); /** * @brief Creates an OH_Drawing_TextStyle object. @@ -678,372 +696,372 @@ OH_Drawing_TextStyle* OH_Drawing_CreateTextStyle(void); * @brief Releases the memory occupied by an OH_Drawing_TextStyle object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @since 8 * @version 1.0 */ -void OH_Drawing_DestroyTextStyle(OH_Drawing_TextStyle*); +void OH_Drawing_DestroyTextStyle(OH_Drawing_TextStyle* style); /** * @brief Sets the text color. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param uint32_t Indicates the color to set. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param color Indicates the color to set. * @since 8 * @version 1.0 */ -void OH_Drawing_SetTextStyleColor(OH_Drawing_TextStyle*, uint32_t /* color */); +void OH_Drawing_SetTextStyleColor(OH_Drawing_TextStyle* style, uint32_t color); /** * @brief Sets the font size. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param double Indicates the font size to set. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param fontSize Indicates the font size to set. * @since 8 * @version 1.0 */ -void OH_Drawing_SetTextStyleFontSize(OH_Drawing_TextStyle*, double /* fontSize */); +void OH_Drawing_SetTextStyleFontSize(OH_Drawing_TextStyle* style, double fontSize); /** * @brief Sets the font weight. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param int Indicates the font weight to set. For details, see the enum OH_Drawing_FontWeight. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param fontWeight Indicates the font weight to set. For details, see the enum OH_Drawing_FontWeight. * @since 8 * @version 1.0 */ -void OH_Drawing_SetTextStyleFontWeight(OH_Drawing_TextStyle*, int /* OH_Drawing_FontWeight */); +void OH_Drawing_SetTextStyleFontWeight(OH_Drawing_TextStyle* style, int fontWeight); /** * @brief Sets the text baseline. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param int Indicates the text baseline to set. For details, see the enum OH_Drawing_TextBaseline. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param baseline Indicates the text baseline to set. For details, see the enum OH_Drawing_TextBaseline. * @since 8 * @version 1.0 */ -void OH_Drawing_SetTextStyleBaseLine(OH_Drawing_TextStyle*, int /* OH_Drawing_TextBaseline */); +void OH_Drawing_SetTextStyleBaseLine(OH_Drawing_TextStyle* style, int baseline); /** * @brief Sets the text decoration. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param int Indicates the text decoration to set. For details, see the enum OH_Drawing_TextDecoration. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param decoration Indicates the text decoration to set. For details, see the enum OH_Drawing_TextDecoration. * @since 8 * @version 1.0 */ -void OH_Drawing_SetTextStyleDecoration(OH_Drawing_TextStyle*, int /* OH_Drawing_TextDecoration */); +void OH_Drawing_SetTextStyleDecoration(OH_Drawing_TextStyle* style, int decoration); /** * @brief Add the text decoration. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param int Indicates the text decoration to add. For details, see the enum OH_Drawing_TextDecoration. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param decoration Indicates the text decoration to add. For details, see the enum OH_Drawing_TextDecoration. * @since 14 * @version 1.0 */ -void OH_Drawing_AddTextStyleDecoration(OH_Drawing_TextStyle*, int /* OH_Drawing_TextDecoration */); +void OH_Drawing_AddTextStyleDecoration(OH_Drawing_TextStyle* style, int decoration); /** * @brief Remove the text decoration. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param int Indicates the text decoration to remove, shoud be match existing text decorations. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param decoration Indicates the text decoration to remove, shoud be match existing text decorations. * For details, see the enum OH_Drawing_TextDecoration. * @since 14 * @version 1.0 */ -void OH_Drawing_RemoveTextStyleDecoration(OH_Drawing_TextStyle*, int /* OH_Drawing_TextDecoration */); +void OH_Drawing_RemoveTextStyleDecoration(OH_Drawing_TextStyle* style, int decoration); /** * @brief Sets the color for the text decoration. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param uint32_t Indicates the color to set. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param color Indicates the color to set. * @since 8 * @version 1.0 */ -void OH_Drawing_SetTextStyleDecorationColor(OH_Drawing_TextStyle*, uint32_t /* color */); +void OH_Drawing_SetTextStyleDecorationColor(OH_Drawing_TextStyle* style, uint32_t color); /** * @brief Sets the font height. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param double Indicates the font height to set. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param fontHeight Indicates the font height to set. * @since 8 * @version 1.0 */ -void OH_Drawing_SetTextStyleFontHeight(OH_Drawing_TextStyle*, double /* fontHeight */); +void OH_Drawing_SetTextStyleFontHeight(OH_Drawing_TextStyle* style, double fontHeight); /** * @brief Sets the font families. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param int Indicates the number of font families to set. - * @param char Indicates the pointer to the font families to set. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param fontFamiliesNumber Indicates the number of font families to set. + * @param fontFamilies Indicates the pointer to the font families to set. * @since 8 * @version 1.0 */ -void OH_Drawing_SetTextStyleFontFamilies(OH_Drawing_TextStyle*, - int /* fontFamiliesNumber */, const char* fontFamilies[]); +void OH_Drawing_SetTextStyleFontFamilies(OH_Drawing_TextStyle* style, + int fontFamiliesNumber, const char* fontFamilies[]); /** * @brief Sets the font style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param int Indicates the font style to set. For details, see the enum OH_Drawing_FontStyle. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param fontStyle Indicates the font style to set. For details, see the enum OH_Drawing_FontStyle. * @since 8 * @version 1.0 */ -void OH_Drawing_SetTextStyleFontStyle(OH_Drawing_TextStyle*, int /* OH_Drawing_FontStyle */); +void OH_Drawing_SetTextStyleFontStyle(OH_Drawing_TextStyle* style, int fontStyle); /** * @brief Sets the locale. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param char Indicates the pointer to the locale to set. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param locale Indicates the pointer to the locale to set. * @since 8 * @version 1.0 */ -void OH_Drawing_SetTextStyleLocale(OH_Drawing_TextStyle*, const char*); +void OH_Drawing_SetTextStyleLocale(OH_Drawing_TextStyle* style, const char* locale); /** * @brief Sets the foreground brush style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. - * @param OH_Drawing_Brush Indicates the pointer to a brush object OH_Drawing_Brush. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param foregroundBrush Indicates the pointer to a brush object OH_Drawing_Brush. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTextStyleForegroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Brush*); +void OH_Drawing_SetTextStyleForegroundBrush(OH_Drawing_TextStyle* style, OH_Drawing_Brush* foregroundBrush); /** * @brief Gets the foreground brush style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. - * @param OH_Drawing_Brush Indicates the pointer to a brush object OH_Drawing_Brush. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param foregroundBrush Indicates the pointer to a brush object OH_Drawing_Brush. * @since 12 * @version 1.0 */ -void OH_Drawing_TextStyleGetForegroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Brush*); +void OH_Drawing_TextStyleGetForegroundBrush(OH_Drawing_TextStyle* style, OH_Drawing_Brush* foregroundBrush); /** * @brief Sets the foreground pen style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. - * @param OH_Drawing_Pen Indicates the pointer to a pen object OH_Drawing_Pen. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param foregroundPen Indicates the pointer to a pen object OH_Drawing_Pen. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTextStyleForegroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen*); +void OH_Drawing_SetTextStyleForegroundPen(OH_Drawing_TextStyle* style, OH_Drawing_Pen* foregroundPen); /** * @brief Gets the foreground pen style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. - * @param OH_Drawing_Pen Indicates the pointer to a pen object OH_Drawing_Pen. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param foregroundPen Indicates the pointer to a pen object OH_Drawing_Pen. * @since 12 * @version 1.0 */ -void OH_Drawing_TextStyleGetForegroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen*); +void OH_Drawing_TextStyleGetForegroundPen(OH_Drawing_TextStyle* style, OH_Drawing_Pen* foregroundPen); /** * @brief Sets the background brush style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. - * @param OH_Drawing_Brush Indicates the pointer to a brush object OH_Drawing_Brush. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param foregroundPen Indicates the pointer to a brush object OH_Drawing_Brush. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTextStyleBackgroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Brush*); +void OH_Drawing_SetTextStyleBackgroundBrush(OH_Drawing_TextStyle* style, OH_Drawing_Brush* foregroundPen); /** * @brief Gets the background brush style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. - * @param OH_Drawing_Brush Indicates the pointer to a brush object OH_Drawing_Brush. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param backgroundBrush Indicates the pointer to a brush object OH_Drawing_Brush. * @since 12 * @version 1.0 */ -void OH_Drawing_TextStyleGetBackgroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Brush*); +void OH_Drawing_TextStyleGetBackgroundBrush(OH_Drawing_TextStyle* style, OH_Drawing_Brush* backgroundBrush); /** * @brief Sets the background pen style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. - * @param OH_Drawing_Pen Indicates the pointer to a pen object OH_Drawing_Pen. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param backgroundPen Indicates the pointer to a pen object OH_Drawing_Pen. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTextStyleBackgroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen*); +void OH_Drawing_SetTextStyleBackgroundPen(OH_Drawing_TextStyle* style, OH_Drawing_Pen* backgroundPen); /** * @brief Gets the background pen style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. - * @param OH_Drawing_Pen Indicates the pointer to a pen object OH_Drawing_Pen. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param backgroundPen Indicates the pointer to a pen object OH_Drawing_Pen. * @since 12 * @version 1.0 */ -void OH_Drawing_TextStyleGetBackgroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen*); +void OH_Drawing_TextStyleGetBackgroundPen(OH_Drawing_TextStyle* style, OH_Drawing_Pen* backgroundPen); /** * @brief Creates a pointer to an OH_Drawing_TypographyCreate object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. - * @param OH_Drawing_FontCollection Indicates the pointer to an OH_Drawing_FontCollection object. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param fontCollection Indicates the pointer to an OH_Drawing_FontCollection object. * @return Returns the pointer to the OH_Drawing_TypographyCreate object created. * @since 8 * @version 1.0 */ -OH_Drawing_TypographyCreate* OH_Drawing_CreateTypographyHandler(OH_Drawing_TypographyStyle*, - OH_Drawing_FontCollection*); +OH_Drawing_TypographyCreate* OH_Drawing_CreateTypographyHandler(OH_Drawing_TypographyStyle* style, + OH_Drawing_FontCollection* fontCollection); /** * @brief Releases the memory occupied by an OH_Drawing_TypographyCreate object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyCreate Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @param handler Indicates the pointer to an OH_Drawing_TypographyCreate object. * @since 8 * @version 1.0 */ -void OH_Drawing_DestroyTypographyHandler(OH_Drawing_TypographyCreate*); +void OH_Drawing_DestroyTypographyHandler(OH_Drawing_TypographyCreate* handler); /** * @brief Sets the text style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyCreate Indicates the pointer to an OH_Drawing_TypographyCreate object. - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param handler Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @since 8 * @version 1.0 */ -void OH_Drawing_TypographyHandlerPushTextStyle(OH_Drawing_TypographyCreate*, OH_Drawing_TextStyle*); +void OH_Drawing_TypographyHandlerPushTextStyle(OH_Drawing_TypographyCreate* handler, OH_Drawing_TextStyle* style); /** * @brief Sets the text content. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyCreate Indicates the pointer to an OH_Drawing_TypographyCreate object. - * @param char Indicates the pointer to the text content to set. + * @param handler Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @param text Indicates the pointer to the text content to set. * @since 8 * @version 1.0 */ -void OH_Drawing_TypographyHandlerAddText(OH_Drawing_TypographyCreate*, const char*); +void OH_Drawing_TypographyHandlerAddText(OH_Drawing_TypographyCreate* handler, const char* text); /** * @brief Removes the topmost style in the stack, leaving the remaining styles in effect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyCreate Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @param handler Indicates the pointer to an OH_Drawing_TypographyCreate object. * @since 8 * @version 1.0 */ -void OH_Drawing_TypographyHandlerPopTextStyle(OH_Drawing_TypographyCreate*); +void OH_Drawing_TypographyHandlerPopTextStyle(OH_Drawing_TypographyCreate* handler); /** * @brief Creates an OH_Drawing_Typography object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyCreate Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @param handler Indicates the pointer to an OH_Drawing_TypographyCreate object. * @return Returns the pointer to the OH_Drawing_Typography object created. * @since 8 * @version 1.0 */ -OH_Drawing_Typography* OH_Drawing_CreateTypography(OH_Drawing_TypographyCreate*); +OH_Drawing_Typography* OH_Drawing_CreateTypography(OH_Drawing_TypographyCreate* handler); /** * @brief Releases the memory occupied by an OH_Drawing_Typography object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. * @since 8 * @version 1.0 */ -void OH_Drawing_DestroyTypography(OH_Drawing_Typography*); +void OH_Drawing_DestroyTypography(OH_Drawing_Typography* typography); /** * @brief Lays out the typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @param double Indicates the maximum text width to set. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. + * @param maxWidth Indicates the maximum text width to set. * @since 8 * @version 1.0 */ -void OH_Drawing_TypographyLayout(OH_Drawing_Typography*, double /* maxWidth */); +void OH_Drawing_TypographyLayout(OH_Drawing_Typography* typography, double maxWidth); /** * @brief Paints text on the canvas. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param double Indicates the x coordinate. - * @param double Indicates the y coordinate. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param potisionX Indicates the x coordinate. + * @param potisionY Indicates the y coordinate. * @since 8 * @version 1.0 */ -void OH_Drawing_TypographyPaint(OH_Drawing_Typography*, OH_Drawing_Canvas*, - double /* potisionX */, double /* potisionY */); +void OH_Drawing_TypographyPaint(OH_Drawing_Typography* typography, OH_Drawing_Canvas* canvas, + double potisionX, double potisionY); /** * @brief Paints path text on the canvas. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Path Indicates path information. - * @param double Indicates the distance along the path to add to the text's starting position. - * @param double Indicates the distance above(-) or below(+) the path to position the text. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param path Indicates path information. + * @param hOffset Indicates the distance along the path to add to the text's starting position. + * @param vOffset Indicates the distance above(-) or below(+) the path to position the text. * @since 12 * @version 1.0 */ -void OH_Drawing_TypographyPaintOnPath(OH_Drawing_Typography*, OH_Drawing_Canvas*, OH_Drawing_Path*, - double /* hOffset */, double /* vOffset */); +void OH_Drawing_TypographyPaintOnPath(OH_Drawing_Typography* typography, OH_Drawing_Canvas* canvas, + OH_Drawing_Path* path, double hOffset, double vOffset); /** * @brief Gets the max width. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. * @return Returns the max width. * @since 9 * @version 1.1 */ -double OH_Drawing_TypographyGetMaxWidth(OH_Drawing_Typography*); +double OH_Drawing_TypographyGetMaxWidth(OH_Drawing_Typography* typography); /** * @brief Gets the height. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. * @return Returns the height. * @since 9 * @version 1.1 */ -double OH_Drawing_TypographyGetHeight(OH_Drawing_Typography*); +double OH_Drawing_TypographyGetHeight(OH_Drawing_Typography* typography); /** * @brief Obtains the width of the longest line. You are advised to round up the return value in actual use. @@ -1051,13 +1069,13 @@ double OH_Drawing_TypographyGetHeight(OH_Drawing_Typography*); * that is, -340282346638528859811704183484516925440.000000, is returned. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Pointer to an OH_Drawing_Typography object, which is obtained by + * @param typography Pointer to an OH_Drawing_Typography object, which is obtained by * {@link OH_Drawing_CreateTypography}. * @return Returns the width of the longest line. * @since 9 * @version 1.1 */ -double OH_Drawing_TypographyGetLongestLine(OH_Drawing_Typography*); +double OH_Drawing_TypographyGetLongestLine(OH_Drawing_Typography* typography); /** * @brief Obtains the width of the longest line with indent. You are advised to @@ -1065,168 +1083,168 @@ double OH_Drawing_TypographyGetLongestLine(OH_Drawing_Typography*); * minimum float value, that is, 0.0, is returned. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Pointer to an OH_Drawing_Typography object, which is obtained by + * @param typography Pointer to an OH_Drawing_Typography object, which is obtained by * {@link OH_Drawing_CreateTypography}. * @return Returns the width of the longest line with indent. * @since 13 * @version 1.1 */ -double OH_Drawing_TypographyGetLongestLineWithIndent(OH_Drawing_Typography*); +double OH_Drawing_TypographyGetLongestLineWithIndent(OH_Drawing_Typography* typography); /** * @brief Gets the min intrinsic width. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param typography the pointer to an OH_Drawing_Typography object. * @return Returns the min intrinsic width. * @since 9 * @version 1.1 */ -double OH_Drawing_TypographyGetMinIntrinsicWidth(OH_Drawing_Typography*); +double OH_Drawing_TypographyGetMinIntrinsicWidth(OH_Drawing_Typography* typography); /** * @brief Gets the max intrinsic width. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. * @return Returns the max intrinsic width. * @since 9 * @version 1.1 */ -double OH_Drawing_TypographyGetMaxIntrinsicWidth(OH_Drawing_Typography*); +double OH_Drawing_TypographyGetMaxIntrinsicWidth(OH_Drawing_Typography* typography); /** * @brief Gets the alphabetic baseline. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. * @return Returns the alphabetic baseline. * @since 9 * @version 1.1 */ -double OH_Drawing_TypographyGetAlphabeticBaseline(OH_Drawing_Typography*); +double OH_Drawing_TypographyGetAlphabeticBaseline(OH_Drawing_Typography* typography); /** * @brief Gets the ideographic baseline. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. * @return Returns the ideographic baseline. * @since 9 * @version 1.1 */ -double OH_Drawing_TypographyGetIdeographicBaseline(OH_Drawing_Typography*); +double OH_Drawing_TypographyGetIdeographicBaseline(OH_Drawing_Typography* typography); /** * @brief Sets the placeholder. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyCreate Indicates the pointer to an OH_Drawing_TypographyCreate object. - * @param OH_Drawing_PlaceholderSpan Indicates the pointer to an OH_Drawing_PlaceholderSpan object. + * @param handler Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @param span Indicates the pointer to an OH_Drawing_PlaceholderSpan object. * @since 11 * @version 1.0 */ -void OH_Drawing_TypographyHandlerAddPlaceholder(OH_Drawing_TypographyCreate*, OH_Drawing_PlaceholderSpan*); +void OH_Drawing_TypographyHandlerAddPlaceholder(OH_Drawing_TypographyCreate* handler, OH_Drawing_PlaceholderSpan* span); /** * @brief Gets the exceed maxLines. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. * @return Returns the exceed maxLines. * @since 11 * @version 1.0 */ -bool OH_Drawing_TypographyDidExceedMaxLines(OH_Drawing_Typography*); +bool OH_Drawing_TypographyDidExceedMaxLines(OH_Drawing_Typography* typography); /** * @brief Gets the rects for range. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @param size_t Indicates the start of range to set. - * @param size_t Indicates the end of range to set. - * @param OH_Drawing_RectHeightStyle Indicates the height style to set. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. + * @param start Indicates the start of range to set. + * @param end Indicates the end of range to set. + * @param heightStyle Indicates the height style to set. * For details, see the enum OH_Drawing_RectHeightStyle. - * @param OH_Drawing_RectWidthStyle Indicates the width style to set. + * @param widthStyle Indicates the width style to set. * For details, see the enum OH_Drawing_RectWidthStyle. * @return Returns the rects for range. * @since 11 * @version 1.0 */ -OH_Drawing_TextBox* OH_Drawing_TypographyGetRectsForRange(OH_Drawing_Typography*, - size_t, size_t, OH_Drawing_RectHeightStyle, OH_Drawing_RectWidthStyle); +OH_Drawing_TextBox* OH_Drawing_TypographyGetRectsForRange(OH_Drawing_Typography* typography, + size_t start, size_t end, OH_Drawing_RectHeightStyle heightStyle, OH_Drawing_RectWidthStyle widthStyle); /** * @brief Gets the rects for placeholders. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. * @return Returns the rects for placeholders. * @since 11 * @version 1.0 */ -OH_Drawing_TextBox* OH_Drawing_TypographyGetRectsForPlaceholders(OH_Drawing_Typography*); +OH_Drawing_TextBox* OH_Drawing_TypographyGetRectsForPlaceholders(OH_Drawing_Typography* typography); /** * @brief Gets left from textbox. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextBox Indicates the pointer to an OH_Drawing_TextBox object. - * @param int Indicates the index of textbox. + * @param textbox Indicates the pointer to an OH_Drawing_TextBox object. + * @param index Indicates the index of textbox. * @return Returns left from textbox. * @since 11 * @version 1.0 */ -float OH_Drawing_GetLeftFromTextBox(OH_Drawing_TextBox*, int); +float OH_Drawing_GetLeftFromTextBox(OH_Drawing_TextBox* textbox, int index); /** * @brief Gets right from textbox. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextBox Indicates the pointer to an OH_Drawing_TextBox object. - * @param int Indicates the index of textbox. + * @param textbox Indicates the pointer to an OH_Drawing_TextBox object. + * @param index Indicates the index of textbox. * @return Returns right from textbox. * @since 11 * @version 1.0 */ -float OH_Drawing_GetRightFromTextBox(OH_Drawing_TextBox*, int); +float OH_Drawing_GetRightFromTextBox(OH_Drawing_TextBox* textbox, int index); /** * @brief Gets top from textbox. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextBox Indicates the pointer to an OH_Drawing_TextBox object. - * @param int Indicates the index of textbox. + * @param textbox Indicates the pointer to an OH_Drawing_TextBox object. + * @param index Indicates the index of textbox. * @return Returns top from textbox. * @since 11 * @version 1.0 */ -float OH_Drawing_GetTopFromTextBox(OH_Drawing_TextBox*, int); +float OH_Drawing_GetTopFromTextBox(OH_Drawing_TextBox* textbox, int index); /** * @brief Gets bottom from textbox. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextBox Indicates the pointer to an OH_Drawing_TextBox object. - * @param int Indicates the index of textbox. + * @param textbox Indicates the pointer to an OH_Drawing_TextBox object. + * @param index Indicates the index of textbox. * @return Returns bottom from textbox. * @since 11 * @version 1.0 */ -float OH_Drawing_GetBottomFromTextBox(OH_Drawing_TextBox*, int); +float OH_Drawing_GetBottomFromTextBox(OH_Drawing_TextBox* textbox, int index); /** * @brief Gets direction from textbox. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextBox Indicates the pointer to an OH_Drawing_TextBox object. - * @param int Indicates the index of textbox. + * @param textbox Indicates the pointer to an OH_Drawing_TextBox object. + * @param index Indicates the index of textbox. * @return Returns direction from textbox. * @since 11 * @version 1.0 */ -int OH_Drawing_GetTextDirectionFromTextBox(OH_Drawing_TextBox*, int); +int OH_Drawing_GetTextDirectionFromTextBox(OH_Drawing_TextBox* textbox, int index); /** * @brief Gets size of textbox. @@ -1243,29 +1261,29 @@ size_t OH_Drawing_GetSizeOfTextBox(OH_Drawing_TextBox*); * @brief Gets the glyphposition at coordinate. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @param double Indicates the positionX of typography to set. - * @param double Indicates the positionY of typography to set. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. + * @param dx Indicates the positionX of typography to set. + * @param dy Indicates the positionY of typography to set. * @return Returns the glyphposition at coordinate. * @since 11 * @version 1.0 */ -OH_Drawing_PositionAndAffinity* OH_Drawing_TypographyGetGlyphPositionAtCoordinate(OH_Drawing_Typography*, - double, double); +OH_Drawing_PositionAndAffinity* OH_Drawing_TypographyGetGlyphPositionAtCoordinate(OH_Drawing_Typography* typography, + double dx, double dy); /** * @brief Gets the glyphposition at coordinate with cluster. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @param double Indicates the positionX of typography to set. - * @param double Indicates the positionY of typography to set. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. + * @param dx Indicates the positionX of typography to set. + * @param dy Indicates the positionY of typography to set. * @return Returns the glyphposition at coordinate with cluster. * @since 11 * @version 1.0 */ -OH_Drawing_PositionAndAffinity* OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster(OH_Drawing_Typography*, - double, double); +OH_Drawing_PositionAndAffinity* OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster( + OH_Drawing_Typography* typography, double dx, double dy); /** * @brief Gets position from position and affinity. @@ -1282,24 +1300,24 @@ size_t OH_Drawing_GetPositionFromPositionAndAffinity(OH_Drawing_PositionAndAffin * @brief Gets affinity from position and affinity. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_PositionAndAffinity Indicates the pointer to an OH_Drawing_PositionAndAffinity object. + * @param positionandaffinity Indicates the pointer to an OH_Drawing_PositionAndAffinity object. * @return Returns affinity from position and affinity. * @since 11 * @version 1.0 */ -int OH_Drawing_GetAffinityFromPositionAndAffinity(OH_Drawing_PositionAndAffinity*); +int OH_Drawing_GetAffinityFromPositionAndAffinity(OH_Drawing_PositionAndAffinity* positionandaffinity); /** * @brief Gets the word boundary. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @param size_t Indicates the size of text to set. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. + * @param offset Indicates the size of text to set. * @return Returns the word boundary. * @since 11 * @version 1.0 */ -OH_Drawing_Range* OH_Drawing_TypographyGetWordBoundary(OH_Drawing_Typography*, size_t); +OH_Drawing_Range* OH_Drawing_TypographyGetWordBoundary(OH_Drawing_Typography* typography, size_t offset); /** * @brief Gets start from range. @@ -1338,149 +1356,150 @@ size_t OH_Drawing_TypographyGetLineCount(OH_Drawing_Typography*); * @brief Sets the decoration style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param int Indicates the text decoration style to set. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param decorationStyle Indicates the text decoration style to set. * For details, see the enum OH_Drawing_TextDecorationStyle. * @since 11 * @version 1.0 */ -void OH_Drawing_SetTextStyleDecorationStyle(OH_Drawing_TextStyle*, int); +void OH_Drawing_SetTextStyleDecorationStyle(OH_Drawing_TextStyle* style, int decorationStyle); /** * @brief Sets the decoration thickness scale. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param double Indicates the thickness scale of text decoration to set. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param decorationThicknessScale Indicates the thickness scale of text decoration to set. * @since 11 * @version 1.0 */ -void OH_Drawing_SetTextStyleDecorationThicknessScale(OH_Drawing_TextStyle*, double); +void OH_Drawing_SetTextStyleDecorationThicknessScale(OH_Drawing_TextStyle* style, double decorationThicknessScale); /** * @brief Sets the letter spacing. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param double Indicates the letter space to set. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param letterSpacing Indicates the letter space to set. * @since 11 * @version 1.0 */ -void OH_Drawing_SetTextStyleLetterSpacing(OH_Drawing_TextStyle*, double); +void OH_Drawing_SetTextStyleLetterSpacing(OH_Drawing_TextStyle* style, double letterSpacing); /** * @brief Sets the word spacing. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param double Indicates the word space to set. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param wordSpacing Indicates the word space to set. * @since 11 * @version 1.0 */ -void OH_Drawing_SetTextStyleWordSpacing(OH_Drawing_TextStyle*, double); +void OH_Drawing_SetTextStyleWordSpacing(OH_Drawing_TextStyle* style, double wordSpacing); /** * @brief Sets the half leading. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param bool Indicates the half leading to set. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param halfLeading Indicates the half leading to set. * @since 11 * @version 1.0 */ -void OH_Drawing_SetTextStyleHalfLeading(OH_Drawing_TextStyle*, bool); +void OH_Drawing_SetTextStyleHalfLeading(OH_Drawing_TextStyle* style, bool halfLeading); /** * @brief Sets the ellipsis. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param char* Indicates the pointer to ellipsis style. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param ellipsis Indicates the pointer to ellipsis style. * @since 11 * @version 1.0 */ -void OH_Drawing_SetTextStyleEllipsis(OH_Drawing_TextStyle*, const char*); +void OH_Drawing_SetTextStyleEllipsis(OH_Drawing_TextStyle* style, const char* ellipsis); /** * @brief Sets the ellipsis modal. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param int Indicates the ellipsis model to set. For details, see the enum OH_Drawing_EllipsisModal. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param ellipsisModal Indicates the ellipsis model to set. For details, see the enum OH_Drawing_EllipsisModal. * @since 11 * @version 1.0 */ -void OH_Drawing_SetTextStyleEllipsisModal(OH_Drawing_TextStyle*, int); +void OH_Drawing_SetTextStyleEllipsisModal(OH_Drawing_TextStyle* style, int ellipsisModal); /** * @brief Sets the break strategy. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. - * @param int Indicates the break strategy to set. For details, see the enum OH_Drawing_BreakStrategy. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param breakStrategy Indicates the break strategy to set. For details, see the enum OH_Drawing_BreakStrategy. * @since 11 * @version 1.0 */ -void OH_Drawing_SetTypographyTextBreakStrategy(OH_Drawing_TypographyStyle*, int); +void OH_Drawing_SetTypographyTextBreakStrategy(OH_Drawing_TypographyStyle* style, int breakStrategy); /** * @brief Sets the word break type. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. - * @param int Indicates the word break type to set. For details, see the enum OH_Drawing_WordBreakType. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param wordBreakType Indicates the word break type to set. For details, see the enum OH_Drawing_WordBreakType. * @since 11 * @version 1.0 */ -void OH_Drawing_SetTypographyTextWordBreakType(OH_Drawing_TypographyStyle*, int); +void OH_Drawing_SetTypographyTextWordBreakType(OH_Drawing_TypographyStyle* style, int wordBreakType); /** * @brief Sets the ellipsis modal. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. - * @param int Indicates the ellipsis modal to set. For details, see the enum OH_Drawing_EllipsisModal. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param ellipsisModal Indicates the ellipsis modal to set. For details, see the enum OH_Drawing_EllipsisModal. * @since 11 * @version 1.0 */ -void OH_Drawing_SetTypographyTextEllipsisModal(OH_Drawing_TypographyStyle*, int); +void OH_Drawing_SetTypographyTextEllipsisModal(OH_Drawing_TypographyStyle* style, int ellipsisModal); /** * @brief get line height. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @param int Indicates the line number. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. + * @param lineNumber Indicates the line number. * @return Returns line height. * @since 11 * @version 1.0 */ -double OH_Drawing_TypographyGetLineHeight(OH_Drawing_Typography*, int); +double OH_Drawing_TypographyGetLineHeight(OH_Drawing_Typography* typography, int lineNumber); /** * @brief get line width. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @param int Indicates the line number. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. + * @param lineNumber Indicates the line number. * @return Returns line width. * @since 11 * @version 1.0 */ -double OH_Drawing_TypographyGetLineWidth(OH_Drawing_Typography*, int); +double OH_Drawing_TypographyGetLineWidth(OH_Drawing_Typography* typography, int lineNumber); /** * @brief get line text range. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @param int Indicates the line number. - * @param bool Indicates whether spaces are contained. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. + * @param lineNumber Indicates the line number. + * @param includeSpaces Indicates whether spaces are contained. * @return Returns line text range. * @since 12 * @version 1.0 */ -OH_Drawing_Range* OH_Drawing_TypographyGetLineTextRange(OH_Drawing_Typography*, int, bool); +OH_Drawing_Range* OH_Drawing_TypographyGetLineTextRange(OH_Drawing_Typography* typography, + int lineNumber, bool includeSpaces); /** * @brief Creates an OH_Drawing_FontDescriptor object. @@ -1496,11 +1515,11 @@ OH_Drawing_FontDescriptor* OH_Drawing_CreateFontDescriptor(void); * @brief Releases the memory occupied by an OH_Drawing_FontDescriptor object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontDescriptor the pointer to the font descriptor object OH_Drawing_FontDescriptor. + * @param descriptor the pointer to the font descriptor object OH_Drawing_FontDescriptor. * @since 12 * @version 1.0 */ -void OH_Drawing_DestroyFontDescriptor(OH_Drawing_FontDescriptor*); +void OH_Drawing_DestroyFontDescriptor(OH_Drawing_FontDescriptor* descriptor); /** * @brief Creates an OH_Drawing_FontParser object. @@ -1516,57 +1535,57 @@ OH_Drawing_FontParser* OH_Drawing_CreateFontParser(void); * @brief Releases the memory occupied by an OH_Drawing_FontParser object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontParser Indicates the pointer to the font parser object OH_Drawing_FontParser. + * @param parser Indicates the pointer to the font parser object OH_Drawing_FontParser. * @since 12 * @version 1.0 */ -void OH_Drawing_DestroyFontParser(OH_Drawing_FontParser*); +void OH_Drawing_DestroyFontParser(OH_Drawing_FontParser* parser); /** * @brief Gets a list of system font names. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontParser Indicates the pointer to the font parser object OH_Drawing_FontParser. - * @param size_t Returns the number of obtained system font names. + * @param fontParser Indicates the pointer to the font parser object OH_Drawing_FontParser. + * @param num Returns the number of obtained system font names. * @return Returns a list of obtained system fonts. * @since 12 * @version 1.0 */ -char** OH_Drawing_FontParserGetSystemFontList(OH_Drawing_FontParser*, size_t*); +char** OH_Drawing_FontParserGetSystemFontList(OH_Drawing_FontParser* fontParser, size_t* num); /** * @brief Releases the memory occupied by a list of system font names. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param char** Indicates the pointer to a list of system font names. - * @param size_t The number of obtained system font names. + * @param fontList Indicates the pointer to a list of system font names. + * @param num The number of obtained system font names. * @since 12 * @version 1.0 */ -void OH_Drawing_DestroySystemFontList(char**, size_t); +void OH_Drawing_DestroySystemFontList(char** fontList, size_t num); /** * @brief Gets information about the system font by font name. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontParser Indicates the pointer to the font parser object OH_Drawing_FontParser. - * @param char** font name. + * @param fontParser Indicates the pointer to the font parser object OH_Drawing_FontParser. + * @param name font name. * @return Returns system fonts information. * @since 12 * @version 1.0 */ -OH_Drawing_FontDescriptor* OH_Drawing_FontParserGetFontByName(OH_Drawing_FontParser*, const char*); +OH_Drawing_FontDescriptor* OH_Drawing_FontParserGetFontByName(OH_Drawing_FontParser* fontParser, const char* name); /** * @brief Get line metrics information. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. + * @param typography Indicates the pointer to a typography object OH_Drawing_Typography. * @return Indicates the pointer to a line metrics object OH_Drawing_LineMetrics. * @since 12 * @version 1.0 */ -OH_Drawing_LineMetrics* OH_Drawing_TypographyGetLineMetrics(OH_Drawing_Typography*); +OH_Drawing_LineMetrics* OH_Drawing_TypographyGetLineMetrics(OH_Drawing_Typography* typography); /** * @brief Get the number of lines. @@ -1583,334 +1602,338 @@ size_t OH_Drawing_LineMetricsGetSize(OH_Drawing_LineMetrics*); * @brief Releases the memory occupied by line metrics. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_LineMetrics Indicates the pointer to a line metrics object OH_Drawing_LineMetrics. + * @param lineMetrics Indicates the pointer to a line metrics object OH_Drawing_LineMetrics. * @since 12 * @version 1.0 */ -void OH_Drawing_DestroyLineMetrics(OH_Drawing_LineMetrics*); +void OH_Drawing_DestroyLineMetrics(OH_Drawing_LineMetrics* lineMetrics); /** * @brief Gets the specified line by line number. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. - * @param int Line number. - * @param OH_Drawing_LineMetrics Indicates the pointer to a line metrics object OH_Drawing_LineMetrics. + * @param typography Indicates the pointer to a typography object OH_Drawing_Typography. + * @param lineNumber Line number. + * @param lineMetric Indicates the pointer to a line metrics object OH_Drawing_LineMetrics. * @return Whether the line metrics was obtained. * @since 12 * @version 1.0 */ -bool OH_Drawing_TypographyGetLineMetricsAt(OH_Drawing_Typography*, int, OH_Drawing_LineMetrics*); +bool OH_Drawing_TypographyGetLineMetricsAt(OH_Drawing_Typography* typography, + int lineNumber, OH_Drawing_LineMetrics* lineMetric); /** * @brief Sets the ellipsis of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. - * @param char Indicates the line textellipsis. + * @param style Indicates the pointer to a typography object OH_Drawing_Typography. + * @param ellipsis Indicates the line textellipsis. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextEllipsis(OH_Drawing_TypographyStyle*, const char*); +void OH_Drawing_SetTypographyTextEllipsis(OH_Drawing_TypographyStyle* style, const char* ellipsis); /** * @brief Sets the locale of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param char Indicates the pointer to the locale to set. + * @param locale Indicates the pointer to the locale to set. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextLocale(OH_Drawing_TypographyStyle*, const char*); +void OH_Drawing_SetTypographyTextLocale(OH_Drawing_TypographyStyle* style, const char* locale); /** * @brief Sets the textSplitRatio of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param float Indicates the textSplitRatio of lines to set. + * @param textSplitRatio Indicates the textSplitRatio of lines to set. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextSplitRatio(OH_Drawing_TypographyStyle*, float); +void OH_Drawing_SetTypographyTextSplitRatio(OH_Drawing_TypographyStyle* style, float textSplitRatio); /** * @brief Gets the TextStyle of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Returns line text textstyle. * @since 12 * @version 1.0 */ -OH_Drawing_TextStyle* OH_Drawing_TypographyGetTextStyle(OH_Drawing_TypographyStyle*); +OH_Drawing_TextStyle* OH_Drawing_TypographyGetTextStyle(OH_Drawing_TypographyStyle* style); /** * @brief Gets the EffectiveAlign of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Returns line text align. * @since 12 * @version 1.0 */ -int OH_Drawing_TypographyGetEffectiveAlignment(OH_Drawing_TypographyStyle*); +int OH_Drawing_TypographyGetEffectiveAlignment(OH_Drawing_TypographyStyle* style); /** * @brief Gets the UnlimitedLines of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Returns whether the text has a maximum line limit, * with true indicating a maximum line limit and false indicating no maximum line limit. * @since 12 * @version 1.0 */ -bool OH_Drawing_TypographyIsLineUnlimited(OH_Drawing_TypographyStyle*); +bool OH_Drawing_TypographyIsLineUnlimited(OH_Drawing_TypographyStyle* style); /** * @brief Gets the IsEllipsized of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Returns whether the text has ellipsis, * true meaning there is an ellipsis and false meaning there is no ellipsis. * @since 12 * @version 1.0 */ -bool OH_Drawing_TypographyIsEllipsized(OH_Drawing_TypographyStyle*); +bool OH_Drawing_TypographyIsEllipsized(OH_Drawing_TypographyStyle* style); /** * @brief set line textstyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param handler Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextStyle(OH_Drawing_TypographyStyle*, OH_Drawing_TextStyle*); +void OH_Drawing_SetTypographyTextStyle(OH_Drawing_TypographyStyle* handler, OH_Drawing_TextStyle* style); /** * @brief get line fontmetrics. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. - * @param OH_Drawing_Font_Metrics Indicates the pointer to a font metrics object OH_Drawing_Font_Metrics. + * @param typography Indicates the pointer to a typography object OH_Drawing_Typography. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param fontmetrics Indicates the pointer to a font metrics object OH_Drawing_Font_Metrics. * @return Whether the font metrics was obtained. * @since 12 * @version 1.0 */ -bool OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_Typography*, OH_Drawing_TextStyle*, OH_Drawing_Font_Metrics*); +bool OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_Typography* typography, + OH_Drawing_TextStyle* style, OH_Drawing_Font_Metrics* fontmetrics); /** * @brief Gets the position of the specified line or the first text of the specified line. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. - * @param int Line number. - * @param bool True is the information for the whole line, and false is the information to get the first character - * @param bool Whether the text width contains whitespace. - * @param OH_Drawing_LineMetrics Indicates the pointer to a line metrics object OH_Drawing_LineMetrics. + * @param typography Indicates the pointer to a typography object OH_Drawing_Typography. + * @param lineNumber Line number. + * @param oneLine True is the information for the whole line, and false is the information to get the first character + * @param includeWhitespace Whether the text width contains whitespace. + * @param drawingLineMetrics Indicates the pointer to a line metrics object OH_Drawing_LineMetrics. * @return return whether the information was successfully fetched. * @since 12 * @version 1.0 */ -bool OH_Drawing_TypographyGetLineInfo(OH_Drawing_Typography*, int, bool, bool, OH_Drawing_LineMetrics*); +bool OH_Drawing_TypographyGetLineInfo(OH_Drawing_Typography* typography, int lineNumber, bool oneLine, + bool includeWhitespace, OH_Drawing_LineMetrics* drawingLineMetrics); /** * @brief Sets the font weight of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param int Indicates the font weight of text typography to set. For details, + * @param weight Indicates the font weight of text typography to set. For details, * see the enum OH_Drawing_FontWeight. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextFontWeight(OH_Drawing_TypographyStyle*, int); +void OH_Drawing_SetTypographyTextFontWeight(OH_Drawing_TypographyStyle* style, int weight); /** * @brief Sets the font style of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param int Indicates the font style of text typography to set. For details, + * @param fontStyle Indicates the font style of text typography to set. For details, * see the enum OH_Drawing_FontStyle. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextFontStyle(OH_Drawing_TypographyStyle*, int); +void OH_Drawing_SetTypographyTextFontStyle(OH_Drawing_TypographyStyle* style, int fontStyle); /** * @brief Sets the font family of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param char Indicates the pointer to the font family of text typography to set. + * @param fontFamily Indicates the pointer to the font family of text typography to set. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextFontFamily(OH_Drawing_TypographyStyle*, const char*); +void OH_Drawing_SetTypographyTextFontFamily(OH_Drawing_TypographyStyle* style, const char* fontFamily); /** * @brief Sets the font size of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param double Indicates the font size of text typography to set. + * @param fontSize Indicates the font size of text typography to set. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextFontSize(OH_Drawing_TypographyStyle*, double); +void OH_Drawing_SetTypographyTextFontSize(OH_Drawing_TypographyStyle* style, double fontSize); /** * @brief Sets the font height of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param double Indicates the font height of text typography to set. + * @param fontHeight Indicates the font height of text typography to set. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextFontHeight(OH_Drawing_TypographyStyle*, double); +void OH_Drawing_SetTypographyTextFontHeight(OH_Drawing_TypographyStyle* style, double fontHeight); /** * @brief Sets the half leading of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param bool Indicates the half leading of text typography to set. + * @param halfLeading Indicates the half leading of text typography to set. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextHalfLeading(OH_Drawing_TypographyStyle*, bool); +void OH_Drawing_SetTypographyTextHalfLeading(OH_Drawing_TypographyStyle* style, bool halfLeading); /** * @brief Sets whether to enable line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param bool Indicates whether the line style for text typography is used. + * @param useLineStyle Indicates whether the line style for text typography is used. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextUseLineStyle(OH_Drawing_TypographyStyle*, bool); +void OH_Drawing_SetTypographyTextUseLineStyle(OH_Drawing_TypographyStyle* style, bool useLineStyle); /** * @brief Sets the font weight of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param int Indicates the font weight of line style for text typography to set. + * @param weight Indicates the font weight of line style for text typography to set. * For details, see the enum OH_Drawing_FontWeight. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextLineStyleFontWeight(OH_Drawing_TypographyStyle*, int); +void OH_Drawing_SetTypographyTextLineStyleFontWeight(OH_Drawing_TypographyStyle* style, int weight); /** * @brief Sets the font style of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param int Indicates the font style of line style for text typography to set. For details, + * @param fontStyle Indicates the font style of line style for text typography to set. For details, * see the enum OH_Drawing_FontStyle. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextLineStyleFontStyle(OH_Drawing_TypographyStyle*, int); +void OH_Drawing_SetTypographyTextLineStyleFontStyle(OH_Drawing_TypographyStyle* style, int fontStyle); /** * @brief Sets the font families of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param int Indicates the number of font families to set. - * @param char Indicates the pointer to the font families of line style for text typography to set. + * @param fontFamiliesNumber Indicates the number of font families to set. + * @param fontFamilies Indicates the pointer to the font families of line style for text typography to set. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextLineStyleFontFamilies(OH_Drawing_TypographyStyle*, int, const char* fontFamilies[]); +void OH_Drawing_SetTypographyTextLineStyleFontFamilies(OH_Drawing_TypographyStyle* style, + int fontFamiliesNumber, const char* fontFamilies[]); /** * @brief Sets the font size of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param double Indicates the font size of line style for text typography to set. + * @param lineStyleFontSize Indicates the font size of line style for text typography to set. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextLineStyleFontSize(OH_Drawing_TypographyStyle*, double); +void OH_Drawing_SetTypographyTextLineStyleFontSize(OH_Drawing_TypographyStyle* style, double lineStyleFontSize); /** * @brief Sets the font height of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param double Indicates the font height of line style for text typography to set. + * @param lineStyleFontHeight Indicates the font height of line style for text typography to set. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextLineStyleFontHeight(OH_Drawing_TypographyStyle*, double); +void OH_Drawing_SetTypographyTextLineStyleFontHeight(OH_Drawing_TypographyStyle* style, double lineStyleFontHeight); /** * @brief Sets the half leading of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param bool Indicates the half leading of line for text typography to set. + * @param lineStyleHalfLeading Indicates the half leading of line for text typography to set. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextLineStyleHalfLeading(OH_Drawing_TypographyStyle*, bool); +void OH_Drawing_SetTypographyTextLineStyleHalfLeading(OH_Drawing_TypographyStyle* style, bool lineStyleHalfLeading); /** * @brief Sets the spacing scale of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param double Indicates the space scale of line for text typography to set. + * @param spacingScale Indicates the space scale of line for text typography to set. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextLineStyleSpacingScale(OH_Drawing_TypographyStyle*, double); +void OH_Drawing_SetTypographyTextLineStyleSpacingScale(OH_Drawing_TypographyStyle* style, double spacingScale); /** * @brief Sets whether only line style is enabled for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. - * @param bool Indicates the line style for text typography to set only. + * @param lineStyleOnly Indicates the line style for text typography to set only. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextLineStyleOnly(OH_Drawing_TypographyStyle*, bool); +void OH_Drawing_SetTypographyTextLineStyleOnly(OH_Drawing_TypographyStyle* style, bool lineStyleOnly); /** * @brief Creates an OH_Drawing_TextShadow object. @@ -1926,194 +1949,197 @@ OH_Drawing_TextShadow* OH_Drawing_CreateTextShadow(void); * @brief Releases the memory occupied by the text shadow object OH_Drawing_TextShadow. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object OH_Drawing_TextShadow. + * @param shadow Indicates the pointer to the text shadow object OH_Drawing_TextShadow. * @since 12 * @version 1.0 */ -void OH_Drawing_DestroyTextShadow(OH_Drawing_TextShadow*); +void OH_Drawing_DestroyTextShadow(OH_Drawing_TextShadow* shadow); /** * @brief Gets the vector of TextShadow in TextStyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. * @param int Indicates the number in vector to set. - * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object OH_Drawing_TextShadow. + * @param style Indicates the pointer to the text shadow object OH_Drawing_TextShadow. * @return Returns the vector of TextShadow. * @since 12 * @version 1.0 */ -OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadows(OH_Drawing_TextStyle*); +OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadows(OH_Drawing_TextStyle* style); /** * @brief Gets the size of vector of TextShadow in TextStyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. * @return Returns the size of vector. * @since 12 * @version 1.0 */ -int OH_Drawing_TextStyleGetShadowCount(OH_Drawing_TextStyle*); +int OH_Drawing_TextStyleGetShadowCount(OH_Drawing_TextStyle* style); /** * @brief Adds element in vector of TextShadow in TextStyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. - * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object OH_Drawing_TextShadow. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param shadow Indicates the pointer to the text shadow object OH_Drawing_TextShadow. * @since 12 * @version 1.0 */ -void OH_Drawing_TextStyleAddShadow(OH_Drawing_TextStyle*, const OH_Drawing_TextShadow*); +void OH_Drawing_TextStyleAddShadow(OH_Drawing_TextStyle* style, const OH_Drawing_TextShadow* shadow); /** * @brief clear elements in vector of TextShadow in TextStyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. * @since 12 * @version 1.0 */ -void OH_Drawing_TextStyleClearShadows(OH_Drawing_TextStyle*); +void OH_Drawing_TextStyleClearShadows(OH_Drawing_TextStyle* style); /** * @brief Gets element in vector of TextShadow with index. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. - * @param int Indicates the index to set. + * @param style Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param index Indicates the index to set. * @return Returns the pointer to element with the index in vector of the text style object * OH_Drawing_TextStyle. * @since 12 * @version 1.0 */ -OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadowWithIndex(OH_Drawing_TextStyle*, int); +OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadowWithIndex(OH_Drawing_TextStyle* style, int index); /** * @brief Set indents of the typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. - * @param float Indicates the pointer to the indents to set. + * @param typography Indicates the pointer to a typography object OH_Drawing_Typography. + * @param indentsNumber Indicates the pointer to the indents to set. + * @param indents Indicates the pointer to the indents to set. * @since 12 * @version 1.0 */ -void OH_Drawing_TypographySetIndents(OH_Drawing_Typography*, int, const float indents[]); +void OH_Drawing_TypographySetIndents(OH_Drawing_Typography* typography, int indentsNumber, const float indents[]); /** * @brief Gets element with index in vector of Indents. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. - * @param int Indicates the index to set. + * @param typography Indicates the pointer to a typography object OH_Drawing_Typography. + * @param index Indicates the index to set. * @return float Indicates the element with the index in vector of Indents. * @since 12 * @version 1.0 */ -float OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography*, int); +float OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography* typography, int index); /** * @brief Releases the memory occupied by vector with the text shadow object OH_Drawing_TextShadow. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param Indicates the pointer to the text shadow object OH_Drawing_TextShadow. + * @param shadow the pointer to the text shadow object OH_Drawing_TextShadow. * @since 12 * @version 1.0 */ -void OH_Drawing_DestroyTextShadows(OH_Drawing_TextShadow*); +void OH_Drawing_DestroyTextShadows(OH_Drawing_TextShadow* shadow); /** * @brief Set mode of applying the leading over and under text. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. * @param heightMode Indicates the mode to set. * @since 12 * @version 1.0 */ -void OH_Drawing_TypographyTextSetHeightBehavior(OH_Drawing_TypographyStyle*, OH_Drawing_TextHeightBehavior heightMode); +void OH_Drawing_TypographyTextSetHeightBehavior(OH_Drawing_TypographyStyle* style, + OH_Drawing_TextHeightBehavior heightMode); /** * @brief Get mode of applying the leading over and under text. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. * @return Returns the mode. * @since 12 * @version 1.0 */ -OH_Drawing_TextHeightBehavior OH_Drawing_TypographyTextGetHeightBehavior(OH_Drawing_TypographyStyle*); +OH_Drawing_TextHeightBehavior OH_Drawing_TypographyTextGetHeightBehavior(OH_Drawing_TypographyStyle* style); /** * @brief Set struct of background rect and styleId of text. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param OH_Drawing_RectStyle_Info Indicates the pointer to an OH_Drawing_RectStyle_Info object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param rectStyleInfo Indicates the pointer to an OH_Drawing_RectStyle_Info object. * @param styleId Indicates the styleId of text to set. * @since 12 * @version 1.0 */ -void OH_Drawing_TextStyleSetBackgroundRect(OH_Drawing_TextStyle*, const OH_Drawing_RectStyle_Info*, int styleId); +void OH_Drawing_TextStyleSetBackgroundRect(OH_Drawing_TextStyle* style, + const OH_Drawing_RectStyle_Info* rectStyleInfo, int styleId); /** * @brief Add symbols in creating typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyCreate Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @param handler Indicates the pointer to an OH_Drawing_TypographyCreate object. * @param symbol Indicates the symbol to set. * @since 12 * @version 1.0 */ -void OH_Drawing_TypographyHandlerAddSymbol(OH_Drawing_TypographyCreate*, uint32_t symbol); +void OH_Drawing_TypographyHandlerAddSymbol(OH_Drawing_TypographyCreate* handler, uint32_t symbol); /** * @brief Add font feature. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @param tag Indicates the pointer to the tag to set. * @param value Indicates the value to set. * @since 12 * @version 1.0 */ -void OH_Drawing_TextStyleAddFontFeature(OH_Drawing_TextStyle*, const char* tag, int value); +void OH_Drawing_TextStyleAddFontFeature(OH_Drawing_TextStyle* style, const char* tag, int value); /** * @brief Add font variation. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param char* Indicates the pointer to font variation axis. - * @param float Indicates the font variation value to set. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param axis Indicates the pointer to font variation axis. + * @param value Indicates the font variation value to set. * @since 12 * @version 1.0 */ -void OH_Drawing_TextStyleAddFontVariation(OH_Drawing_TextStyle*, const char* /* axis */, const float /* value */); +void OH_Drawing_TextStyleAddFontVariation(OH_Drawing_TextStyle* style, const char* axis, const float value); /** * @brief Get all font features. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return OH_Drawing_FontFeature Indicates the pointer to an array of structures of OH_Drawing_FontFeature. * Get size of font feature by OH_Drawing_TextStyleGetFontFeatureSize. * @since 12 * @version 1.0 */ -OH_Drawing_FontFeature* OH_Drawing_TextStyleGetFontFeatures(OH_Drawing_TextStyle*); +OH_Drawing_FontFeature* OH_Drawing_TextStyleGetFontFeatures(OH_Drawing_TextStyle* style); /** * @brief Release the memory occupied by array of structures of font features. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontFeature Indicates the pointer to an array of structures of OH_Drawing_FontFeature. + * @param fontFeature Indicates the pointer to an array of structures of OH_Drawing_FontFeature. * @param fontFeatureSize Indicates the size of array of structures of OH_Drawing_FontFeature. * @since 12 * @version 1.0 */ -void OH_Drawing_TextStyleDestroyFontFeatures(OH_Drawing_FontFeature*, size_t fontFeatureSize); +void OH_Drawing_TextStyleDestroyFontFeatures(OH_Drawing_FontFeature* fontFeature, size_t fontFeatureSize); /** * @brief Get size of font features. @@ -2130,33 +2156,33 @@ size_t OH_Drawing_TextStyleGetFontFeatureSize(OH_Drawing_TextStyle*); * @brief Clear font features. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @since 12 * @version 1.0 */ -void OH_Drawing_TextStyleClearFontFeature(OH_Drawing_TextStyle*); +void OH_Drawing_TextStyleClearFontFeature(OH_Drawing_TextStyle* style); /** * @brief Set baseline shift of text. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @param lineShift Indicates the baseline shift to set. * @since 12 * @version 1.0 */ -void OH_Drawing_TextStyleSetBaselineShift(OH_Drawing_TextStyle*, double lineShift); +void OH_Drawing_TextStyleSetBaselineShift(OH_Drawing_TextStyle* style, double lineShift); /** * @brief Get baseline shift of text. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return Returns the baseline shift. * @since 12 * @version 1.0 */ -double OH_Drawing_TextStyleGetBaselineShift(OH_Drawing_TextStyle*); +double OH_Drawing_TextStyleGetBaselineShift(OH_Drawing_TextStyle* style); /** * @brief Gets the text color. @@ -2173,57 +2199,57 @@ uint32_t OH_Drawing_TextStyleGetColor(OH_Drawing_TextStyle*); * @brief Gets text decoration style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return Returns text decoration style. * @since 12 * @version 1.0 */ -OH_Drawing_TextDecorationStyle OH_Drawing_TextStyleGetDecorationStyle(OH_Drawing_TextStyle*); +OH_Drawing_TextDecorationStyle OH_Drawing_TextStyleGetDecorationStyle(OH_Drawing_TextStyle* style); /** * @brief Gets font weight. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return Returns font Weight. * @since 12 * @version 1.0 */ -OH_Drawing_FontWeight OH_Drawing_TextStyleGetFontWeight(OH_Drawing_TextStyle*); +OH_Drawing_FontWeight OH_Drawing_TextStyleGetFontWeight(OH_Drawing_TextStyle* style); /** * @brief Gets font style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return Returns font style. * @since 12 * @version 1.0 */ -OH_Drawing_FontStyle OH_Drawing_TextStyleGetFontStyle(OH_Drawing_TextStyle*); +OH_Drawing_FontStyle OH_Drawing_TextStyleGetFontStyle(OH_Drawing_TextStyle* style); /** * @brief Gets the font baseline. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return Returns the font baseline. * @since 12 * @version 1.0 */ -OH_Drawing_TextBaseline OH_Drawing_TextStyleGetBaseline(OH_Drawing_TextStyle*); +OH_Drawing_TextBaseline OH_Drawing_TextStyleGetBaseline(OH_Drawing_TextStyle* style); /** * @brief Gets a list of font families. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @param num Indicates count of font families result. * @return Returns a list of font families. * @since 12 * @version 1.0 */ -char** OH_Drawing_TextStyleGetFontFamilies(OH_Drawing_TextStyle*, size_t* num); +char** OH_Drawing_TextStyleGetFontFamilies(OH_Drawing_TextStyle* style, size_t* num); /** * @brief Releases the memory occupied by a list of font families. @@ -2240,76 +2266,76 @@ void OH_Drawing_TextStyleDestroyFontFamilies(char** fontFamilies, size_t num); * @brief Gets font size. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return Returns font size. * @since 12 * @version 1.0 */ -double OH_Drawing_TextStyleGetFontSize(OH_Drawing_TextStyle*); +double OH_Drawing_TextStyleGetFontSize(OH_Drawing_TextStyle* style); /** * @brief Gets the letter spacing of the text. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return Returns the size of the letter spacing. * @since 12 * @version 1.0 */ -double OH_Drawing_TextStyleGetLetterSpacing(OH_Drawing_TextStyle*); +double OH_Drawing_TextStyleGetLetterSpacing(OH_Drawing_TextStyle* style); /** * @brief Gets the word spacing of the text. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return Returns word spacing size. * @since 12 * @version 1.0 */ -double OH_Drawing_TextStyleGetWordSpacing(OH_Drawing_TextStyle*); +double OH_Drawing_TextStyleGetWordSpacing(OH_Drawing_TextStyle* style); /** * @brief Gets font height. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return Returns font height. * @since 12 * @version 1.0 */ -double OH_Drawing_TextStyleGetFontHeight(OH_Drawing_TextStyle*); +double OH_Drawing_TextStyleGetFontHeight(OH_Drawing_TextStyle* style); /** * @brief Gets whether to set the text to half line spacing. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return Returns true indicates that the spacing takes effect, * false indicates that the spacing does not take effect. * @since 12 * @version 1.0 */ -bool OH_Drawing_TextStyleGetHalfLeading(OH_Drawing_TextStyle*); +bool OH_Drawing_TextStyleGetHalfLeading(OH_Drawing_TextStyle* style); /** * @brief Gets the locale. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return Returns a locale of data type as a pointer to a char. As with the TextStyle lifecycle. * No release is required and the return value is invalidated after the set method is called. * @since 12 * @version 1.0 */ -const char* OH_Drawing_TextStyleGetLocale(OH_Drawing_TextStyle*); +const char* OH_Drawing_TextStyleGetLocale(OH_Drawing_TextStyle* style); /** * @brief Sets the text style, including font weight, font width and font slant. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param OH_Drawing_FontStyleStruct Indicates an OH_Drawing_FontStyleStruct object. + * @param drawingTextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param fontStyle Indicates an OH_Drawing_FontStyleStruct object. * @since 12 * @version 1.0 */ @@ -2320,7 +2346,7 @@ void OH_Drawing_SetTextStyleFontStyleStruct(OH_Drawing_TextStyle* drawingTextSty * @brief Gets the text style, including font weight, font width and font slant. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param drawingTextStyle Indicates the pointer to an OH_Drawing_TextStyle object. * @return Returns the OH_Drawing_FontStyleStruct object getted. * @since 12 * @version 1.0 @@ -2331,8 +2357,8 @@ OH_Drawing_FontStyleStruct OH_Drawing_TextStyleGetFontStyleStruct(OH_Drawing_Tex * @brief Sets the typography style, including font weight, font width and font slant. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. - * @param OH_Drawing_FontStyleStruct Indicates an OH_Drawing_FontStyleStruct object. + * @param drawingStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param fontStyle Indicates an OH_Drawing_FontStyleStruct object. * @since 12 * @version 1.0 */ @@ -2343,7 +2369,7 @@ void OH_Drawing_SetTypographyStyleFontStyleStruct(OH_Drawing_TypographyStyle* dr * @brief Gets the typography style, including font weight, font width and font slant. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param drawingStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. * @return Returns the OH_Drawing_FontStyleStruct object getted. * @since 12 * @version 1.0 @@ -2378,9 +2404,9 @@ bool OH_Drawing_TextStyleIsEqualByFont(const OH_Drawing_TextStyle* style, const * @brief Gets whether two TextStyle objects match attributes * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param textStyleType Indicates enumerates of text style type. - * @param style Indicates source of comparison OH_Drawing_TextStyle object. - * @param comparedStyle Indicates comparison OH_Drawing_TextStyle object. + * @param style Indicates enumerates of text style type. + * @param comparedStyle Indicates source of comparison OH_Drawing_TextStyle object. + * @param textStyleType Indicates comparison OH_Drawing_TextStyle object. * @return Match attributes result. * @since 12 * @version 1.0 @@ -2392,7 +2418,7 @@ bool OH_Drawing_TextStyleIsAttributeMatched(const OH_Drawing_TextStyle* style, * @brief Set placeholder of TextStyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @since 12 * @version 1.0 */ @@ -2402,7 +2428,7 @@ void OH_Drawing_TextStyleSetPlaceholder(OH_Drawing_TextStyle* style); * @brief Gets whether placeholder is enable. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return Whether placeholder is enable. * @since 12 * @version 1.0 @@ -2413,7 +2439,7 @@ bool OH_Drawing_TextStyleIsPlaceholder(OH_Drawing_TextStyle* style); * @brief Gets text alignment mode. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. * @return Returns text alignment mode. * @since 12 * @version 1.0 @@ -2424,7 +2450,7 @@ OH_Drawing_TextAlign OH_Drawing_TypographyStyleGetEffectiveAlignment(OH_Drawing_ * @brief Gets whether the hinting is enabled. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. * @return True, if the hinting takes effect; False, if the hinting does not take effect. * @since 12 * @version 1.0 @@ -2435,7 +2461,7 @@ bool OH_Drawing_TypographyStyleIsHintEnabled(OH_Drawing_TypographyStyle* style); * @brief Gets system font configuration information. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontConfigInfoErrorCode Indicates error code returned, based on the error code to + * @param errorCode Indicates error code returned, based on the error code to * release the memory of system font configuration information. * For details, see the enum OH_Drawing_FontConfigInfoErrorCode. * @return Returns a pointer to system font configuration information. @@ -2443,49 +2469,49 @@ bool OH_Drawing_TypographyStyleIsHintEnabled(OH_Drawing_TypographyStyle* style); * @since 12 * @version 1.0 */ -OH_Drawing_FontConfigInfo* OH_Drawing_GetSystemFontConfigInfo(OH_Drawing_FontConfigInfoErrorCode*); +OH_Drawing_FontConfigInfo* OH_Drawing_GetSystemFontConfigInfo(OH_Drawing_FontConfigInfoErrorCode* errorCode); /** * @brief Releases the memory occupied by system font configuration information. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontConfigInfo Indicates the pointer to an OH_Drawing_FontConfigInfo object. + * @param drawFontCfgInfo Indicates the pointer to an OH_Drawing_FontConfigInfo object. * @since 12 * @version 1.0 */ -void OH_Drawing_DestroySystemFontConfigInfo(OH_Drawing_FontConfigInfo*); +void OH_Drawing_DestroySystemFontConfigInfo(OH_Drawing_FontConfigInfo* drawFontCfgInfo); /** * @brief Sets the strut style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. - * @param OH_Drawing_StrutStyle Indicates the pointer of OH_Drawing_StrutStyle object. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param strutstyle Indicates the pointer of OH_Drawing_StrutStyle object. * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyStyleTextStrutStyle(OH_Drawing_TypographyStyle*, OH_Drawing_StrutStyle*); +void OH_Drawing_SetTypographyStyleTextStrutStyle(OH_Drawing_TypographyStyle* style, OH_Drawing_StrutStyle* strutstyle); /** * @brief Releases the memory occupied by an OH_Drawing_StrutStyle object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_StrutStyle Indicates the pointer of OH_Drawing_StrutStyle object. + * @param strutstyle Indicates the pointer of OH_Drawing_StrutStyle object. * @since 12 * @version 1.0 */ -void OH_Drawing_TypographyStyleDestroyStrutStyle(OH_Drawing_StrutStyle*); +void OH_Drawing_TypographyStyleDestroyStrutStyle(OH_Drawing_StrutStyle* strutstyle); /** * @brief Gets the strut style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. * @return Returns the pointer of OH_Drawing_StrutStyle object. * @since 12 * @version 1.0 */ -OH_Drawing_StrutStyle* OH_Drawing_TypographyStyleGetStrutStyle(OH_Drawing_TypographyStyle*); +OH_Drawing_StrutStyle* OH_Drawing_TypographyStyleGetStrutStyle(OH_Drawing_TypographyStyle* style); /** * @brief Overriding the struct StrutStyle equals operator. @@ -2502,7 +2528,7 @@ bool OH_Drawing_TypographyStyleStrutStyleEquals(OH_Drawing_StrutStyle* from, OH_ * @brief Sets the hinting of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. * @param hintsEnabled Indicates the hinting of text typography.. * @since 12 * @version 1.0 @@ -2526,21 +2552,21 @@ OH_Drawing_Font_Metrics* OH_Drawing_TypographyGetLineFontMetrics(OH_Drawing_Typo * @brief Free up all the space taken up by the lineFontMetric. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font_Metrics Indicates the first address of the lineFontMetric gather to be destroyed. + * @param lineFontMetric Indicates the first address of the lineFontMetric gather to be destroyed. * @since 12 * @version 1.0 */ -void OH_Drawing_TypographyDestroyLineFontMetrics(OH_Drawing_Font_Metrics*); +void OH_Drawing_TypographyDestroyLineFontMetrics(OH_Drawing_Font_Metrics* lineFontMetric); /** * @brief Mark the Typography as dirty, and initially state the Typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to the text OH_Drawing_Typography object. + * @param typography Indicates the pointer to the text OH_Drawing_Typography object. * @since 12 * @version 1.0 */ -void OH_Drawing_TypographyMarkDirty(OH_Drawing_Typography*); +void OH_Drawing_TypographyMarkDirty(OH_Drawing_Typography* typography); /** * @brief Get the unresolved Glyphs count of lines in a text. @@ -2557,64 +2583,64 @@ int32_t OH_Drawing_TypographyGetUnresolvedGlyphsCount(OH_Drawing_Typography*); * @brief Update the font size of lines in a text. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to the text OH_Drawing_Typography object. + * @param typography Indicates the pointer to the text OH_Drawing_Typography object. * @param from Indicates the source of the original font size. * @param to Indicates the destination of the updated font size. * @param fontSize Indicates the size of the font. * @since 12 * @version 1.0 */ -void OH_Drawing_TypographyUpdateFontSize(OH_Drawing_Typography*, size_t from, size_t to, float fontSize); +void OH_Drawing_TypographyUpdateFontSize(OH_Drawing_Typography* typography, size_t from, size_t to, float fontSize); /** * @brief Get whether the text layout enables line styles. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to the text OH_Drawing_TypographyStyle object. + * @param style Indicates the pointer to the text OH_Drawing_TypographyStyle object. * @return Whether or not to enable line styles in text layout only, true means enable, false means disable. * @since 12 * @version 1.0 */ -bool OH_Drawing_TypographyTextGetLineStyle(OH_Drawing_TypographyStyle*); +bool OH_Drawing_TypographyTextGetLineStyle(OH_Drawing_TypographyStyle* style); /** * @brief Get the font weight of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Return the font weight of line style for text typography. * For details, see the enum OH_Drawing_FontWeight. * @since 12 * @version 1.0 */ -OH_Drawing_FontWeight OH_Drawing_TypographyTextlineStyleGetFontWeight(OH_Drawing_TypographyStyle*); +OH_Drawing_FontWeight OH_Drawing_TypographyTextlineStyleGetFontWeight(OH_Drawing_TypographyStyle* style); /** * @brief Get the font style of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Return the font style of line style for text typography. * For details, see the enum OH_Drawing_FontStyle. * @since 12 * @version 1.0 */ -OH_Drawing_FontStyle OH_Drawing_TypographyTextlineStyleGetFontStyle(OH_Drawing_TypographyStyle*); +OH_Drawing_FontStyle OH_Drawing_TypographyTextlineStyleGetFontStyle(OH_Drawing_TypographyStyle* style); /** * @brief Get the font families of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @param num The number of obtained font names. * @return Return the font families of line style for text typography. * @since 12 * @version 1.0 */ -char** OH_Drawing_TypographyTextlineStyleGetFontFamilies(OH_Drawing_TypographyStyle*, size_t* num); +char** OH_Drawing_TypographyTextlineStyleGetFontFamilies(OH_Drawing_TypographyStyle* style, size_t* num); /** * @brief Releases the memory occupied by a list of font families names. @@ -2631,99 +2657,99 @@ void OH_Drawing_TypographyTextlineStyleDestroyFontFamilies(char** fontFamilies, * @brief Get the font size of font size for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Return the font size of font size for text typography. * @since 12 * @version 1.0 */ -double OH_Drawing_TypographyTextlineStyleGetFontSize(OH_Drawing_TypographyStyle*); +double OH_Drawing_TypographyTextlineStyleGetFontSize(OH_Drawing_TypographyStyle* style); /** * @brief Get the font height scale in text layout. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Retrun the font height scale in text layout. * @since 12 * @version 1.0 */ -double OH_Drawing_TypographyTextlineStyleGetHeightScale(OH_Drawing_TypographyStyle*); +double OH_Drawing_TypographyTextlineStyleGetHeightScale(OH_Drawing_TypographyStyle* style); /** * @brief Get whether to enable font height for line styles in text layout only. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Whether or not to enable the font height for line styles in text layout only, * true means enable, false means disable. * @since 12 * @version 1.0 */ -bool OH_Drawing_TypographyTextlineStyleGetHeightOnly(OH_Drawing_TypographyStyle*); +bool OH_Drawing_TypographyTextlineStyleGetHeightOnly(OH_Drawing_TypographyStyle* style); /** * @brief Get the half leading of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Whether to enable the text line half leading style, true means enable, false means disable. * @since 12 * @version 1.0 */ -bool OH_Drawing_TypographyTextlineStyleGetHalfLeading(OH_Drawing_TypographyStyle*); +bool OH_Drawing_TypographyTextlineStyleGetHalfLeading(OH_Drawing_TypographyStyle* style); /** * @brief Get the spacing scale of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Return the spacing scale of line style for text typography. * @since 12 * @version 1.0 */ -double OH_Drawing_TypographyTextlineStyleGetSpacingScale(OH_Drawing_TypographyStyle*); +double OH_Drawing_TypographyTextlineStyleGetSpacingScale(OH_Drawing_TypographyStyle* style); /** * @brief Get whether only line style is enabled for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Returns whether only line style is enabled for text layout, true means it is enabled, * false means it is not. * @since 12 * @version 1.0 */ -bool OH_Drawing_TypographyTextlineGetStyleOnly(OH_Drawing_TypographyStyle*); +bool OH_Drawing_TypographyTextlineGetStyleOnly(OH_Drawing_TypographyStyle* style); /** * @brief Get the text alignment mode. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Return the text alignment mode. For details, see the enum OH_Drawing_TextAlign. * @since 12 * @version 1.0 */ -OH_Drawing_TextAlign OH_Drawing_TypographyGetTextAlign(OH_Drawing_TypographyStyle*); +OH_Drawing_TextAlign OH_Drawing_TypographyGetTextAlign(OH_Drawing_TypographyStyle* style); /** * @brief Get the text direction. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Return the text direction. For details, see the enum OH_Drawing_TextDirection. * @since 12 * @version 1.0 */ -OH_Drawing_TextDirection OH_Drawing_TypographyGetTextDirection(OH_Drawing_TypographyStyle*); +OH_Drawing_TextDirection OH_Drawing_TypographyGetTextDirection(OH_Drawing_TypographyStyle* style); /** * @brief Sets the maximum number of lines in a text. @@ -2741,13 +2767,13 @@ size_t OH_Drawing_TypographyGetTextMaxLines(OH_Drawing_TypographyStyle*); * @brief Get the ellipsis of lines in a text. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Return the ellipsis of lines in a text. * @since 12 * @version 1.0 */ -char* OH_Drawing_TypographyGetTextEllipsis(OH_Drawing_TypographyStyle*); +char* OH_Drawing_TypographyGetTextEllipsis(OH_Drawing_TypographyStyle* style); /** * @brief Releases the memory occupied by a list of Ellipsis names. @@ -2775,19 +2801,19 @@ bool OH_Drawing_TypographyStyleEquals(OH_Drawing_TypographyStyle* from, OH_Drawi * @brief Releases the memory occupied by text box. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextBox Indicates the pointer to a text box object OH_Drawing_TextBox. + * @param textBox Indicates the pointer to a text box object OH_Drawing_TextBox. * @since 12 * @version 1.0 */ -void OH_Drawing_TypographyDestroyTextBox(OH_Drawing_TextBox*); +void OH_Drawing_TypographyDestroyTextBox(OH_Drawing_TextBox* textBox); /** * @brief Sets the parameter of text-shadow. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextShadow Indicates the pointer to an OH_Drawing_TextShadow object. + * @param shadow Indicates the pointer to an OH_Drawing_TextShadow object. * @param color Indicates the color setting of text-shadow. - * @param OH_Drawing_Point Indicates the pointer to an OH_Drawing_Point object. + * @param offset Indicates the pointer to an OH_Drawing_Point object. * @param blurRadius Indicates the radius of blur for text-shadow. * @since 12 * @version 1.0 @@ -2799,9 +2825,9 @@ void OH_Drawing_SetTextShadow(OH_Drawing_TextShadow* shadow, uint32_t color, OH_ * @brief Creates an OH_Drawing_TextTab object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextAlign Indicates enumerates text tab alignment modes. TAB alignment, Support left alignment + * @param alignment Indicates enumerates text tab alignment modes. TAB alignment, Support left alignment * right alignment center alignment, other enumeration values are left alignment effect. - * @param float Indicates location of text tab. + * @param location Indicates location of text tab. * @return Returns the pointer to the OH_Drawing_TextTab object created. If the object returns NULL, * the creation failed. The possible cause of the failure is that the application address space is used up. * As a result, space cannot be allocated. @@ -2814,33 +2840,33 @@ OH_Drawing_TextTab* OH_Drawing_CreateTextTab(OH_Drawing_TextAlign alignment, flo * @brief Releases the memory occupied by an OH_Drawing_TextTab object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextTab Indicates the pointer to an OH_Drawing_TextTab object. + * @param tab Indicates the pointer to an OH_Drawing_TextTab object. * @since 14 * @version 1.0 */ -void OH_Drawing_DestroyTextTab(OH_Drawing_TextTab*); +void OH_Drawing_DestroyTextTab(OH_Drawing_TextTab* tab); /** * @brief Get alignment of an OH_Drawing_TextTab object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextTab Indicates the pointer to an OH_Drawing_TextTab object. + * @param tab Indicates the pointer to an OH_Drawing_TextTab object. * @return Returns align of an OH_Drawing_TextTab object. * @since 14 * @version 1.0 */ -OH_Drawing_TextAlign OH_Drawing_GetTextTabAlignment(OH_Drawing_TextTab*); +OH_Drawing_TextAlign OH_Drawing_GetTextTabAlignment(OH_Drawing_TextTab* tab); /** * @brief Get location of an OH_Drawing_TextTab object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextTab Indicates the pointer to an OH_Drawing_TextTab object. + * @param tab Indicates the pointer to an OH_Drawing_TextTab object. * @return Returns location of an OH_Drawing_TextTab object. * @since 14 * @version 1.0 */ -float OH_Drawing_GetTextTabLocation(OH_Drawing_TextTab*); +float OH_Drawing_GetTextTabLocation(OH_Drawing_TextTab* tab); /** * @brief Sets the text tab of OH_Drawing_TypographyStyle object. @@ -2849,12 +2875,12 @@ float OH_Drawing_GetTextTabLocation(OH_Drawing_TextTab*); * And all tabs in the paragraph after the setting are aligned according to this tab effect. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. - * @param OH_Drawing_TextTab Indicates the pointer to an OH_Drawing_TextTab object. + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param tab Indicates the pointer to an OH_Drawing_TextTab object. * @since 14 * @version 1.0 */ -void OH_Drawing_SetTypographyTextTab(OH_Drawing_TypographyStyle*, OH_Drawing_TextTab* TextTab); +void OH_Drawing_SetTypographyTextTab(OH_Drawing_TypographyStyle* style, OH_Drawing_TextTab* tab); /** * @brief Get DrawingArray size. -- Gitee From 57e5314f13ecdc22e7fb5adbe4e6c441d993da7e Mon Sep 17 00:00:00 2001 From: Gavin Date: Tue, 19 Nov 2024 14:20:16 +0800 Subject: [PATCH 433/620] fix:add getMimeTypes interface json Signed-off-by: Gavin --- distributeddatamgr/pasteboard/libpasteboard.ndk.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/distributeddatamgr/pasteboard/libpasteboard.ndk.json b/distributeddatamgr/pasteboard/libpasteboard.ndk.json index 829a3ba45..c47c8a475 100644 --- a/distributeddatamgr/pasteboard/libpasteboard.ndk.json +++ b/distributeddatamgr/pasteboard/libpasteboard.ndk.json @@ -54,5 +54,9 @@ { "first_introduced": "13", "name": "OH_Pasteboard_ClearData" + }, + { + "first_introduced": "14", + "name": "OH_Pasteboard_GetMimeTypes" } ] \ No newline at end of file -- Gitee From 46b7861dfbfe9b520a7f9cf9665a417cd5817862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E4=BC=9F?= Date: Tue, 19 Nov 2024 07:21:47 +0000 Subject: [PATCH 434/620] update backgroundtasks/transient/include/transient_task_api.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 胡伟 --- .../transient/include/transient_task_api.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/backgroundtasks/transient/include/transient_task_api.h b/backgroundtasks/transient/include/transient_task_api.h index 74b467dc6..874e64734 100644 --- a/backgroundtasks/transient/include/transient_task_api.h +++ b/backgroundtasks/transient/include/transient_task_api.h @@ -13,13 +13,6 @@ * limitations under the License. */ -#ifndef OHOS_BACKGROUOND_TASK_MANAGER_TRANSIENT_TASK_API_H -#define OHOS_BACKGROUOND_TASK_MANAGER_TRANSIENT_TASK_API_H - -#include - -#include "transient_task_type.h" - /** * @addtogroup TransientTask * @{ @@ -41,6 +34,13 @@ * @since 13 */ +#ifndef OHOS_BACKGROUOND_TASK_MANAGER_TRANSIENT_TASK_API_H +#define OHOS_BACKGROUOND_TASK_MANAGER_TRANSIENT_TASK_API_H + +#include + +#include "transient_task_type.h" + #ifdef __cplusplus extern "C" { #endif -- Gitee From 85b12aea56979c910d78f0250f46bb521f6cad80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E4=BC=9F?= Date: Tue, 19 Nov 2024 07:22:22 +0000 Subject: [PATCH 435/620] update backgroundtasks/transient/include/transient_task_type.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 胡伟 --- backgroundtasks/transient/include/transient_task_type.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backgroundtasks/transient/include/transient_task_type.h b/backgroundtasks/transient/include/transient_task_type.h index 6ddd4dbfa..7a19adf75 100644 --- a/backgroundtasks/transient/include/transient_task_type.h +++ b/backgroundtasks/transient/include/transient_task_type.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OHOS_BACKGROUOND_TASK_MANAGER_TRANSIENT_TASK_TYPE_H -#define OHOS_BACKGROUOND_TASK_MANAGER_TRANSIENT_TASK_TYPE_H - /** * @addtogroup TransientTask * @{ @@ -36,6 +33,9 @@ * @since 11 */ +#ifndef OHOS_BACKGROUOND_TASK_MANAGER_TRANSIENT_TASK_TYPE_H +#define OHOS_BACKGROUOND_TASK_MANAGER_TRANSIENT_TASK_TYPE_H + #include #ifdef __cplusplus -- Gitee From dd7407df60f67a4451a599b18cc6a9c0049e6654 Mon Sep 17 00:00:00 2001 From: shilong Date: Tue, 19 Nov 2024 07:50:02 +0000 Subject: [PATCH 436/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9USB=5FDDK=5FIO=5FFAIL?= =?UTF-8?q?ED=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- drivers/external_device_manager/usb/usb_ddk_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/external_device_manager/usb/usb_ddk_types.h b/drivers/external_device_manager/usb/usb_ddk_types.h index 0b582335e..a0cb5e5b1 100644 --- a/drivers/external_device_manager/usb/usb_ddk_types.h +++ b/drivers/external_device_manager/usb/usb_ddk_types.h @@ -308,7 +308,7 @@ typedef enum { USB_DDK_MEMORY_ERROR = 27400001, /** @error Invalid operation. */ USB_DDK_INVALID_OPERATION = 27400002, - /** @error I/O error. */ + /** @error Device I/O operation failed. */ USB_DDK_IO_FAILED = 27400003, /** @error Transmission timeout. */ USB_DDK_TIMEOUT = 27400004, -- Gitee From 2059cd7de7f1aadab893576e920d8c380c82dd7e Mon Sep 17 00:00:00 2001 From: liujiaxing19 Date: Tue, 19 Nov 2024 16:09:24 +0800 Subject: [PATCH 437/620] =?UTF-8?q?hiAppEvent=E6=8E=A5=E5=8F=A3APILint?= =?UTF-8?q?=E6=95=B4=E6=94=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liujiaxing19 Change-Id: I12b1a9598e687e45cbbde587a5f730fe1f7b5016 --- hiviewdfx/hiappevent/include/hiappevent/hiappevent.h | 6 +++--- hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h | 6 +++--- hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h | 6 +++--- hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h index e3c82e39f..26a001799 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h @@ -23,9 +23,6 @@ * events reported during running. Based on event information, you will be able to analyze the running status of * applications. * - * @kit PerformanceAnalysisKit - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * * @since 8 * @version 1.0 */ @@ -69,6 +66,9 @@ * OH_HiAppEvent_DestroyParamList(list); * * + * @kit PerformanceAnalysisKit + * @library libhiappevent_ndk.z.so + * @syscap SystemCapability.HiviewDFX.HiAppEvent * @since 8 * @version 1.0 */ diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h index 1c0a4cb6b..eb5719955 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h @@ -23,9 +23,6 @@ * events reported during running. Based on event information, you will be able to analyze the running status of * applications. * - * @kit PerformanceAnalysisKit - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * * @since 8 * @version 1.0 */ @@ -42,6 +39,9 @@ * bool res = OH_HiAppEvent_Configure(MAX_STORAGE, "100M"); * * + * @kit PerformanceAnalysisKit + * @library libhiappevent_ndk.z.so + * @syscap SystemCapability.HiviewDFX.HiAppEvent * @since 8 * @version 1.0 */ diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h index 59a5aabe5..bfcad3409 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h @@ -23,9 +23,6 @@ * events reported during running. Based on event information, you will be able to analyze the running status of * applications. * - * @kit PerformanceAnalysisKit - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * * @since 8 * @version 1.0 */ @@ -45,6 +42,9 @@ * OH_HiAppEvent_DestroyParamList(list); * * + * @kit PerformanceAnalysisKit + * @library libhiappevent_ndk.z.so + * @syscap SystemCapability.HiviewDFX.HiAppEvent * @since 8 * @version 1.0 */ diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h index 5f9c10cb1..683bdabc2 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h @@ -23,9 +23,6 @@ * events reported during running. Based on event information, you will be able to analyze the running status of * applications. * - * @kit PerformanceAnalysisKit - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * * @since 8 * @version 1.0 */ @@ -45,6 +42,9 @@ * OH_HiAppEvent_DestroyParamList(list); * * + * @kit PerformanceAnalysisKit + * @library libhiappevent_ndk.z.so + * @syscap SystemCapability.HiviewDFX.HiAppEvent * @since 8 * @version 1.0 */ -- Gitee From d4b2872c11cbf91b6ec0edf9e1cdd67e128440e3 Mon Sep 17 00:00:00 2001 From: suwanghw Date: Tue, 19 Nov 2024 19:39:54 +0800 Subject: [PATCH 438/620] Delete tee kit api Signed-off-by: suwanghw --- tee/BUILD.gn | 74 -- tee/include/oemkey.h | 65 -- tee/include/pthread_attr.h | 52 -- tee/include/rpmb_driver_rw_api.h | 298 ------- tee/include/rpmb_fcntl.h | 297 ------- tee/include/tee_arith_api.h | 578 -------------- tee/include/tee_client_api.h | 245 ------ tee/include/tee_client_constants.h | 227 ------ tee/include/tee_client_type.h | 212 ----- tee/include/tee_core_api.h | 124 --- tee/include/tee_crypto_api.h | 1045 ------------------------- tee/include/tee_crypto_hal.h | 93 --- tee/include/tee_defines.h | 607 -------------- tee/include/tee_drv_client.h | 96 --- tee/include/tee_dynamic_srv.h | 134 ---- tee/include/tee_ext_api.h | 209 ----- tee/include/tee_hw_ext_api.h | 92 --- tee/include/tee_hw_ext_api_legacy.h | 123 --- tee/include/tee_internal_se_api.h | 498 ------------ tee/include/tee_log.h | 290 ------- tee/include/tee_mem_mgmt_api.h | 231 ------ tee/include/tee_mem_monitoring_api.h | 64 -- tee/include/tee_object_api.h | 384 --------- tee/include/tee_property_api.h | 266 ------- tee/include/tee_rtc_time_api.h | 117 --- tee/include/tee_service_public.h | 159 ---- tee/include/tee_sharemem_ops.h | 128 --- tee/include/tee_time_api.h | 131 ---- tee/include/tee_trusted_storage_api.h | 410 ---------- tee/include/tee_tui_gp_api.h | 454 ----------- tee/libteec.ndk.json | 11 - 31 files changed, 7714 deletions(-) delete mode 100644 tee/BUILD.gn delete mode 100644 tee/include/oemkey.h delete mode 100644 tee/include/pthread_attr.h delete mode 100644 tee/include/rpmb_driver_rw_api.h delete mode 100644 tee/include/rpmb_fcntl.h delete mode 100644 tee/include/tee_arith_api.h delete mode 100644 tee/include/tee_client_api.h delete mode 100644 tee/include/tee_client_constants.h delete mode 100644 tee/include/tee_client_type.h delete mode 100644 tee/include/tee_core_api.h delete mode 100644 tee/include/tee_crypto_api.h delete mode 100644 tee/include/tee_crypto_hal.h delete mode 100644 tee/include/tee_defines.h delete mode 100644 tee/include/tee_drv_client.h delete mode 100644 tee/include/tee_dynamic_srv.h delete mode 100644 tee/include/tee_ext_api.h delete mode 100644 tee/include/tee_hw_ext_api.h delete mode 100644 tee/include/tee_hw_ext_api_legacy.h delete mode 100644 tee/include/tee_internal_se_api.h delete mode 100644 tee/include/tee_log.h delete mode 100644 tee/include/tee_mem_mgmt_api.h delete mode 100644 tee/include/tee_mem_monitoring_api.h delete mode 100644 tee/include/tee_object_api.h delete mode 100644 tee/include/tee_property_api.h delete mode 100644 tee/include/tee_rtc_time_api.h delete mode 100644 tee/include/tee_service_public.h delete mode 100644 tee/include/tee_sharemem_ops.h delete mode 100644 tee/include/tee_time_api.h delete mode 100644 tee/include/tee_trusted_storage_api.h delete mode 100644 tee/include/tee_tui_gp_api.h delete mode 100644 tee/libteec.ndk.json diff --git a/tee/BUILD.gn b/tee/BUILD.gn deleted file mode 100644 index a04ca0b3a..000000000 --- a/tee/BUILD.gn +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/ohos.gni") - -ohos_ndk_library("libteec") { - output_name = "teec" - output_extension = "so" - ndk_description_file = "./libteec.ndk.json" - min_compact_version = "12" - system_capability = "SystemCapability.Tee.TeeClient" - system_capability_headers = [ - "./include/tee_client_api.h", - "./include/tee_client_constants.h", - "./include/tee_client_type.h", - ] -} - -ohos_ndk_headers("libtee_header") { - dest_dir = "$ndk_headers_out_dir/tee" - sources = [ - "./include/oemkey.h", - "./include/rpmb_driver_rw_api.h", - "./include/rpmb_fcntl.h", - "./include/tee_arith_api.h", - "./include/tee_core_api.h", - "./include/tee_crypto_api.h", - "./include/tee_crypto_hal.h", - "./include/tee_defines.h", - "./include/tee_drv_client.h", - "./include/tee_dynamic_srv.h", - "./include/tee_ext_api.h", - "./include/tee_hw_ext_api.h", - "./include/tee_hw_ext_api_legacy.h", - "./include/tee_internal_se_api.h", - "./include/tee_log.h", - "./include/tee_mem_mgmt_api.h", - "./include/tee_mem_monitoring_api.h", - "./include/tee_object_api.h", - "./include/tee_property_api.h", - "./include/tee_rtc_time_api.h", - "./include/tee_service_public.h", - "./include/tee_sharemem_ops.h", - "./include/tee_time_api.h", - "./include/tee_trusted_storage_api.h", - "./include/tee_tui_gp_api.h", - ] -} - -ohos_ndk_headers("libteec_header") { - dest_dir = "$ndk_headers_out_dir/tee_client" - sources = [ - "./include/tee_client_api.h", - "./include/tee_client_constants.h", - "./include/tee_client_type.h", - ] -} - -group("tee_ndk_header") { - deps = [ - ":libtee_header", - ":libteec_header", - ] -} diff --git a/tee/include/oemkey.h b/tee/include/oemkey.h deleted file mode 100644 index dc2e3daeb..000000000 --- a/tee/include/oemkey.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OEMKEY_H -#define OEMKEY_H -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file oemkey.h - * - * @brief Provides the method for obtaining the hardware provision key. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif -/** - * @brief Obtains the provision key. - * - * @param oem_key Indicates the pointer to the buffer for storing the provision key. - * @param key_size Indicates the length of the buffer used to store the provision key, which is 16. - * - * @return Returns 0 if the operation is successful. - * @return Returns other values otherwise. - * - * @since 12 - */ -uint32_t tee_hal_get_provision_key(uint8_t *oem_key, size_t key_size); - -#ifdef __cplusplus -} -#endif - -/** @} */ -#endif diff --git a/tee/include/pthread_attr.h b/tee/include/pthread_attr.h deleted file mode 100644 index d7753593d..000000000 --- a/tee/include/pthread_attr.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PTHREAD_ATTR_H -#define PTHREAD_ATTR_H -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file pthread_attr.h - * - * @brief Provides the attr about TA multi-thread. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#define TEESMP_THREAD_ATTR_CA_WILDCARD 0 - -#define TEESMP_THREAD_ATTR_CA_INHERIT (-1U) - -#define TEESMP_THREAD_ATTR_TASK_ID_INHERIT (-1U) - -#define TEESMP_THREAD_ATTR_HAS_SHADOW 0x1 - -#define TEESMP_THREAD_ATTR_NO_SHADOW 0x0 - -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/rpmb_driver_rw_api.h b/tee/include/rpmb_driver_rw_api.h deleted file mode 100644 index 4c96f222e..000000000 --- a/tee/include/rpmb_driver_rw_api.h +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef RPMB_DRIVER_RW_API_H -#define RPMB_DRIVER_RW_API_H -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file rpmb_driver_rw_api.h - * - * @brief APIs related to RPMB driver read and write. - * Provides the function of reading and writing RPMB driver. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Defines the total block number. - * - * @since 12 - * @version 1.0 - */ -#define TOTAL_BLK 4 - -/** - * @brief Defines the size of block. - * - * @since 12 - * @version 1.0 - */ -#define BLK_SIZE 256 - -/** - * @brief Defines the size of the total block. - * - * @since 12 - * @version 1.0 - */ -#define TOTAL_BLK_SIZE (TOTAL_BLK * BLK_SIZE) - -#define SEC_WRITE_PROTECT_ENTRY_NUM 4 -#define SEC_WRITE_PROTECT_ENTRY_RESERVED_NUM 3 -#define SEC_WRITE_PROTECT_ENTRY_RESERVED_SIZE 16 -#define SEC_WRITE_PROTECT_FRAME_RESERVED_NUM 14 -#define SEC_WRITE_PROTECT_FRAME_RESERVED_END_NUM 176 -#define SEC_WRITE_PROTECT_BLK_SIZE 256 -#define SEC_WRITE_PROTECT_LUN_MAX 5 - -/** - * @brief A WPF set to one specifies that the logical unit shall inhibit alteration of the medium for LBA within - * the range indicated by LOGICAL BLOCK ADDRESS field and NUMBER OF LOGICAL BLOCKS field. - * Commands requiring writes to the medium shall be terminated with CHECK CONDITION status, - * with the sense key set to DATA PROTECT, and the additional sense code set to WRITE PROTECTED. - * - * @since 12 - * @version 1.0 - */ -typedef enum { - SEC_WRITE_PROTECT_DISABLE = 0, - SEC_WRITE_PROTECT_ENABLE = 1, -} write_protect_flag; - -/** - * @brief Write Protect Type specifies how WPF bit may be modified. - * - * @since 12 - * @version 1.0 - */ -typedef enum { - /** WPF bit is persistent through power cycle and hardware reset. - * WPF value may only be changed writing to Secure Write Protect Configuration Block. - */ - NV_TYPE = 0, - /** WPF bit is automatically cleared to 0b after power cycle or hardware reset. */ - P_TYPE = 1, - /** WPF bit is automatically set to 1b after power cycle or hardware reset. */ - NV_AWP_TYPE = 2, -} write_protect_type; - -/** - * @brief Secure Write Protect Entry. - * +-----+---+---+---+---+---+---+---+----+ - * | | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | - * +-----+---+---+---+---+---+---+---+----+ - * | 0 | Reserved | WFT | WPF| -> wp_data - * +-----+---+---+---+---+---+---+---+----+ - * | 1 | Reserved | - * +-----+---+---+---+---+---+---+---+----+ - * | 2 | Reserved | - * +-----+---+---+---+---+---+---+---+----+ - * | 3 | Reserved | - * +-----+---+---+---+---+---+---+---+----+ - * | 4 | LOGICAL BLOCK ADDRESS | -> logical_blk_addr - * +-----+ + - * | ... | | - * +-----+ + - * | 11 | | - * +-----+ + - * | 12 | | - * +-----+---+---+---+---+---+---+---+----+ - * | ... | NUMBER OF LOGICAL BLOCKS | -> logical_blk_num - * +-----+---+---+---+---+---+---+---+----+ - * | 15 | | - * +-----+---+---+---+---+---+---+---+----+ - * - * @since 12 - * @version 1.0 - */ -struct rpmb_protect_cfg_blk_entry { - uint8_t wp_data; - uint8_t reserved[SEC_WRITE_PROTECT_ENTRY_RESERVED_NUM]; - /** This field specifies the LBA of the first logical address of the Secure Write Protect ares. */ - uint64_t logical_blk_addr; - /** This field specifies the number of contiguous logical size that belong to the Secure Write Protect. */ - uint32_t logical_blk_num; -}__attribute__((packed)); - - -/** - * @brief Secure Write Protect Configuration Block is supported by RPMB region 0 only. - * This block is used for configuring secure write protect areas in logical units. - * Each Secure Write Protect Configuration Block for each logical unit. - * Each entry represents one secure write protect area. - * If an entry is not used, then the related fields shall contain a value of zero. - * +-----+---+---+---+---+---+---+---+----+ - * | | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | - * +-----+---+---+---+---+---+---+---+----+ - * | 0 | LUN | - * +-----+---+---+---+---+---+---+---+----+ - * | 1 | DATA LENGTH | - * +-----+---+---+---+---+---+---+---+----+ - * | 2 | | - * +-----+ + - * | ... | Reserved | - * +-----+ + - * | 15 | | - * +-----+---+---+---+---+---+---+---+----+ - * | 16 | | - * +-----+ + - * | ... | Secure Write Protect Entry 0 | - * +-----+ + - * | 31 | | - * +-----+---+---+---+---+---+---+---+----+ - * | 32 | | - * +-----+ + - * | ... | Secure Write Protect Entry 1 | - * +-----+ + - * | 47 | | - * +-----+---+---+---+---+---+---+---+----+ - * | 48 | | - * +-----+ + - * | ... | Secure Write Protect Entry 1 | - * +-----+ + - * | 63 | | - * +-----+---+---+---+---+---+---+---+----+ - * | 64 | | - * +-----+ + - * | ... | Secure Write Protect Entry 1 | - * +-----+ + - * | 79 | | - * +-----+---+---+---+---+---+---+---+----+ - * | 80 | | - * +-----+ + - * | ... | Reserved | - * +-----+ + - * | 255 | | - * +-----+---+---+---+---+---+---+---+----+ - * - * @since 12 - * @version 1.0 - */ -struct rpmb_protect_cfg_block { - uint8_t lun; - uint8_t data_length; - uint8_t reserved[SEC_WRITE_PROTECT_FRAME_RESERVED_NUM]; - struct rpmb_protect_cfg_blk_entry entries[SEC_WRITE_PROTECT_ENTRY_NUM]; - uint8_t reserved_end[SEC_WRITE_PROTECT_FRAME_RESERVED_END_NUM]; -}__attribute__((packed)); - -/** - * @brief Write protect config block by RPMB driver. - * - * @param lun Indicates the logical unit to which secure write protection shall apply, - * and 0 <= lun <= {@code SEC_WRITE_PROTECT_LUN_MAX} - * @param entries Indicates the Secure Write Protect Entry array, The maximum length is 4. - * @param len Indicates the real length of the Secure Write Protect Entry array, which value is less than 4. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if the input parameter is incorrect. - * Returns {@code TEE_ERROR_OUT_OF_MEMORY} if the send message fail. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_rpmb_protect_cfg_blk_write(uint8_t lun, struct rpmb_protect_cfg_blk_entry *entries, uint32_t len); - -/** - * @brief Read protect config block by RPMB driver. - * - * @param lun Indicates the logical unit to which secure read protection shall apply, - * and 0 <= lun <= SEC_WRITE_PROTECT_LUN_MAX. - * @param entries Indicates the Secure Read Protect Entry array, The maximum length is 4. - * @param len Indicates the real length of the Secure Read Protect Entry array, which value is less than 4. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if the input parameter is incorrect. - * Returns {@code TEE_ERROR_OUT_OF_MEMORY} if the send message fail. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_rpmb_protect_cfg_blk_read(uint8_t lun, struct rpmb_protect_cfg_blk_entry *entries, uint32_t *len); - -/** - * @brief Write plaintext buffer to RPMB driver. - * - * @param buf Indicates the buffer for writing data. - * @param size Indicates the length of buffer, the maximum value is 1024. - * @param block Indicates the block index of the position of start block, the value is [0, 3]. - * @param offset Indicates the offset bytes of data position, and the value of offest bytes is less than 256. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if the input parameter is incorrect. - * Returns {@code TEE_ERROR_OUT_OF_MEMORY} if the send message fail. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_rpmb_driver_write(const uint8_t *buf, size_t size, uint32_t block, uint32_t offset); - -/** - * @brief Read plaintext buffer from RPMB driver. - * - * @param buf Indicates the buffer for read data. - * @param size Indicates the length of buffer, the maximum value is 1024. - * @param block Indicates the block index of the position of start block, the value is [0, 3]. - * @param offset Indicates the offset bytes of data position, and the value of offest bytes is less than 256. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if the input parameter is incorrect. - * Returns {@code TEE_ERROR_OUT_OF_MEMORY} if the send message fail. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_rpmb_driver_read(uint8_t *buf, size_t size, uint32_t block, uint32_t offset); - -/** - * @brief Remove data from RPMB driver. - * - * @param size Indicates the length of remove data, the maximum value is 1024. - * @param block Indicates the block index of the position of start block, the value is [0, 3]. - * @param offset Indicates the offset bytes of data position, and the value of offest bytes is less than 256. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if the input parameter is incorrect. - * Returns {@code TEE_ERROR_OUT_OF_MEMORY} if the send message fail. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_rpmb_driver_remove(size_t size, uint32_t block, uint32_t offset); - -#ifdef __cplusplus -} -#endif - -/** @} */ -#endif diff --git a/tee/include/rpmb_fcntl.h b/tee/include/rpmb_fcntl.h deleted file mode 100644 index bc38160d7..000000000 --- a/tee/include/rpmb_fcntl.h +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef RPMB_RPMB_FCNTL_H -#define RPMB_RPMB_FCNTL_H -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file rpmb_fcntl.h - * - * @brief Provides the APIs related to RPMB service. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Partition initialization, perform RPMB Key writing and formatting operations. - * - * @attention This function only needs to be executed once. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_RPMB_GENERIC} if the RPMB controller general error. - * Returns {@code TEE_ERROR_RPMB_MAC_FAIL} if the RPMB controller MAC check error. - * Returns {@code TEE_ERROR_RPMB_RESP_UNEXPECT_MAC} if the RPMB response data MAC check error. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Init(void); - -/** - * @brief RPMB secure storage fully formatted operation. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_RPMB_GENERIC} if the RPMB controller general error. - * Returns {@code TEE_ERROR_RPMB_MAC_FAIL} if the RPMB controller MAC check error. - * Returns {@code TEE_ERROR_RPMB_RESP_UNEXPECT_MAC} if the RPMB response data MAC check error. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Format(void); - -/** - * @brief Write files to RPMB. - * - * @attention If you want to improve the performance of writing files, you need to define the heap size in TA's - * manifest to be at leaset 3 times the file size plus 256KB. - * For example: To write a file with a size of 100KB, the defined heap size is at least - * 556KB (3 * 100 + 256). If the heap size cannot be satisfied, the file writing will still succeed, - * but the performance will be poor. - * - * @param filename Indicates the file name of the data to be written, the maximum length is 64 bytes. - * @param buf Indicates the buffer for writting data. - * @param size Indicates the size of the written data, the maximum size is 160KB. - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect, or the file name is longer than 64 - * bytes. - * Returns {@code TEE_ERROR_RPMB_NOSPC} if the RPMB partition has insufficient disk space. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Write(const char *filename, const uint8_t *buf, size_t size); - -/** - * @brief Read files from RPMB. - * - * @attention If you want to improve the performance of reading files, you need to define the heap size in TA's - * manifest to be at leaset 3 times the file size plus 256KB. - * For example: To read a file with a size of 100KB, the defined heap size is at least - * 556KB (3 * 100 + 256). If the heap size cannot be satisfied, the file reading will still succeed, - * but the performance will be poor. - * - * @param filename Indicates the file name of the data to be read, the maximum length is 64 bytes. - * @param buf Indicates the buffer for reading data. - * @param size Indicates the read data size. - * @param count Indicates the size of the actual read. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect, or the file name is longer than 64 - * bytes. - * Returns {@code TEE_ERROR_RPMB_FILE_NOT_FOUND} if the file dose not exist. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Read(const char *filename, uint8_t *buf, size_t size, uint32_t *count); - -/** - * @brief Rename file name in RPMB. - * - * @param old_name Indicates the old file name. - * @param new_name Indicates the new file name. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect, or the file name is longer than 64 - * bytes. - * Returns {@code TEE_ERROR_RPMB_FILE_NOT_FOUND} if the file dose not exist. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Rename(const char *old_name, const char *new_name); - -/** - * @brief Delete files in RPMB. - * - * @param filename Indicates the file name to be deleted. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect, or the file name is longer than 64 - * bytes. - * Returns {@code TEE_ERROR_RPMB_FILE_NOT_FOUND} if the file dose not exist. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Rm(const char *filename); - -/** - * @brief File status stored in RPMB partition, used in {@code TEE_RPMB_FS_Stat}. - * - * @since 12 - */ -struct rpmb_fs_stat { - /** Indicates the file size. */ - uint32_t size; - uint32_t reserved; -}; - -/** - * @brief Get file status in RPMB. - * - * @param filename Indicates the file name in RPMB. - * @param stat Indicates the file status information obtained. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect, or the file name is longer than 64 - * bytes. - * Returns {@code TEE_ERROR_RPMB_FILE_NOT_FOUND} if the file dose not exist. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Stat(const char *filename, struct rpmb_fs_stat *stat); - -/** - * @brief Disk status stored in RPMB partition, used in {@code TEE_RPMB_FS_StatDisk}. - * - * @since 12 - */ -struct rpmb_fs_statdisk { - /** Indicates the total size of RPMB partition. */ - uint32_t disk_size; - /** Indicates the TA used size. */ - uint32_t ta_used_size; - /** Indicates the free size of the RPMB partition. */ - uint32_t free_size; - uint32_t reserved; -}; - -/** - * @brief Get the disk status. - * - * @param stat Indicates the disk status information obtained. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_StatDisk(struct rpmb_fs_statdisk *stat); - -/** - * @brief File attribute definition, which means that the file cannot be erased during the factory reset. - * - * @since 12 -*/ -#define TEE_RPMB_FMODE_NON_ERASURE (1U << 0) - -/** - * @brief File attribute definition, which means the attribute value of the cleard file. - * - * @since 12 -*/ -#define TEE_RPMB_FMODE_CLEAR 0 - - -/** - * @brief Set the file attribute in RPMB. - * - * @param filename Indicates the file name in RPMB. - * @param fmode Indicates the file attribute, currently supports {@code TEE_RPMB_FMODE_NON_ERASURE} and - * {@code TEE_RPMB_FMODE_CLEAR} two attributes, other values will return {@code TEE_ERROR_BAD_PARAMETERS}. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect, - * or the file name is longer than 64 bytes. - * Returns {@code TEE_ERROR_RPMB_FILE_NOT_FOUND} if the file dose not exist. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_SetAttr(const char *filename, uint32_t fmode); - -/** - * @brief Format, delete file attribute is erasable file, keep the file attribute is an inerasable file. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_RPMB_GENERIC} if the RPMB controller general error. - * Returns {@code TEE_ERROR_RPMB_MAC_FAIL} if the RPMB controller MAC check error. - * Returns {@code TEE_ERROR_RPMB_RESP_UNEXPECT_MAC} if the RPMB response data MAC check error. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Erase(void); - -/** - * @brief Enumerates the types of RPMB key status, used in {@code TEE_RPMB_KEY_Status}. - * - * @since 12 -*/ -enum TEE_RPMB_KEY_STAT { - /** RPMB Key status is invalid. */ - TEE_RPMB_KEY_INVALID = 0x0, - /** RPMB Key has been programmed and matched correctly. */ - TEE_RPMB_KEY_SUCCESS, - /** RPMB Key is not programmed. */ - TEE_RPMB_KEY_NOT_PROGRAM, - /** RPMB Key has been programmed but failed to match. */ - TEE_RPMB_KEY_NOT_MATCH, -}; - -/** - * @brief Obtain RPMB Key status. - * - * @return Returns {@code TEE_RPMB_KEY_SUCCESS} if the RPMB Key has been programmed and matched correctly. - * Returns {@code TEE_RPMB_KEY_NOT_PROGRAM} if the RPMB Key is not programmed. - * Returns {@code TEE_RPMB_KEY_NOT_MATCH} if RPMB Key has been programmed but failed to match. - * Returns {@code TEE_RPMB_KEY_INVALID} if the RPMB Key status is invalid. - * - * @since 12 - * @version 1.0 - */ -uint32_t TEE_RPMB_KEY_Status(void); - -/** - * @brief Process the current TA version information. - * - * @param ta_version Indicates the TA version. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_GENERIC} if the processing failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_TAVERSION_Process(uint32_t ta_version); -#ifdef __cplusplus -} -#endif - -/** @} */ -#endif diff --git a/tee/include/tee_arith_api.h b/tee/include/tee_arith_api.h deleted file mode 100644 index b76c6eb37..000000000 --- a/tee/include/tee_arith_api.h +++ /dev/null @@ -1,578 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TEE_ARITH_API_H -#define TEE_ARITH_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_arith_api.h - * - * @brief Provides APIs for operating big integers. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef uint32_t TEE_BigInt; -typedef uint32_t TEE_BigIntFMM; -typedef uint32_t TEE_BigIntFMMContext; - -/** - * @brief Obtains the size of the array of uint32_t values required to represent a BigInt. - * - * @param n Indicates the TEE_BigInt type. - * - * @return Returns the BigInt size obtained. - * - * @since 12 - * @version 1.0 - */ -#define TEE_BigIntSizeInU32(n) ((((n) + 31) / 32) + 2) - -/** - * @brief Obtains the size of the array of uint32_t values. - * - * @param modulusSizeInBits Indicates the modulus size, in bits. - * - * @return Returns the number of bytes required to store a TEE_BigIntFMM, - * given a modulus of length modSizeInBits. - * - * @since 12 - * @version 1.0 - */ -size_t TEE_BigIntFMMSizeInU32(size_t modulusSizeInBits); - -/** - * @brief Obtains the size of an array of uint32_t values required to represent a fast modular context. - * - * @param modulusSizeInBits Indicates the modulus size, in bits. - * - * @return Returns the number of bytes required to store a TEE_BigIntFMMContext, - * given a modulus of length modSizeInBits. - * - * @since 12 - * @version 1.0 - */ -size_t TEE_BigIntFMMContextSizeInU32(size_t modulusSizeInBits); - -/** - * @brief Initializes a TEE_BigInt. - * - * @param bigInt Indicates the pointer to the TEE_BigInt to initialize. - * @param len Indicates the size of the memory pointed to by TEE_BigInt, in uint32_t. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntInit(TEE_BigInt *bigInt, size_t len); - -/** - * @brief Calculates the necessary prerequisites for fast modular multiplication and stores them in a context. - * - * @param context Indicates the pointer to the TEE_BigIntFMMContext to initialize. - * @param len Indicates the size of the memory pointed to by context, in uint32_t. - * @param modulus Indicates the pointer to the modulus. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntInitFMMContext(TEE_BigIntFMMContext *context, size_t len, const TEE_BigInt *modulus); - -/** - * @brief Calculates the necessary prerequisites for fast modular multiplication and stores them in a context. - * - * @param context Indicates the pointer to the TEE_BigIntFMMContext to initialize. - * @param len Indicates the size of the memory pointed to by context, in uint32_t. - * @param modulus Indicates the pointer to the modulus. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns other values if the operation fails. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntInitFMMContext1(TEE_BigIntFMMContext *context, size_t len, const TEE_BigInt *modulus); - -/** - * @brief Initializes a TEE_BigIntFMM and sets its represented value to zero. - * - * @param bigIntFMM Indicates the pointer to the TEE_BigIntFMM to initialize. - * @param len Indicates the size of the memory pointed to by bigIntFMM, in uint32_t. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntInitFMM(TEE_BigIntFMM *bigIntFMM, size_t len); - -/** - * @brief Converts an octet string buffer into the TEE_BigInt format. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result. - * @param buffer Indicates the pointer to the buffer that holds the octet string representation of the integer. - * @param bufferLen Indicates the buffer length, in bytes. - * @param sign Indicates the sign of dest, which is set to the sign of sign. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OVERFLOW if the memory allocated for dest is too small. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntConvertFromOctetString(TEE_BigInt *dest, const uint8_t *buffer, size_t bufferLen, int32_t sign); - -/** - * @brief Converts the absolute value of an integer in TEE_BigInt format into an octet string. - * - * @param buffer Indicates the pointer to the output buffer that holds the converted octet string representation - * of the integer. - * @param bufferLen Indicates the pointer to the buffer length, in bytes. - * @param bigInt Indicates the pointer to the integer to convert. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_SHORT_BUFFER if the output buffer is too small to hold the octet string. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntConvertToOctetString(void *buffer, size_t *bufferLen, const TEE_BigInt *bigInt); - -/** - * @brief Sets dest to the value shortVal. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result. - * @param shortVal Indicates the value to set. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntConvertFromS32(TEE_BigInt *dest, int32_t shortVal); - -/** - * @brief Sets dest to the value of src, including the sign of src. - * - * @param dest Indicates the pointer to the int32_t that holds the result. - * @param src Indicates the pointer to the value to set. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OVERFLOW if src does not fit within an int32_t. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntConvertToS32(int32_t *dest, const TEE_BigInt *src); - -/** - * @brief Checks whether op1 > op2, op1 == op2, or op1 < op2. - * - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * - * @return Returns 0 if op1 == op2. - * Returns a positive number if op1 > op2. - * - * @since 12 - * @version 1.0 - */ -int32_t TEE_BigIntCmp(const TEE_BigInt *op1, const TEE_BigInt *op2); - -/** - * @brief Checks whether op > shortVal, op == shortVal, or op < shortVal. - * - * @param op Indicates the pointer to the first operand. - * @param shortVal Indicates the pointer to the second operand. - * - * @return Returns 0 if op1 == shortVal. - * Returns a positive number if op1 > shortVal. - * - * @since 12 - * @version 1.0 - */ -int32_t TEE_BigIntCmpS32(const TEE_BigInt *op, int32_t shortVal); - -/** - * @brief Computes |dest| = |op| >> bits. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the shifted result. - * @param op Indicates the pointer to the operand to be shifted. - * @param bits Indicates the number of bits to shift. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntShiftRight(TEE_BigInt *dest, const TEE_BigInt *op, size_t bits); - -/** - * @brief Obtains the bitIndex bit of the natural binary representation of |src|. - * - * @param src Indicates the pointer to the integer. - * @param bitIndex Indicates the offset of the bit to read, starting from offset 0 of the least significant bit. - * - * @return Returns the Boolean value of bitIndexth in |src|. The value true represents a 1, - * and false represents a 0. - * - * @since 12 - * @version 1.0 - */ -bool TEE_BigIntGetBit(const TEE_BigInt *src, uint32_t bitIndex); - -/** - * @brief Obtains the number of bits in the natural binary representation of |src|, - * that is, the magnitude of src. - * - * @param src Indicates the pointer to the integer. - * - * @return Returns 0 if src is 0. - * Returns the number of bits in the natural binary representation of src. - * - * @since 12 - * @version 1.0 - */ -uint32_t TEE_BigIntGetBitCount(const TEE_BigInt *src); - -#if defined(API_LEVEL) && (API_LEVEL >= API_LEVEL1_2) -/** - * @brief Sets the first bit of bitIndex in the natural binary representation of op to - * 1 or 0. - * - * @param op Indicates the pointer to the integer. - * @param bitIndex Indicates the offset of the bit to set, starting from offset 0 of the least significant bit. - * @param value Indicates the bit value to set. The value true represents a 1, and the value false - * represents a 0. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OVERFLOW bitIndexth if the bitIndexth bit is larger than the allocated bit - * length of op. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntSetBit(TEE_BigInt *op, uint32_t bitIndex, bool value); - -/** - * @brief Assigns the value of src to dest. - * - * @param dest Indicates the pointer to the TEE_BigInt to be assigned. - * @param src Indicates the pointer to the source operand. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OVERFLOW if the dest operand cannot hold the value of src. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntAssign(TEE_BigInt *dest, const TEE_BigInt *src); - -/** - * @brief Assigns the value of src to dest. - * - * @param dest Indicates the pointer to the TEE_BigInt to be assigned. - * @param src Indicates the pointer to the source operand. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OVERFLOW if the dest operand cannot hold the value of src. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntAbs(TEE_BigInt *dest, const TEE_BigInt *src); -#endif /* API_LEVEL */ - -/** - * @brief Computes dest = op1 + op2. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the sum of op1 and op2. - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntAdd(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2); - -/** - * @brief Computes dest = op1 – op2. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the difference between op1 - * and op2. - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntSub(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2); - -/** - * @brief Negates an operand: dest = –op. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result –op. - * @param op Indicates the pointer to the operand to be negated. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntNeg(TEE_BigInt *dest, const TEE_BigInt *op); - -/** - * @brief Computes dest = op1 * op2. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the product of op1 and op2. - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntMul(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2); - -/** - * @brief Computes dest = op * op. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result op * op. - * @param op Indicates the pointer to the operand to be squared. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntSquare(TEE_BigInt *dest, const TEE_BigInt *op); - -/** - * @brief Computes dest_r and dest_q to make op1 = dest_q* op2 + dest_r. - * - * @param dest_q Indicates the pointer to the TEE_BigInt that holds the quotient. - * @param dest_r Indicates the pointer to the TEE_BigInt that holds the remainder. - * @param op1 Indicates the pointer to the first operand, which is the dividend. - * @param op2 Indicates the pointer to the second operand, which is the divisor. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if at least one parameter is null. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntDiv(TEE_BigInt *dest_q, TEE_BigInt *dest_r, const TEE_BigInt *op1, const TEE_BigInt *op2); - -/** - * @brief Computes dest = op (mod n) to make 0 <= dest < n. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result op (mod n). - * @param op Indicates the pointer to the operand to be reduced mod n. - * @param n [IN] Indicates the pointer to the modulus, which must be greater than 1. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntMod(TEE_BigInt *dest, const TEE_BigInt *op, const TEE_BigInt *n); - -/** - * @brief Computes dest = (op1 + op2) (mod n). - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result op (op1 + op2)(mod n). - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * @param n Indicates the pointer to the modulus, which must be greater than 1. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntAddMod(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2, const TEE_BigInt *n); - -/** - * @brief Computes dest = (op1 – op2) (mod n). - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result op (op1 – op2)(mod n). - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * @param n Indicates the pointer to the modulus, which must be greater than 1. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntSubMod(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2, const TEE_BigInt *n); - -/** - * @brief Computes dest = (op1* op2)(mod n). - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result op (op1 * op2)(mod n). - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * @param n Indicates the pointer to the modulus, which must be greater than 1. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntMulMod(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2, const TEE_BigInt *n); - -/** - * @brief Computes dest = (op * op) (mod n). - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result op (op * op)(mod n). - * @param op Indicates the pointer to the operand. - * @param n [IN] Indicates the pointer to the modulus, which must be greater than 1. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntSquareMod(TEE_BigInt *dest, const TEE_BigInt *op, const TEE_BigInt *n); - -/** - * @brief Computes dest to make dest* op = 1 (mod n). - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result (op^–1)(mod n). - * @param op Indicates the pointer to the operand. - * @param n [IN] Indicates the pointer to the modulus, which must be greater than 1. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntInvMod(TEE_BigInt *dest, const TEE_BigInt *op, const TEE_BigInt *n); - -/** - * @brief Checks whether gcd(op1, op2) == 1. - * - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * - * @return Returns true if gcd(op1, op2) == 1. - * Returns false if gcd(op1, op2) != 1. - * - * @since 12 - * @version 1.0 - */ -bool TEE_BigIntRelativePrime(const TEE_BigInt *op1, const TEE_BigInt *op2); - -/** - * @brief Computes the greatest common divisor of op1 and op2. - * - * @param gcd Indicates the pointer to the TEE_BigInt that holds the greatest common divisor of op1 - * and op2. - * @param u Indicates the pointer to the TEE_BigInt that holds the first coefficient. - * @param v Indicates the pointer to the TEE_BigInt that holds the second coefficient. - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntComputeExtendedGcd(TEE_BigInt *gcd, TEE_BigInt *u, TEE_BigInt *v, const TEE_BigInt *op1, - const TEE_BigInt *op2); -/** - * @brief Performs a probabilistic primality test on op. - * - * @param op Indicates the pointer to the candidate number that is tested for primality. - * @param confidenceLevel Indicates the expected confidence level for a non-conclusive test. - * - * @return Returns 0 if op is a composite number. - * Returns 1 if op is a prime number. - * Returns –1 if the test is non-conclusive but the probability that op is composite is - * less than 2^(-confidenceLevel). - * - * @since 12 - * @version 1.0 - */ -int32_t TEE_BigIntIsProbablePrime(const TEE_BigInt *op, uint32_t confidenceLevel); - -/** - * @brief Converts src into a representation suitable for doing fast modular multiplication. - * - * @param dest Indicates the pointer to an initialized TEE_BigIntFMM memory area. - * @param src Indicates the pointer to the TEE_BigInt to convert. - * @param n Indicates the pointer to the modulus. - * @param context Indicates the pointer to the context that is previously initialized using - * {@link TEE_BigIntInitFMMContext1}. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntConvertToFMM(TEE_BigIntFMM *dest, const TEE_BigInt *src, const TEE_BigInt *n, - const TEE_BigIntFMMContext *context); - -/** - * @brief Converts src in the fast modular multiplication representation back to a - * TEE_BigInt representation. - * - * @param dest Indicates the pointer to an initialized TEE_BigIntFMM memory area to store the converted result. - * @param src Indicates the pointer to a TEE_BigIntFMM holding the value in the fast modular multiplication - * representation. - * @param n Indicates the pointer to the modulus. - * @param context Indicates the pointer to the context that is previously initialized using - * {@link TEE_BigIntInitFMMContext1}. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntConvertFromFMM(TEE_BigInt *dest, const TEE_BigIntFMM *src, const TEE_BigInt *n, - const TEE_BigIntFMMContext *context); - -/** - * @brief Computes dest = op1* op2 in the fast modular multiplication representation. - * - * @param dest Indicates the pointer to the TEE_BigIntFMM that holds the result op1* op2. - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * @param n Indicates the pointer to the modulus. - * @param context Indicates the pointer to the context that is previously initialized using - * {@link TEE_BigIntInitFMMContext1}. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntComputeFMM(TEE_BigIntFMM *dest, const TEE_BigIntFMM *op1, const TEE_BigIntFMM *op2, const TEE_BigInt *n, - const TEE_BigIntFMMContext *context); - -/** - * @brief Computes dest = (op1 ^ op2)(mod n). - * - * @param des Indicates the pointer to the TEE_BigInt that holds the result (op1 ^ op2)(mod n). - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * @param n Indicates the pointer to the modulus. - * @param context Indicates the pointer to the context that is previously initialized using - * {@link TEE_BigIntInitFMMContext1} or initialized to null. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_NOT_SUPPORTED if the value of n is not supported. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntExpMod(TEE_BigInt *des, TEE_BigInt *op1, const TEE_BigInt *op2, const TEE_BigInt *n, - TEE_BigIntFMMContext *context); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_client_api.h b/tee/include/tee_client_api.h deleted file mode 100644 index e9d0a614a..000000000 --- a/tee/include/tee_client_api.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TEE_CLIENT_API_H -#define TEE_CLIENT_API_H -/** - * @addtogroup TeeClient - * @{ - * - * @brief Provides APIs for the client applications (CAs) in the Rich Execution Environment (normal mode) to - * access the trusted applications (TAs) in a Trusted Execution Environment (TEE). - * - * @since 12 - * @version 1.0 - */ - -/** - * @file tee_client_api.h - * - * @brief Defines APIs for CAs to access TAs. - * - *

Example: - *

1. Initialize a TEE: Call TEEC_InitializeContext to initialize the TEE. - *

2. Open a session: Call TEEC_OpenSession with the Universal Unique Identifier (UUID) of the TA. - *

3. Send a command: Call TEEC_InvokeCommand to send a command to the TA. - *

4. Close the session: Call TEEC_CloseSession to close the session. - *

5. Close the TEE: Call TEEC_FinalizeContext to close the TEE. - * - * @library libteec.so - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include -#include "tee_client_type.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Defines the values of the parameters transmitted between the REE and TEE. - * - * @since 12 - * @version 1.0 - */ -#define TEEC_PARAM_TYPES(param0Type, param1Type, param2Type, param3Type) \ - ((param3Type) << 12 | (param2Type) << 8 | (param1Type) << 4 | (param0Type)) - -/** - * @brief Defines the value of the parameter specified by paramTypes and index. - * - * @since 12 - * @version 1.0 - */ -#define TEEC_PARAM_TYPE_GET(paramTypes, index) \ - (((paramTypes) >> (4*(index))) & 0x0F) - -/** - * @brief Initializes a TEE. - * - * The TEE must be initialized before a session is open or commands are sent. - * After the initialization, a connection is set up between the CA and the TEE. - * - * @param name [IN] Indicates the pointer to the TEE path. - * @param context [IN/OUT] Indicates the context pointer, which is the handle of the TEE. - * - * @return Returns {@code TEEC_SUCCESS} if the TEE is successfully initialized. - * Returns {@code TEEC_ERROR_BAD_PARAMETERS} if name is incorrect or context is null. - * Returns {@code TEEC_ERROR_GENERIC} if the available system resources are insufficient. - * - * @since 12 - * @version 1.0 - */ -TEEC_Result TEEC_InitializeContext(const char *name, TEEC_Context *context); - -/** - * @brief Closes the TEE. - * - * After the TEE is closed, the CA is disconnected from the TEE. - * - * @param context [IN/OUT] Indicates the pointer to the TEE that is successfully initialized. - * - * @since 12 - * @version 1.0 - */ -void TEEC_FinalizeContext(TEEC_Context *context); - -/** - * @brief Opens a session. - * - * This function is used to set up a connection between the CA and the TA of the specified UUID in the specified TEE - * context. The data to be transferred is contained in operation. - * If a session is opened successfully, session is returned providing a description of the connection. - * If the session fails to open, returnOrigin is returned indicating the cause of the failure. - * - * @param context [IN/OUT] Indicates the pointer to the TEE that is successfully initialized. - * @param session [OUT] Indicates the pointer to the session. The value cannot be null. - * @param destination [IN] Indicates the pointer to the UUID of the target TA. Each TA has a unique UUID. - * @param connectionMethod [IN] Indicates the connection method. For details, see {@link TEEC_LoginMethod}. - * @param connectionData [IN] Indicates the pointer to the connection data, which varies with the connection mode. - * If the connection mode is {@code TEEC_LOGIN_PUBLIC}, {@code TEEC_LOGIN_USER}, - * {@code TEEC_LOGIN_USER_APPLICATION}, or {@code TEEC_LOGIN_GROUP_APPLICATION}, the connection data must be null. - * If the connection mode is {@code TEEC_LOGIN_GROUP} or {@code TEEC_LOGIN_GROUP_APPLICATION}, - * the connection data must point to data of the uint32_t type, which indicates the target group user to be connected - * by the CA. - * @param operation [IN/OUT] Indicates the pointer to the data to be transmitted between the CA and TA. - * @param returnOrigin [IN/OUT] Indicates the pointer to the error source. - * For details, see {@code TEEC_ReturnCodeOrigin}. - * - * @return Returns {@code TEEC_SUCCESS} if the session is open successfully. - * Returns {@code TEEC_ERROR_BAD_PARAMETERS} if context, session, or destination is null. - * Returns {@code TEEC_ERROR_ACCESS_DENIED} if the access request is denied. - * Returns {@code TEEC_ERROR_OUT_OF_MEMORY} if the available system resources are insufficient. - * Returns {@code TEEC_ERROR_TRUSTED_APP_LOAD_ERROR} if the TA failed to be loaded. - * For details about other return values, see {@code TEEC_ReturnCode}. - * - * @since 12 - * @version 1.0 - */ -TEEC_Result TEEC_OpenSession(TEEC_Context *context, TEEC_Session *session, const TEEC_UUID *destination, - uint32_t connectionMethod, const void *connectionData, TEEC_Operation *operation, uint32_t *returnOrigin); - -/** - * @brief Closes a session. - * - * After the session is closed, the CA is disconnected from the TA. - * - * @param session [IN/OUT] Indicates the pointer to the session to close. - * - * @since 12 - * @version 1.0 - */ -void TEEC_CloseSession(TEEC_Session *session); - -/** - * @brief Sends a command to a TA. - * - * The CA sends the command ID to the TA through the specified session. - * - * @param session [IN/OUT] Indicates the pointer to the session opened. - * @param commandID [IN] Indicates the command ID supported by the TA. It is defined by the TA. - * @param operation [IN/OUT] Indicates the pointer to the data to be sent from the CA to the TA. - * @param returnOrigin [IN/OUT] Indicates the pointer to the error source. - * For details, see {@code TEEC_ReturnCodeOrigin}. - * - * @return Returns {@code TEEC_SUCCESS} if the command is sent successfully. - * Returns {@code TEEC_ERROR_BAD_PARAMETERS} if session is null or - * operation is in incorrect format. - * Returns {@code TEEC_ERROR_ACCESS_DENIED} if the access request is denied. - * Returns {@code TEEC_ERROR_OUT_OF_MEMORY} if the available system resources are insufficient. - * For details about other return values, see {@code TEEC_ReturnCode}. - * - * @since 12 - * @version 1.0 - */ -TEEC_Result TEEC_InvokeCommand(TEEC_Session *session, uint32_t commandID, - TEEC_Operation *operation, uint32_t *returnOrigin); - -/** - * @brief Registers shared memory in the specified TEE context. - * - * The registered shared memory can implement zero-copy. - * The zero-copy function, however, also requires support by the operating system. - * At present, zero-copy cannot be implemented in this manner. - * - * @param context [IN/OUT] Indicates the pointer to the TEE that is successfully initialized. - * @param sharedMem [IN/OUT] Indicates the pointer to the shared memory. - * The pointed shared memory cannot be null and the size cannot be 0. - * - * @return Returns {@code TEEC_SUCCESS} if the operation is successful. - * Returns {@code TEEC_ERROR_BAD_PARAMETERS} if context or sharedMem is null or - * the pointed memory is empty. - * - * @since 12 - * @version 1.0 - */ -TEEC_Result TEEC_RegisterSharedMemory(TEEC_Context *context, TEEC_SharedMemory *sharedMem); - -/** - * @brief Requests shared memory in the specified TEE context. - * - * The shared memory can be used to implement zero-copy during data transmission between the REE and TEE. - * The zero-copy function, however, also requires support by the operating system. - * At present, zero-copy cannot be implemented in this manner. - * - * @attention If the size field of the input parameter sharedMem is set to 0, TEEC_SUCCESS - * will be returned but the shared memory cannot be used because this memory has neither an address nor size. - * @param context [IN/OUT] Indicates the pointer to the TEE that is successfully initialized. - * @param sharedMem [IN/OUT] Indicates the pointer to the shared memory. The size of the shared memory cannot be 0. - * - * @return Returns {@code TEEC_SUCCESS} if the operation is successful. - * Returns {@code TEEC_ERROR_BAD_PARAMETERS} if context or sharedMem is null. - * Returns {@code TEEC_ERROR_OUT_OF_MEMORY} if the available system resources are insufficient. - * - * @since 12 - * @version 1.0 - */ -TEEC_Result TEEC_AllocateSharedMemory(TEEC_Context *context, TEEC_SharedMemory *sharedMem); - -/** - * @brief Releases the shared memory registered or acquired. - * - * @attention If the shared memory is acquired by using {@code TEEC_AllocateSharedMemory}, - * the memory released will be reclaimed. If the shared memory is acquired by using {@code TEEC_RegisterSharedMemory}, - * the local memory released will not be reclaimed. - * @param sharedMem [IN/OUT] Indicates the pointer to the shared memory to release. - * - * @since 12 - * @version 1.0 - */ -void TEEC_ReleaseSharedMemory(TEEC_SharedMemory *sharedMem); - -/** - * @brief Cancels an operation. - * - * @attention This operation is only used to send a cancel message. Whether to perform the cancel operation is - * determined by the TEE or TA. - * At present, the cancel operation does not take effect. - * @param operation [IN/OUT] Indicates the pointer to the data to be sent from the CA to the TA. - * - * @since 12 - * @version 1.0 - */ -void TEEC_RequestCancellation(TEEC_Operation *operation); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_client_constants.h b/tee/include/tee_client_constants.h deleted file mode 100644 index b66056ef9..000000000 --- a/tee/include/tee_client_constants.h +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TEE_CLIENT_CONSTANTS_H -#define TEE_CLIENT_CONSTANTS_H -/** - * @addtogroup TeeClient - * @{ - * - * @brief Provides APIs for the client applications (CAs) in the Rich Execution Environment (normal mode) to - * access the trusted applications (TAs) in a Trusted Execution Environment (TEE). - * - * @since 12 - * @version 1.0 - */ - -/** - * @file tee_client_constants.h - * - * @brief Defines public data and constants. - * - * @library libteec.so - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -/** - * @brief Defines the number of TEEC_Parameters in TEEC_Operation. - * - * @since 12 - * @version 1.0 - */ -#define TEEC_PARAM_NUM 4 - -/** - * @brief Defines the error codes returned. - * - * @since 12 - * @version 1.0 - */ -enum TEEC_ReturnCode { - /** The operation is successful. */ - TEEC_SUCCESS = 0x0, - /** Invalid command. The command is not supported by the TA. */ - TEEC_ERROR_INVALID_CMD, - /** The TA does not exist. */ - TEEC_ERROR_SERVICE_NOT_EXIST, - /** The session between the CA and TA does not exist. */ - TEEC_ERROR_SESSION_NOT_EXIST, - /** The number of connections to the TA has reached the limit. */ - TEEC_ERROR_SESSION_MAXIMUM, - /** The TA to be registered already exists. */ - TEEC_ERROR_REGISTER_EXIST_SERVICE, - /** Secure OS framework error. */ - TEEC_ERROR_TAGET_DEAD_FATAL, - /** Failed to read the file. */ - TEEC_ERROR_READ_DATA, - /** Failed to write the file. */ - TEEC_ERROR_WRITE_DATA, - /** Failed to truncate the file. */ - TEEC_ERROR_TRUNCATE_OBJECT, - /** Failed to seek data. */ - TEEC_ERROR_SEEK_DATA, - /** File synchronization error. */ - TEEC_ERROR_FSYNC_DATA, - /** Failed to rename the file. */ - TEEC_ERROR_RENAME_OBJECT, - /** Failed to load the TA when opening a session. */ - TEEC_ERROR_TRUSTED_APP_LOAD_ERROR, - /** Failed to initialize the TA. */ - TEEC_ERROR_GENERIC = 0xFFFF0000, - /** Permission verification failed. Permission verification is performed before a TEE or session is opened or - a command is sent. */ - TEEC_ERROR_ACCESS_DENIED = 0xFFFF0001, - /** The operation is canceled. This error code is returned when you operate the parameter with - the cancallation flag. */ - TEEC_ERROR_CANCEL = 0xFFFF0002, - /** Concurrent access causes permission conflict. Concurrent access to files in the trusted storage - service may cause this error. */ - TEEC_ERROR_ACCESS_CONFLICT = 0xFFFF0003, - /** Too much data is passed in the requested operation for the TA to parse. */ - TEEC_ERROR_EXCESS_DATA = 0xFFFF0004, - /** Incorrect data format. The TA failed to parse the parameters sent from the CA. */ - TEEC_ERROR_BAD_FORMAT = 0xFFFF0005, - /** Invalid parameter. The input parameter is null or invalid. */ - TEEC_ERROR_BAD_PARAMETERS = 0xFFFF0006, - /** The operation in the current state is invalid. This error code is returned if the trusted storage service is not - initialized when a trusted storage service operation is requested. */ - TEEC_ERROR_BAD_STATE = 0xFFFF0007, - /** The requested data is not found. */ - TEEC_ERROR_ITEM_NOT_FOUND = 0xFFFF0008, - /** The requested operation has not been implemented yet. This error code is returned when - TEEC_RequestCancellation is called. */ - TEEC_ERROR_NOT_IMPLEMENTED = 0xFFFF0009, - /** The requested operation is valid but is not supported in this implementation. This error code is returned - when certain algorithms of the secure encryption and decryption service, such as DSA, are requested. */ - TEEC_ERROR_NOT_SUPPORTED = 0xFFFF000A, - /** Expected data for the requested operation is not found. */ - TEEC_ERROR_NO_DATA = 0xFFFF000B, - /** The available system resources are insufficient. */ - TEEC_ERROR_OUT_OF_MEMORY = 0xFFFF000C, - /** The system is busy. Some resources are exclusively used by the system. */ - TEEC_ERROR_BUSY = 0xFFFF000D, - /** Communication between an application in the REE and a TA failed. */ - TEEC_ERROR_COMMUNICATION = 0xFFFF000E, - /** A security fault is detected in the TEE. */ - TEEC_ERROR_SECURITY = 0xFFFF000F, - /** The supplied buffer is too short for the output generated. - This error may occur when {@code TEEC_MEMREF_TEMP_OUTPUT} is used. */ - TEEC_ERROR_SHORT_BUFFER = 0xFFFF0010, - /** MAC value check error. */ - TEEC_ERROR_MAC_INVALID = 0xFFFF3071, - /** The TA crashed. */ - TEEC_ERROR_TARGET_DEAD = 0xFFFF3024, - /** Common error. */ - TEEC_FAIL = 0xFFFF5002 -}; - -/** - * @brief Defines the sources of the error codes returned. - * - * @since 12 - * @version 1.0 - */ -enum TEEC_ReturnCodeOrigin { - /** The error code indicates an error originated from the client API. */ - TEEC_ORIGIN_API = 0x1, - /** The error code indicates an error originated from the communication between the REE and TEE. */ - TEEC_ORIGIN_COMMS = 0x2, - /** The error code indicates an error originated within the TEE code. */ - TEEC_ORIGIN_TEE = 0x3, - /** The error code indicates an error originated within the TA code. */ - TEEC_ORIGIN_TRUSTED_APP = 0x4, -}; - -/** - * @brief Defines the identifiers of the shared memory. - * - * @since 12 - * @version 1.0 - */ -enum TEEC_SharedMemCtl { - /** The shared memory can carry data from CAs to TAs. */ - TEEC_MEM_INPUT = 0x1, - /** The shared memory can carry data from TAs to CAs. */ - TEEC_MEM_OUTPUT = 0x2, - /** The shared memory can carry data transmitted between CAs and TAs. */ - TEEC_MEM_INOUT = 0x3, -}; - -/** - * @brief Defines the parameter types. - * - * @since 12 - * @version 1.0 - */ -enum TEEC_ParamType { - /** The parameter is not used. */ - TEEC_NONE = 0x0, - /** The parameter is a {@code TEEC_Value} tagged as input. Data flows from a CA to a TA. */ - TEEC_VALUE_INPUT = 0x01, - /** The parameter is a {@code TEEC_Value} tagged as output. Data flows from a TA to a CA. */ - TEEC_VALUE_OUTPUT = 0x02, - /** The parameter is a {@code TEEC_Value} tagged as both input and output. */ - TEEC_VALUE_INOUT = 0x03, - /** The parameter is a {@code TEEC_TempMemoryReference} tagged as input. Data flows from a CA to a TA. */ - TEEC_MEMREF_TEMP_INPUT = 0x05, - /** The parameter is a {@code TEEC_TempMemoryReference} tagged as output. Data flows from a TA to a CA. */ - TEEC_MEMREF_TEMP_OUTPUT = 0x06, - /** The parameter is a {@code TEEC_TempMemoryReference} tagged as both input and output. - Data is transmitted between a TA and a CA. */ - TEEC_MEMREF_TEMP_INOUT = 0x07, - /** The parameter is a {@code TEEC_IonReference} tagged as input. Data flows from a CA to a TA**/ - TEEC_ION_INPUT = 0x08, - /** The parameter is a {@code TEEC_IonSglistReference} tagged as input. Data flows from a CA to a TA**/ - TEEC_ION_SGLIST_INPUT = 0x09, - /** The parameter is a {@code TEEC_RegisteredMemoryReference} that refers to the entire memory block. - The data flow is the same as that of {@code TEEC_SharedMemCtl}. */ - TEEC_MEMREF_WHOLE = 0xc, - /** The parameter is a {@code TEEC_RegisteredMemoryReference} tagged as input. Data flows from a CA to a TA. */ - TEEC_MEMREF_PARTIAL_INPUT = 0xd, - /** The parameter is a {@code TEEC_RegisteredMemoryReference} tagged as output. Data flows from a TA to a CA. */ - TEEC_MEMREF_PARTIAL_OUTPUT = 0xe, - /** The parameter is a {@code TEEC_RegisteredMemoryReference} tagged as both input and output. - Data is transmitted between a TA and a CA. */ - TEEC_MEMREF_PARTIAL_INOUT = 0xf -}; - -/** - * @brief Defines the login methods. - * - * @since 12 - * @version 1.0 -*/ -enum TEEC_LoginMethod { - /** No login data is provided. */ - TEEC_LOGIN_PUBLIC = 0x0, - /** The login data about the user running the CA process is provided. */ - TEEC_LOGIN_USER, - /** The login data about the group running the CA process is provided. */ - TEEC_LOGIN_GROUP, - /** The login data about the running CA is provided. */ - TEEC_LOGIN_APPLICATION = 0x4, - /** The login data about the user running the CA process and about the CA are provided. */ - TEEC_LOGIN_USER_APPLICATION = 0x5, - /** The login data about the group running the CA process and about the CA are provided. */ - TEEC_LOGIN_GROUP_APPLICATION = 0x6, - /** Login method reserved for TEEOS. */ - TEEC_LOGIN_IDENTIFY = 0x7, -}; - -/** @} */ -#endif diff --git a/tee/include/tee_client_type.h b/tee/include/tee_client_type.h deleted file mode 100644 index 5b89ceb8d..000000000 --- a/tee/include/tee_client_type.h +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TEE_CLIENT_TYPE_H -#define TEE_CLIENT_TYPE_H -/** - * @addtogroup TeeClient - * @{ - * - * @brief Provides APIs for the client applications (CAs) in the Rich Execution Environment (normal mode) to - * access the trusted applications (TAs) in a Trusted Execution Environment (TEE). - * - * @since 12 - * @version 1.0 - */ - -/** - * @file tee_client_type.h - * - * @brief Defines basic data types and data structures. - * - * @library libteec.so - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include -#include -#include -#include -#include -#include "tee_client_constants.h" - -/** - * @brief Defines the linked list type. - * - * @since 12 - * @version 1.0 - */ -struct ListNode { - struct ListNode *next; - struct ListNode *prev; -}; - -/** - * @brief Defines the return values. - * - * @since 12 - * @version 1.0 - */ -typedef enum TEEC_ReturnCode TEEC_Result; - -/** - * @brief Defines the universally unique identifier (UUID) as defined in RFC4122 [2]. - * The UUIDs are used to identify TAs. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - uint32_t timeLow; - uint16_t timeMid; - uint16_t timeHiAndVersion; - uint8_t clockSeqAndNode[8]; -} TEEC_UUID; - -/** - * @brief Defines the context, a logical connection between a CA and a TEE. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - int32_t fd; - uint8_t *ta_path; - struct ListNode session_list; - struct ListNode shrd_mem_list; - union { - struct { - void *buffer; - sem_t buffer_barrier; - } share_buffer; - uint64_t imp; - }; -} TEEC_Context; - -/** - * @brief Defines the session between a CA and a TA. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - uint32_t session_id; - TEEC_UUID service_id; - uint32_t ops_cnt; - union { - struct ListNode head; - uint64_t imp; - }; - TEEC_Context *context; -} TEEC_Session; - -/** - * @brief Defines a shared memory block, which can be registered or allocated. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - void *buffer; - uint32_t size; - uint32_t flags; - uint32_t ops_cnt; - bool is_allocated; - union { - struct ListNode head; - void* imp; - }; - TEEC_Context *context; -} TEEC_SharedMemory; - -/** - * @brief Defines a pointer to a temporary buffer. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - void *buffer; - uint32_t size; -} TEEC_TempMemoryReference; - -/** - * @brief Defines a pointer to the shared memory that is registered or allocated. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - TEEC_SharedMemory *parent; - uint32_t size; - uint32_t offset; -} TEEC_RegisteredMemoryReference; - -/** - * @brief Describes a parameter that carries small raw data passed by value. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - uint32_t a; - uint32_t b; -} TEEC_Value; - -/** - * @brief Describes the size and handle of the ION memory. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - int ionShareFd; - uint32_t ionSize; -} TEEC_IonReference; - -/** - * @brief Defines a parameter of {@code TEEC_Operation}. - * - * @since 12 - * @version 1.0 - */ -typedef union { - TEEC_TempMemoryReference tmpref; - TEEC_RegisteredMemoryReference memref; - TEEC_Value value; - TEEC_IonReference ionref; -} TEEC_Parameter; - -/** - * @brief Defines the parameters for opening a session or sending a command. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - /** The value 0 means to cancel the command, and other values mean to execute the command. */ - uint32_t started; - /** Use {@code TEEC_PARAM_TYPES} to create this parameter. */ - uint32_t paramTypes; - TEEC_Parameter params[TEEC_PARAM_NUM]; - TEEC_Session *session; - bool cancel_flag; -} TEEC_Operation; - -/** @} */ -#endif diff --git a/tee/include/tee_core_api.h b/tee/include/tee_core_api.h deleted file mode 100644 index 11a3b46d6..000000000 --- a/tee/include/tee_core_api.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __TEE_CORE_API_H -#define __TEE_CORE_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - * @version 1.0 - */ - - /** - * @file tee_core_api.h - * - * @brief Provides APIs for managing trusted application (TA) sessions. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif -#ifndef _TEE_TA_SESSION_HANDLE -#define _TEE_TA_SESSION_HANDLE -/** - * @brief Defines the handle of TA session. - * - * @since 12 - */ -typedef uint32_t TEE_TASessionHandle; -#endif - -/** - * @brief Raises a panic in the TA instance. - * - * @param panicCode Indicates an informative panic code defined by the TA. - * - * @since 12 - * @version 1.0 - */ -void TEE_Panic(TEE_Result panicCode); - -/** - * @brief Opens a new session with a TA. - * - * @param destination Indicates the pointer to the TEE_UUID structure that contains - * the Universal Unique Identifier (UUID) of the target TA. - * @param cancellationRequestTimeout Indicates the timeout period in milliseconds or a special value - * if there is no timeout. - * @param paramTypes Indicates the types of all parameters passed in the operation. - * @param params Indicates the parameters passed in the operation. - * @param session Indicates the pointer to the variable that will receive the client session handle. - * @param returnOrigin Indicates the pointer to the variable that holds the return origin. - * - * @return Returns TEE_SUCCESS if the session is opened. - * Returns TEE_ERROR_ITEM_NOT_FOUND if the TA cannot be found in the Trusted Execution Environment (TEE). - * Returns TEE_ERROR_ACCESS_DENIED if the access request to the TA is denied. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_OpenTASession(const TEE_UUID *destination, uint32_t cancellationRequestTimeout, uint32_t paramTypes, - TEE_Param params[TEE_PARAMS_NUM], TEE_TASessionHandle *session, uint32_t *returnOrigin); - -/** - * @brief Closes a client session. - * - * @param session Indicates the handle of the session to close. - * - * @since 12 - * @version 1.0 - */ -void TEE_CloseTASession(TEE_TASessionHandle session); - -/** - * @brief Invokes a command in a session opened between this client TA instance and a target TA instance. - * - * @param session Indicates the handle of the opened session. - * @param cancellationRequestTimeout Indicates the timeout period in milliseconds or a special value - * if there is no timeout. - * @param commandID Indicates the identifier of the command to invoke. - * @param paramTypes Indicates the types of all parameters passed in the operation. - * @param params Indicates the parameters passed in the operation. - * @param returnOrigin Indicates the pointer to the variable that holds the return origin. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_ACCESS_DENIED if the command fails to be invoked. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_InvokeTACommand(TEE_TASessionHandle session, uint32_t cancellationRequestTimeout, uint32_t commandID, - uint32_t paramTypes, TEE_Param params[TEE_PARAMS_NUM], uint32_t *returnOrigin); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_crypto_api.h b/tee/include/tee_crypto_api.h deleted file mode 100644 index 1d0372e05..000000000 --- a/tee/include/tee_crypto_api.h +++ /dev/null @@ -1,1045 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TEE_CRYPTO_API_H -#define TEE_CRYPTO_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_crypto_api.h - * - * @brief Provides APIs for cryptographic operations. - * - * You can use these APIs to implement encryption and decryption. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include /* pthread_mutex_t */ -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef NULL -/** - * @brief Definition of NULL. - * - * @since 12 - */ -#define NULL ((void *)0) -#endif -/** - * @brief Defines the maximum key length, in bits. - * - * @since 12 - */ -#define TEE_MAX_KEY_SIZE_IN_BITS (1024 * 8) -/** - * @brief Defines the length of the SW_RSA key, in bytes. - * - * @since 12 - */ -#define SW_RSA_KEYLEN 1024 -/** - * @brief Defines the maximum length of other Diffie-Hellman (DH) information, in bytes. - * - * @since 12 - */ -#define TEE_DH_MAX_SIZE_OF_OTHER_INFO 64 /* bytes */ - -/** - * @brief Enumerates the cryptographic operation handles. - * - * @since 12 - */ -enum __TEE_Operation_Constants { - /** Cipher */ - TEE_OPERATION_CIPHER = 0x1, - /** MAC */ - TEE_OPERATION_MAC = 3, - /** AE */ - TEE_OPERATION_AE = 4, - /** Digest */ - TEE_OPERATION_DIGEST = 5, - /** Asymmetric Cipher */ - TEE_OPERATION_ASYMMETRIC_CIPHER = 6, - /** Asymmetric Signature */ - TEE_OPERATION_ASYMMETRIC_SIGNATURE = 7, - /** Key Derivation */ - TEE_OPERATION_KEY_DERIVATION = 8, -}; - -/** - * @brief Enumerates the cryptographic algorithms. - * - * @since 12 - */ -enum __tee_crypto_algorithm_id { - /** Invalid algorithm */ - TEE_ALG_INVALID = 0x0, - /** AES_ECB_NOPAD */ - TEE_ALG_AES_ECB_NOPAD = 0x10000010, - /** AES_CBC_NOPAD */ - TEE_ALG_AES_CBC_NOPAD = 0x10000110, - /** AES_CTR */ - TEE_ALG_AES_CTR = 0x10000210, - /** AES_CTS */ - TEE_ALG_AES_CTS = 0x10000310, - /** AES_XTS */ - TEE_ALG_AES_XTS = 0x10000410, - /** AES_CBC_MAC_NOPAD */ - TEE_ALG_AES_CBC_MAC_NOPAD = 0x30000110, - /** AES_CBC_MAC_PKCS5 */ - TEE_ALG_AES_CBC_MAC_PKCS5 = 0x30000510, - /** AES_CMAC */ - TEE_ALG_AES_CMAC = 0x30000610, - /** AES_GMAC */ - TEE_ALG_AES_GMAC = 0x30000810, - /** AES_CCM */ - TEE_ALG_AES_CCM = 0x40000710, - /** AES_GCM */ - TEE_ALG_AES_GCM = 0x40000810, - /** DES_ECB_NOPAD */ - TEE_ALG_DES_ECB_NOPAD = 0x10000011, - /** DES_CBC_NOPAD */ - TEE_ALG_DES_CBC_NOPAD = 0x10000111, - /** DES_CBC_MAC_NOPAD */ - TEE_ALG_DES_CBC_MAC_NOPAD = 0x30000111, - /** DES_CBC_MAC_PKCS5 */ - TEE_ALG_DES_CBC_MAC_PKCS5 = 0x30000511, - /** DES3_ECB_NOPAD */ - TEE_ALG_DES3_ECB_NOPAD = 0x10000013, - /** DES3_CBC_NOPAD */ - TEE_ALG_DES3_CBC_NOPAD = 0x10000113, - /** DES3_CBC_MAC_NOPAD */ - TEE_ALG_DES3_CBC_MAC_NOPAD = 0x30000113, - /** DES3_CBC_MAC_PKCS5 */ - TEE_ALG_DES3_CBC_MAC_PKCS5 = 0x30000513, - /** RSASSA_PKCS1_V1_5_MD5 */ - TEE_ALG_RSASSA_PKCS1_V1_5_MD5 = 0x70001830, - /** RSASSA_PKCS1_V1_5_SHA1 */ - TEE_ALG_RSASSA_PKCS1_V1_5_SHA1 = 0x70002830, - /** RSASSA_PKCS1_V1_5_SHA224 */ - TEE_ALG_RSASSA_PKCS1_V1_5_SHA224 = 0x70003830, - /** RSASSA_PKCS1_V1_5_SHA256 */ - TEE_ALG_RSASSA_PKCS1_V1_5_SHA256 = 0x70004830, - /** RSASSA_PKCS1_V1_5_SHA384 */ - TEE_ALG_RSASSA_PKCS1_V1_5_SHA384 = 0x70005830, - /** RSASSA_PKCS1_V1_5_SHA512 */ - TEE_ALG_RSASSA_PKCS1_V1_5_SHA512 = 0x70006830, - /** RSASSA_PKCS1_PSS_MGF1_MD5 */ - TEE_ALG_RSASSA_PKCS1_PSS_MGF1_MD5 = 0x70111930, - /** RSASSA_PKCS1_PSS_MGF1_SHA1 */ - TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1 = 0x70212930, - /** RSASSA_PKCS1_PSS_MGF1_SHA224 */ - TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224 = 0x70313930, - /** RSASSA_PKCS1_PSS_MGF1_SHA256 */ - TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256 = 0x70414930, - /** RSASSA_PKCS1_PSS_MGF1_SHA384 */ - TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384 = 0x70515930, - /** RSASSA_PKCS1_PSS_MGF1_SHA512 */ - TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512 = 0x70616930, - /** RSAES_PKCS1_V1_5 */ - TEE_ALG_RSAES_PKCS1_V1_5 = 0x60000130, - /** RSAES_PKCS1_OAEP_MGF1_SHA1 */ - TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1 = 0x60210230, - /** RSAES_PKCS1_OAEP_MGF1_SHA224 */ - TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA224 = 0x60211230, - /** RSAES_PKCS1_OAEP_MGF1_SHA256 */ - TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA256 = 0x60212230, - /** RSAES_PKCS1_OAEP_MGF1_SHA384 */ - TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA384 = 0x60213230, - /** RSAES_PKCS1_OAEP_MGF1_SHA512 */ - TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA512 = 0x60214230, - /** RSA_NOPAD */ - TEE_ALG_RSA_NOPAD = 0x60000030, - /** DSA_SHA1 */ - TEE_ALG_DSA_SHA1 = 0x70002131, - /** DSA_SHA224 */ - TEE_ALG_DSA_SHA224 = 0x70003131, - /** DSA_SHA256 */ - TEE_ALG_DSA_SHA256 = 0x70004131, - /** DH_DERIVE_SHARED_SECRET */ - TEE_ALG_DH_DERIVE_SHARED_SECRET = 0x80000032, - /** MD5 */ - TEE_ALG_MD5 = 0x50000001, - /** SHA1 */ - TEE_ALG_SHA1 = 0x50000002, - /** SHA224 */ - TEE_ALG_SHA224 = 0x50000003, - /** SHA256 */ - TEE_ALG_SHA256 = 0x50000004, - /** SHA384 */ - TEE_ALG_SHA384 = 0x50000005, - /** SHA512 */ - TEE_ALG_SHA512 = 0x50000006, - /** HMAC_MD5 */ - TEE_ALG_HMAC_MD5 = 0x30000001, - /** HMAC_SHA1 */ - TEE_ALG_HMAC_SHA1 = 0x30000002, - /** HMAC_SHA1 */ - TEE_ALG_HMAC_SHA224 = 0x30000003, - /** HMAC_SHA224 */ - TEE_ALG_HMAC_SHA256 = 0x30000004, - /** HMAC_SHA256 */ - TEE_ALG_HMAC_SHA384 = 0x30000005, - /** HMAC_SHA384 */ - TEE_ALG_HMAC_SHA512 = 0x30000006, - /** HMAC_SHA512 */ - TEE_ALG_HMAC_SM3 = 0x30000007, - /** HMAC_SM3 */ - TEE_ALG_AES_ECB_PKCS5 = 0x10000020, - /** AES_ECB_PKCS5 */ - TEE_ALG_AES_CBC_PKCS5 = 0x10000220, - /** AES_CBC_PKCS5 */ - TEE_ALG_ECDSA_SHA1 = 0x70001042, - /** ECDSA_SHA1 */ - TEE_ALG_ECDSA_SHA224 = 0x70002042, - /** ECDSA_SHA224 */ - TEE_ALG_ECDSA_SHA256 = 0x70003042, - /** ECDSA_SHA256 */ - TEE_ALG_ECDSA_SHA384 = 0x70004042, - /** ECDSA_SHA384 */ - TEE_ALG_ECDSA_SHA512 = 0x70005042, - /** ECDSA_SHA512 */ - TEE_ALG_ED25519 = 0x70005043, - /** ED25519 */ - TEE_ALG_ECDH_DERIVE_SHARED_SECRET = 0x80000042, - /** ECDH_DERIVE_SHARED_SECRET */ - TEE_ALG_X25519 = 0x80000044, - /** X25519 */ - TEE_ALG_ECC = 0x80000001, - /** ECC */ - TEE_ALG_ECDSA_P192 = 0x70001042, - /** ECDSA_P192 */ - TEE_ALG_ECDSA_P224 = 0x70002042, - /** ECDSA_P224 */ - TEE_ALG_ECDSA_P256 = 0x70003042, - /** ECDSA_P256 */ - TEE_ALG_ECDSA_P384 = 0x70004042, - /** ECDSA_P521 */ - TEE_ALG_ECDSA_P521 = 0x70005042, - /** ECDH_P192 */ - TEE_ALG_ECDH_P192 = 0x80001042, - /** ECDH_P224 */ - TEE_ALG_ECDH_P224 = 0x80002042, - /** ECDH_P256 */ - TEE_ALG_ECDH_P256 = 0x80003042, - /** ECDH_P384 */ - TEE_ALG_ECDH_P384 = 0x80004042, - /** ECDH_P521 */ - TEE_ALG_ECDH_P521 = 0x80005042, - /** SIP_HASH */ - TEE_ALG_SIP_HASH = 0xF0000002, - /** SM2_DSA_SM3 */ - TEE_ALG_SM2_DSA_SM3 = 0x70006045, - /** SM2_PKE */ - TEE_ALG_SM2_PKE = 0x80000045, - /** SM3 */ - TEE_ALG_SM3 = 0x50000007, - /** SM4_ECB_NOPAD */ - TEE_ALG_SM4_ECB_NOPAD = 0x10000014, - /** SM4_CBC_NOPAD */ - TEE_ALG_SM4_CBC_NOPAD = 0x10000114, - /** SM4_CBC_PKCS7 */ - TEE_ALG_SM4_CBC_PKCS7 = 0xF0000003, - /** SM4_CTR */ - TEE_ALG_SM4_CTR = 0x10000214, - /** SM4_CFB128 */ - TEE_ALG_SM4_CFB128 = 0xF0000000, - /** SM4_XTS */ - TEE_ALG_SM4_XTS = 0x10000414, - /** SM4_OFB */ - TEE_ALG_SM4_OFB = 0x10000514, - /** AES_OFB */ - TEE_ALG_AES_OFB = 0x10000510, - /** SM4_GCM */ - TEE_ALG_SM4_GCM = 0xF0000005, -}; - -/** - * @see __tee_crypto_algorithm_id - */ -typedef enum __tee_crypto_algorithm_id tee_crypto_algorithm_id; -/** - * @brief No element is available. - * - * @since 12 - */ -#define TEE_OPTIONAL_ELEMENT_NONE 0x00000000 - -/** - * @brief Enumerates the Elliptic-Curve Cryptography (ECC) curves supported. - * - * @since 12 - */ -typedef enum { - /** CURVE_NIST_P192 */ - TEE_ECC_CURVE_NIST_P192 = 0x00000001, - /** CURVE_NIST_P224 */ - TEE_ECC_CURVE_NIST_P224 = 0x00000002, - /** CURVE_NIST_P256 */ - TEE_ECC_CURVE_NIST_P256 = 0x00000003, - /** CURVE_NIST_P384 */ - TEE_ECC_CURVE_NIST_P384 = 0x00000004, - /** CURVE_NIST_P521 */ - TEE_ECC_CURVE_NIST_P521 = 0x00000005, - /** CURVE_SM2 256 bits */ - TEE_ECC_CURVE_SM2 = 0x00000300, - /** CURVE_25519 256 bits */ - TEE_ECC_CURVE_25519 = 0x00000200, -} TEE_ECC_CURVE; - -/** - * @brief Enumerates the Mask Generation Function (MGF1) modes. - * - * @since 12 - */ -typedef enum { - TEE_DH_HASH_SHA1_mode = 0, - TEE_DH_HASH_SHA224_mode = 1, - TEE_DH_HASH_SHA256_mode = 2, - TEE_DH_HASH_SHA384_mode = 3, - TEE_DH_HASH_SHA512_mode = 4, - TEE_DH_HASH_NumOfModes, -} TEE_DH_HASH_Mode; - -/** - * @brief Enumerates the cryptographic operation modes. - * - * @since 12 - */ -enum __TEE_OperationMode { - /** Encryption */ - TEE_MODE_ENCRYPT = 0x0, - /** Decryption */ - TEE_MODE_DECRYPT, - /** Signing */ - TEE_MODE_SIGN, - /** Signature verification */ - TEE_MODE_VERIFY, - /** MAC */ - TEE_MODE_MAC, - /** Digest */ - TEE_MODE_DIGEST, - /** Key derivation */ - TEE_MODE_DERIVE -}; - -/** - * @brief Enumerates the cryptographic operation states. - * - * @since 12 - */ -enum tee_operation_state { - /** Initial */ - TEE_OPERATION_STATE_INITIAL = 0x00000000, - /** Active */ - TEE_OPERATION_STATE_ACTIVE = 0x00000001, -}; - -/** - * @see __TEE_OperationMode - */ -typedef uint32_t TEE_OperationMode; - -/** - * @brief Defines the operation information. - * - * @since 12 - */ -struct __TEE_OperationInfo { - /** Algorithm ID */ - uint32_t algorithm; /* #__TEE_CRYPTO_ALGORITHM_ID */ - /** Operation type */ - uint32_t operationClass; /* #__TEE_Operation_Constants */ - /** Operation mode */ - uint32_t mode; /* #__TEE_OperationMode */ - /** Digest length */ - uint32_t digestLength; - /** Maximum key length */ - uint32_t maxKeySize; - /** Key length*/ - uint32_t keySize; - /** Required key usage */ - uint32_t requiredKeyUsage; - /** Handle state */ - uint32_t handleState; - /** Key */ - void *keyValue; -}; - -/** - * @brief Defines the __TEE_OperationInfo struct. - * - * @see __TEE_OperationInfo - */ -typedef struct __TEE_OperationInfo TEE_OperationInfo; - -/** - * @brief Defines the key information stored in the OperationInfo. - * - * @since 12 - */ -typedef struct { - /** Key length */ - uint32_t keySize; - /** Required key usage */ - uint32_t requiredKeyUsage; -} TEE_OperationInfoKey; - -/** - * @brief Defines information about an operation. - * - * @since 12 - */ -typedef struct { - /** Algorithm ID */ - uint32_t algorithm; - /** Operation type */ - uint32_t operationClass; - /** Operation mode */ - uint32_t mode; - /** Digest length */ - uint32_t digestLength; - /** Maximum key length */ - uint32_t maxKeySize; - /** Handle state */ - uint32_t handleState; - /** Operation state */ - uint32_t operationState; - /** Number of keys */ - uint32_t numberOfKeys; - /** Key information */ - TEE_OperationInfoKey keyInformation[]; -} TEE_OperationInfoMultiple; - -/** - * @brief Defines the cryptographic operation handle. - * - * @since 12 - */ -struct __TEE_OperationHandle { - /** Algorithm ID */ - uint32_t algorithm; - /** Operation type */ - uint32_t operationClass; - /** Operation mode */ - uint32_t mode; - /** Digest length */ - uint32_t digestLength; - /** Maximum key length */ - uint32_t maxKeySize; - /** Key length */ - uint32_t keySize; - /** Key length */ - uint32_t keySize2; - /** Required key usage */ - uint32_t requiredKeyUsage; - /** Handle state */ - uint32_t handleState; - /** Key */ - void *keyValue; - /** Key */ - void *keyValue2; - /** */ - void *crypto_ctxt; - /** */ - void *hmac_rest_ctext; - /** iv */ - void *IV; - /** Public key */ - void *publicKey; - /** Length of the public key */ - uint32_t publicKeyLen; - /** Private key */ - void *privateKey; - /** Length of the private key */ - uint32_t privateKeyLen; - /** Length of the IV */ - uint32_t IVLen; - /** Operation lock */ - pthread_mutex_t operation_lock; - /** HAL information */ - void *hal_info; -}; - -/** - * @brief Defines the data used for conversion of integers. - * - * @since 12 - */ -typedef struct { - /** Source */ - uint32_t src; - /** Destination */ - uint32_t dest; -} crypto_uint2uint; - -/** - * @brief Defines the maximum length of an RSA public key. - * - * @since 12 - */ -#define RSA_PUBKEY_MAXSIZE sizeof(CRYS_RSAUserPubKey_t) -/** - * @brief Defines the maximum length of an RES private key. - * - * @since 12 - */ -#define RSA_PRIVKEY_MAXSIZE sizeof(CRYS_RSAUserPrivKey_t) - -/** - * @brief Defines a structure to hold the input and output data. - * - * @since 12 - */ -typedef struct { - /** Source data */ - void *src_data; - /** Length of the source data */ - size_t src_len; - /** Destination data */ - void *dest_data; - /** Length of the destination data */ - size_t *dest_len; -} operation_src_dest; - -/** - * @brief Defines the AE initialization data. - * - * @since 12 - */ -typedef struct { - /** nonce */ - void *nonce; - /** Leng of nonce */ - size_t nonce_len; - /** Length of the tag */ - uint32_t tag_len; - /** Length of the additional authenticated data (AAD) */ - size_t aad_len; - /** Length of the payload */ - size_t payload_len; -} operation_ae_init; - -/** - * @brief Defines the pointer to __TEE_OperationHandle. - * - * @see __TEE_OperationHandle - * - * @since 12 - */ -typedef struct __TEE_OperationHandle *TEE_OperationHandle; - -/** - * @brief Defines the __TEE_OperationHandle struct. - * - * @see __TEE_OperationHandle - * - * @since 12 - */ -typedef struct __TEE_OperationHandle TEE_OperationHandleVar; - -/** - * @brief Defines the __TEE_ObjectHandle struct. - * - * @since 12 - */ -typedef struct __TEE_ObjectHandle TEE_ObjectHandleVar; - -/** - * @brief Allocates an operation handle. - * - * @param operation Indicates the pointer to the operation handle. - * @param algorithm Indicates the cipher algorithm. - * @param mode Indicates the operation mode. - * @param maxKeySize Indicates the maximum length of the key. - * - * @return Returns TEE_SUCCESS if the operation handle is allocated. - * Returns TEE_ERROR_OUT_OF_MEMORY if there is no enough memory for this operation. - * Returns TEE_ERROR_NOT_SUPPORTED if the specified algorithm is not supported. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AllocateOperation(TEE_OperationHandle *operation, uint32_t algorithm, uint32_t mode, - uint32_t maxKeySize); - -/** - * @brief Releases an operation handle. - * - * @param operation Indicates the operation handle to release. - * - * @since 12 - * @version 1.0 - */ -void TEE_FreeOperation(TEE_OperationHandle operation); - -/** - * @brief Obtains operation information. - * - * @param operation Indicates the operation handle. - * @param operationInfo Indicates the pointer to the operation information. - * - * @since 12 - * @version 1.0 - */ -void TEE_GetOperationInfo(const TEE_OperationHandle operation, TEE_OperationInfo *operationInfo); - -/** - * @brief Resets an operation handle. - * - * @param operation Indicates the operation handle to reset. - * - * @since 12 - * @version 1.0 - */ -void TEE_ResetOperation(TEE_OperationHandle operation); - -/** - * @brief Sets the key for an operation. - * - * @param operation Indicates the operation handle. - * @param key Indicates the key. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_OUT_OF_MEMORY if there is no enough memory for this operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SetOperationKey(TEE_OperationHandle operation, const TEE_ObjectHandle key); - -/** - * @brief Sets two keys for an operation. - * - * @param operation Indicates the operation handle. - * @param key1 Indicates key 1. - * @param key2 Indicates key 2. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SetOperationKey2(TEE_OperationHandle operation, const TEE_ObjectHandle key1, - const TEE_ObjectHandle key2); - -/** - * @brief Copies an operation handle. - * - * @param dstOperation Indicates the destination operation handle. - * @param srcOperation Indicates the source operation handle. - * - * @since 12 - * @version 1.0 - */ -void TEE_CopyOperation(TEE_OperationHandle dstOperation, const TEE_OperationHandle srcOperation); - -/** - * @brief Initializes the context to start a cipher operation. - * - * @param operation Indicates the operation handle. - * @param IV Indicates the pointer to the buffer storing the operation IV. If this parameter is not used, - * set it to NULL. - * @param IVLen Indicates the length of the IV buffer. - * - * @since 12 - * @version 1.0 - */ -void TEE_CipherInit(TEE_OperationHandle operation, const void *IV, size_t IVLen); - -/** - * @brief Updates the data for a cipher operation. - * - * @param operation Indicates the operation handle. - * @param srcData Indicates the pointer to the source data. - * @param srcLen Indicates the length of the source data. - * @param destData Indicates the pointer to the destination data. - * @param destLen Indicates the pointer to the destination data length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_CipherUpdate(TEE_OperationHandle operation, const void *srcData, size_t srcLen, void *destData, - size_t *destLen); - -/** - * @brief Finalizes a cipher operation. - * - * @param operation Indicates the operation handle. - * @param srcData Indicates the pointer to the source data. - * @param srcLen Indicates the length of the source data. - * @param destData Indicates the pointer to the destination data. - * @param destLen Indicates the pointer to the destination data length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_CipherDoFinal(TEE_OperationHandle operation, const void *srcData, size_t srcLen, void *destData, - size_t *destLen); - -/** - * @brief Updates the digest. - * - * @param operation Indicates the operation handle. - * @param chunk Indicates the pointer to the chunk of data to be hashed. - * @param chunkSize Indicates the length of the chunk. - * - * @since 12 - * @version 1.0 - */ -void TEE_DigestUpdate(TEE_OperationHandle operation, const void *chunk, size_t chunkSize); - -/** - * @brief Finalizes the message digest operation. - * - * @param operation Indicates the operation handle. - * @param chunk Indicates the pointer to the chunk of data to be hashed. - * @param chunkLen Indicates the length of the chunk. - * @param hash Indicates the pointer to the buffer storing the message hash. - * @param hashLen - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_DigestDoFinal(TEE_OperationHandle operation, const void *chunk, size_t chunkLen, void *hash, - size_t *hashLen); - -/** - * @brief Initializes a MAC operation. - * - * @param operation Indicates the operation handle. - * @param IV Indicates the pointer to the buffer storing the operation IV. If this parameter is not used, - * set it to NULL. - * @param IVLen Indicates the length of the IV buffer. - * - * @since 12 - * @version 1.0 - */ -void TEE_MACInit(TEE_OperationHandle operation, void *IV, size_t IVLen); - -/** - * @brief Updates the MAC. - * - * @param operation Indicates the operation handle. - * @param chunk Indicates the pointer to the chunk of MAC data. - * @param chunkSize Indicates the size of the chunk. - * - * @since 12 - * @version 1.0 - */ -void TEE_MACUpdate(TEE_OperationHandle operation, const void *chunk, size_t chunkSize); - -/** - * @brief MAC Finalizes the MAC operation with a last chunk of message and computes the MAC. - * - * @param operation Indicates the operation handle. - * @param message Indicates the pointer to the buffer containing the last message chunk to MAC. - * @param messageLen Indicates the length of the message buffer. - * @param mac Indicates the pointer to the buffer storing the computed MAC. - * @param macLen Indicates the pointer to the MAC buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_MACComputeFinal(TEE_OperationHandle operation, const void *message, size_t messageLen, void *mac, - size_t *macLen); - -/** - * @brief Finalizes the MAC operation and compares the MAC with the one passed in. - * - * @param operation Indicates the operation handle. - * @param message Indicates the pointer to the buffer containing the last message chunk to MAC. - * @param messageLen Indicates the length of the buffer. - * @param mac Indicates the pointer to the buffer storing the computed MAC. - * @param macLen Indicates the MAC buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * Returns TEE_ERROR_MAC_INVALID if the computed MAC is not the same as that passed in. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_MACCompareFinal(TEE_OperationHandle operation, const void *message, size_t messageLen, const void *mac, - const size_t macLen); - -/** - * @brief Derives a key. - * - * @param operation Indicates the operation handle. - * @param params Indicates the pointer to the parameters for this operation. - * @param paramCount Indicates the number of parameters. - * @param derivedKey Indicates the derived key. - * - * @since 12 - * @version 1.0 - */ -void TEE_DeriveKey(TEE_OperationHandle operation, const TEE_Attribute *params, uint32_t paramCount, - TEE_ObjectHandle derivedKey); - -/** - * @brief Generates random data. - * - * @param randomBuffer Indicates the pointer to the buffer storing the random data generated. - * @param randomBufferLen Indicates the length of the buffer storing the random data. - * - * @since 12 - * @version 1.0 - */ -void TEE_GenerateRandom(void *randomBuffer, size_t randomBufferLen); - -/** - * @brief Initializes an AE operation. - * - * @param operation Indicates the operation handle. - * @param nonce Indicates the pointer to the buffer for storing the nonce. - * @param nonceLen Indicates the length of the nonce. - * @param tagLen Indicates the length of the tag. - * @param AADLen Indicates the length of the AAD. - * @param payloadLen Indicates the length of the payload. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AEInit(TEE_OperationHandle operation, void *nonce, size_t nonceLen, uint32_t tagLen, size_t AADLen, - size_t payloadLen); - -/** - * @brief Updates the AAD in an AE operation. - * - * @param operation Indicates the operation handle. - * @param AADdata Indicates the pointer to the new AAD. - * @param AADdataLen Indicates the length of the new AAD. - * - * @since 12 - * @version 1.0 - */ -void TEE_AEUpdateAAD(TEE_OperationHandle operation, const void *AADdata, size_t AADdataLen); - -/** - * @brief Updates data for an AE operation. - * - * @param operation Indicates the operation handle. - * @param srcData Indicates the pointer to the source data. - * @param srcLen Indicates the length of the source data. - * @param destData Indicates the pointer to the destination data. - * @param destLen Indicates the pointer to the destination data length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AEUpdate(TEE_OperationHandle operation, void *srcData, size_t srcLen, void *destData, size_t *destLen); - -/** - * @brief Finalizes the AE encryption operation. - * - * @param operation Indicates the operation handle. - * @param srcData Indicates the pointer to the source data. - * @param srcLen Indicates the length of the source data. - * @param destData Indicates the pointer to the destination data. - * @param destLen Indicates the pointer to the destination data length. - * @param tag Indicates the pointer to the buffer storing the computed tag. - * @param tagLen Indicates the pointer to the tag buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AEEncryptFinal(TEE_OperationHandle operation, void *srcData, size_t srcLen, void *destData, - size_t *destLen, void *tag, size_t *tagLen); - -/** - * @brief Finalizes an AE decryption operation. - * - * @param operation Indicates the operation handle. - * @param srcData Indicates the pointer to the source data. - * @param srcLen Indicates the length of the source data. - * @param destData Indicates the pointer to the destination data. - * @param destLen Indicates the pointer to the destination data length. - * @param tag Indicates the pointer to the buffer storing the computed tag. - * @param tagLen Indicates the tag buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_MAC_INVALID if the computed tag does not match the provided tag. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AEDecryptFinal(TEE_OperationHandle operation, void *srcData, size_t srcLen, void *destData, - size_t *destLen, void *tag, size_t tagLen); - -/** - * @brief Performs asymmetric encryption. - * - * @param operation Indicates the operation handle. - * @param params Indicates the pointer to the parameters for this operation. - * @param paramCount Indicates the number of parameters. - * @param srcData Indicates the pointer to the source data. - * @param srcLen Indicates the length of the source data. - * @param destData Indicates the pointer to the destination data. - * @param destLen Indicates the pointer to the destination data length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AsymmetricEncrypt(TEE_OperationHandle operation, const TEE_Attribute *params, uint32_t paramCount, - void *srcData, size_t srcLen, void *destData, size_t *destLen); - -/** - * @brief Performs asymmetric decryption. - * - * @param operation Indicates the operation handle. - * @param params Indicates the pointer to the parameters for this operation. - * @param paramCount Indicates the number of parameters. - * @param srcData Indicates the pointer to the source data. - * @param srcLen Indicates the length of the source data. - * @param destData Indicates the pointer to the destination data. - * @param destLen Indicates the pointer to the destination data length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AsymmetricDecrypt(TEE_OperationHandle operation, const TEE_Attribute *params, uint32_t paramCount, - void *srcData, size_t srcLen, void *destData, size_t *destLen); - -/** - * @brief Signs a message digest in an asymmetric operation. - * - * @param operation Indicates the operation handle. - * @param params Indicates the pointer to the parameters for this operation. - * @param paramCount Indicates the number of parameters. - * @param digest Indicates the pointer to the message digest. - * @param digestLen Indicates the digest length. - * @param signature Indicates the pointer to the signature. - * @param signatureLen Indicates the pointer to the signature length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AsymmetricSignDigest(TEE_OperationHandle operation, const TEE_Attribute *params, uint32_t paramCount, - void *digest, size_t digestLen, void *signature, size_t *signatureLen); - -/** - * @brief Verifies a message digest signature in an asymmetric operation. - * - * @param operation Indicates the operation handle. - * @param params Indicates the pointer to the parameters for this operation. - * @param paramCount Indicates the number of parameters. - * @param digest Indicates the pointer to the message digest. - * @param digestLen Indicates the digest length. - * @param signature Indicates the pointer to the signature. - * @param signatureLen Indicates the signature length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AsymmetricVerifyDigest(TEE_OperationHandle operation, const TEE_Attribute *params, uint32_t paramCount, - void *digest, size_t digestLen, void *signature, size_t signatureLen); - -/** - * @brief Obtains information about the operation involving multiple keys. - * - * @param operation Indicates the operation handle. - * @param operationInfoMultiple Indicates the pointer to the operation information obtained. - * @param operationSize [IN/OUT] Indicates the pointer to the operation information size. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_SHORT_BUFFER if the operationInfo buffer is not large enough to - * hold the information obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetOperationInfoMultiple(TEE_OperationHandle operation, TEE_OperationInfoMultiple *operationInfoMultiple, - const size_t *operationSize); - -/** - * @brief Checks whether the algorithm is supported. - * - * @param algId Indicates the algorithm to check. - * @param element Indicates the cryptographic element. - * - * @return Returns TEE_SUCCESS if the algorithm is supported. - * Returns TEE_ERROR_NOT_SUPPORTED otherwise. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_IsAlgorithmSupported(uint32_t algId, uint32_t element); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_crypto_hal.h b/tee/include/tee_crypto_hal.h deleted file mode 100644 index 6ae67f9a9..000000000 --- a/tee/include/tee_crypto_hal.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TEE_CRYPTO_HAL_H -#define TEE_CRYPTO_HAL_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_crypto_hal.h - * - * @brief Provides APIs for cryptographic operations. - * - * You can use these APIs to implement encryption and decryption. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_crypto_api.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Enumerates the types of the crypto engine. - * - * @since 12 - */ -enum CRYPTO_ENGINE { - SOFT_CRYPTO = 2, - CRYPTO_ENGINE_MAX = 1024, -}; - -/** - * @brief Sets the encryption and decryption engines to an operation. - * - * @param operation Indicates the handle of the operation to set. - * @param crypto Indicates the engines to set. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if operation is null or crypto is invalid. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SetCryptoFlag(TEE_OperationHandle operation, uint32_t crypto); - -/** - * @brief Sets the encryption and decryption engines to an object. - * - * @param object Indicates the handle of the object to set. - * @param crypto Indicates the engines to set. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if object is null or crypto is invalid. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SetObjectFlag(TEE_ObjectHandle object, uint32_t crypto); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif - diff --git a/tee/include/tee_defines.h b/tee/include/tee_defines.h deleted file mode 100644 index e427afd12..000000000 --- a/tee/include/tee_defines.h +++ /dev/null @@ -1,607 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __TEE_DEFINES_H -#define __TEE_DEFINES_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_defines.h - * - * @brief Defines basic data types and data structures of TEE. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif -#ifndef TA_EXPORT -#define TA_EXPORT -#endif - -/** - * @brief Defines the tee mutex handle. - * - * @since 12 - */ -typedef int *tee_mutex_handle; - -#define API_LEVEL1_1_1 2 -#define API_LEVEL1_2 3 - -#define TEE_PARAMS_NUM 4 -#undef true -#define true 1 - -#undef false -#define false 0 - -#ifndef NULL -#define NULL ((void *)0) -#endif - -#define PARAM_NOT_USED(val) ((void)(val)) - -/** - * @brief Enumerates the TEE parameter. - * - * @since 12 - */ -typedef union { - struct { - void *buffer; - size_t size; - } memref; - struct { - unsigned int a; - unsigned int b; - } value; - struct { - void *buffer; - size_t size; - } sharedmem; -} TEE_Param; - -#define TEE_PARAM_TYPES(param0Type, param1Type, param2Type, param3Type) \ - (((param3Type) << 12) | ((param2Type) << 8) | ((param1Type) << 4) | (param0Type)) - -#define TEE_PARAM_TYPE_GET(paramTypes, index) (((paramTypes) >> (4U * (index))) & 0x0F) - -/** - * @brief Checks parameter types. - * - * @param param_to_check Indicates the expected parameter values. - * @param valid0 Indicates the first parameter type to check. - * @param valid1 Indicates the second parameter type to check. - * @param valid2 Indicates the third parameter type to check. - * @param valid3 Indicates the fourth parameter type to check. - * - * @return Returns true if the parameter types are correct. - * Returns false otherwise. - * @since 12 - */ -static inline bool check_param_type(uint32_t param_to_check, uint32_t valid0, uint32_t valid1, uint32_t valid2, - uint32_t valid3) -{ - return (TEE_PARAM_TYPES(valid0, valid1, valid2, valid3) == param_to_check); -} - -/** - * @brief Enumerates the types of the TEE parameter. - * - * @since 12 - */ -enum TEE_ParamType { - TEE_PARAM_TYPE_NONE = 0x0, - TEE_PARAM_TYPE_VALUE_INPUT = 0x1, - TEE_PARAM_TYPE_VALUE_OUTPUT = 0x2, - TEE_PARAM_TYPE_VALUE_INOUT = 0x3, - TEE_PARAM_TYPE_MEMREF_INPUT = 0x5, - TEE_PARAM_TYPE_MEMREF_OUTPUT = 0x6, - TEE_PARAM_TYPE_MEMREF_INOUT = 0x7, - TEE_PARAM_TYPE_ION_INPUT = 0x8, - TEE_PARAM_TYPE_ION_SGLIST_INPUT = 0x9, - TEE_PARAM_TYPE_MEMREF_SHARED_INOUT = 0xa, - TEE_PARAM_TYPE_RESMEM_INPUT = 0xc, - TEE_PARAM_TYPE_RESMEM_OUTPUT = 0xd, - TEE_PARAM_TYPE_RESMEM_INOUT = 0xe, -}; - -#define S_VAR_NOT_USED(variable) \ - do { \ - (void)(variable); \ - } while (0) - -/** - * @brief Defines an object information. - * - * @since 12 - */ -typedef struct { - uint32_t objectType; - uint32_t objectSize; - uint32_t maxObjectSize; - uint32_t objectUsage; - uint32_t dataSize; - uint32_t dataPosition; - uint32_t handleFlags; -} TEE_ObjectInfo; - -/** - * @brief Defines an object attribute. - * - * @since 12 - */ -typedef struct { - uint32_t attributeID; - union { - struct { - void *buffer; - size_t length; - } ref; - struct { - uint32_t a; - uint32_t b; - } value; - } content; -} TEE_Attribute; - -/** - * @brief Enumerates the types of object attribute. - * - * @since 12 - */ -enum TEE_ObjectAttribute { - TEE_ATTR_SECRET_VALUE = 0xC0000000, - TEE_ATTR_RSA_MODULUS = 0xD0000130, - TEE_ATTR_RSA_PUBLIC_EXPONENT = 0xD0000230, - TEE_ATTR_RSA_PRIVATE_EXPONENT = 0xC0000330, - TEE_ATTR_RSA_PRIME1 = 0xC0000430, - TEE_ATTR_RSA_PRIME2 = 0xC0000530, - TEE_ATTR_RSA_EXPONENT1 = 0xC0000630, - TEE_ATTR_RSA_EXPONENT2 = 0xC0000730, - TEE_ATTR_RSA_COEFFICIENT = 0xC0000830, - TEE_ATTR_RSA_MGF1_HASH = 0xF0000830, - TEE_ATTR_DSA_PRIME = 0xD0001031, - TEE_ATTR_DSA_SUBPRIME = 0xD0001131, - TEE_ATTR_DSA_BASE = 0xD0001231, - TEE_ATTR_DSA_PUBLIC_VALUE = 0xD0000131, - TEE_ATTR_DSA_PRIVATE_VALUE = 0xC0000231, - TEE_ATTR_DH_PRIME = 0xD0001032, - TEE_ATTR_DH_SUBPRIME = 0xD0001132, - TEE_ATTR_DH_BASE = 0xD0001232, - TEE_ATTR_DH_X_BITS = 0xF0001332, - TEE_ATTR_DH_PUBLIC_VALUE = 0xD0000132, - TEE_ATTR_DH_PRIVATE_VALUE = 0xC0000232, - TEE_ATTR_RSA_OAEP_LABEL = 0xD0000930, - TEE_ATTR_RSA_PSS_SALT_LENGTH = 0xF0000A30, - TEE_ATTR_ECC_PUBLIC_VALUE_X = 0xD0000141, - TEE_ATTR_ECC_PUBLIC_VALUE_Y = 0xD0000241, - TEE_ATTR_ECC_PRIVATE_VALUE = 0xC0000341, - TEE_ATTR_ECC_CURVE = 0xF0000441, - TEE_ATTR_ED25519_CTX = 0xD0000643, - TEE_ATTR_ED25519_PUBLIC_VALUE = 0xD0000743, - TEE_ATTR_ED25519_PRIVATE_VALUE = 0xC0000843, - TEE_ATTR_ED25519_PH = 0xF0000543, - TEE_ATTR_X25519_PUBLIC_VALUE = 0xD0000944, - TEE_ATTR_X25519_PRIVATE_VALUE = 0xC0000A44, - TEE_ATTR_PBKDF2_HMAC_PASSWORD = 0xD0000133, - TEE_ATTR_PBKDF2_HMAC_SALT = 0xD0000134, - TEE_ATTR_PBKDF2_HMAC_DIGEST = 0xF0000135, -}; - -/** - * @brief Enumerates the types of object. - * - * @since 12 - */ -enum TEE_ObjectType { - TEE_TYPE_AES = 0xA0000010, - TEE_TYPE_DES = 0xA0000011, - TEE_TYPE_DES3 = 0xA0000013, - TEE_TYPE_HMAC_MD5 = 0xA0000001, - TEE_TYPE_HMAC_SHA1 = 0xA0000002, - TEE_TYPE_HMAC_SHA224 = 0xA0000003, - TEE_TYPE_HMAC_SHA256 = 0xA0000004, - TEE_TYPE_HMAC_SHA384 = 0xA0000005, - TEE_TYPE_HMAC_SHA512 = 0xA0000006, - TEE_TYPE_RSA_PUBLIC_KEY = 0xA0000030, - TEE_TYPE_RSA_KEYPAIR = 0xA1000030, - TEE_TYPE_DSA_PUBLIC_KEY = 0xA0000031, - TEE_TYPE_DSA_KEYPAIR = 0xA1000031, - TEE_TYPE_DH_KEYPAIR = 0xA1000032, - TEE_TYPE_GENERIC_SECRET = 0xA0000000, - TEE_TYPE_DATA = 0xA1000033, - TEE_TYPE_DATA_GP1_1 = 0xA00000BF, - TEE_TYPE_ECDSA_PUBLIC_KEY = 0xA0000041, - TEE_TYPE_ECDSA_KEYPAIR = 0xA1000041, - TEE_TYPE_ECDH_PUBLIC_KEY = 0xA0000042, - TEE_TYPE_ECDH_KEYPAIR = 0xA1000042, - TEE_TYPE_ED25519_PUBLIC_KEY = 0xA0000043, - TEE_TYPE_ED25519_KEYPAIR = 0xA1000043, - TEE_TYPE_X25519_PUBLIC_KEY = 0xA0000044, - TEE_TYPE_X25519_KEYPAIR = 0xA1000044, - TEE_TYPE_SM2_DSA_PUBLIC_KEY = 0xA0000045, - TEE_TYPE_SM2_DSA_KEYPAIR = 0xA1000045, - TEE_TYPE_SM2_KEP_PUBLIC_KEY = 0xA0000046, - TEE_TYPE_SM2_KEP_KEYPAIR = 0xA1000046, - TEE_TYPE_SM2_PKE_PUBLIC_KEY = 0xA0000047, - TEE_TYPE_SM2_PKE_KEYPAIR = 0xA1000047, - TEE_TYPE_HMAC_SM3 = 0xA0000007, - TEE_TYPE_SM4 = 0xA0000014, - TEE_TYPE_SIP_HASH = 0xF0000002, - TEE_TYPE_PBKDF2_HMAC = 0xF0000004, - - TEE_TYPE_CORRUPTED_OBJECT = 0xA00000BE, -}; - -#define OBJECT_NAME_LEN_MAX 255 - -/** - * @brief Defines an object handle. - * - * @since 12 - */ -struct __TEE_ObjectHandle { - void *dataPtr; - uint32_t dataLen; - uint8_t dataName[OBJECT_NAME_LEN_MAX]; - TEE_ObjectInfo *ObjectInfo; - TEE_Attribute *Attribute; - uint32_t attributesLen; - uint32_t CRTMode; - void *infoattrfd; - uint32_t generate_flag; - uint32_t storage_id; -}; - -/** - * @brief Defines the __TEE_ObjectHandle struct. - * - * @see __TEE_ObjectHandle - * - * @since 12 - */ -typedef struct __TEE_ObjectHandle *TEE_ObjectHandle; - -#define NODE_LEN 8 - -/** - * @brief Defines an UUID of TA. - * - * @since 12 - */ -typedef struct tee_uuid { - uint32_t timeLow; - uint16_t timeMid; - uint16_t timeHiAndVersion; - uint8_t clockSeqAndNode[NODE_LEN]; -} TEE_UUID; - -/** - * @brief Defines the type of spawn UUID. - * - * @since 12 - */ -typedef struct spawn_uuid { - uint64_t uuid_valid; - TEE_UUID uuid; -} spawn_uuid_t; - -/** - * @brief Enumerates the result codes used in the TEEKit APIs. - * - * @since 12 - */ -enum TEE_Result_Value { - /* The operation is successful. */ - TEE_SUCCESS = 0x00000000, - /* The command is invalid. */ - TEE_ERROR_INVALID_CMD = 0x00000001, - /* The service does not exist. */ - TEE_ERROR_SERVICE_NOT_EXIST = 0x00000002, - /* The session does not exist. */ - TEE_ERROR_SESSION_NOT_EXIST = 0x00000003, - /* The number of sessions exceeds the limit. */ - TEE_ERROR_SESSION_MAXIMUM = 0x00000004, - /* The service has been already registered. */ - TEE_ERROR_REGISTER_EXIST_SERVICE = 0x00000005, - /* An internal error occurs. */ - TEE_ERROR_TARGET_DEAD_FATAL = 0x00000006, - /* Failed to read data. */ - TEE_ERROR_READ_DATA = 0x00000007, - /* Failed to write data. */ - TEE_ERROR_WRITE_DATA = 0x00000008, - /* Failed to truncate data. */ - TEE_ERROR_TRUNCATE_OBJECT = 0x00000009, - /* Failed to seek data. */ - TEE_ERROR_SEEK_DATA = 0x0000000A, - /* Failed to synchronize data. */ - TEE_ERROR_SYNC_DATA = 0x0000000B, - /* Failed to rename the file. */ - TEE_ERROR_RENAME_OBJECT = 0x0000000C, - /* An error occurs when the TA is loaded. */ - TEE_ERROR_TRUSTED_APP_LOAD_ERROR = 0x0000000D, - /* An I/O error occurs when data is stored. */ - TEE_ERROR_STORAGE_EIO = 0x80001001, - /* The storage section is unavailable. */ - TEE_ERROR_STORAGE_EAGAIN = 0x80001002, - /* The operation target is not a directory. */ - TEE_ERROR_STORAGE_ENOTDIR = 0x80001003, - /* This operation cannot be performed on a directory. */ - TEE_ERROR_STORAGE_EISDIR = 0x80001004, - /* The number of opened files exceeds the limit in system. */ - TEE_ERROR_STORAGE_ENFILE = 0x80001005, - /* The number of files opened for the process exceeds the limit.*/ - TEE_ERROR_STORAGE_EMFILE = 0x80001006, - /* The storage section is read only. */ - TEE_ERROR_STORAGE_EROFS = 0x80001007, - /* The file path is not correct. */ - TEE_ERROR_STORAGE_PATH_WRONG = 0x8000100A, - /* The service message queue overflows. */ - TEE_ERROR_MSG_QUEUE_OVERFLOW = 0x8000100B, - /* The file object is corrupted. */ - TEE_ERROR_CORRUPT_OBJECT = 0xF0100001, - /* The storage section is unavailable. */ - TEE_ERROR_STORAGE_NOT_AVAILABLE = 0xF0100003, - /* The cipher text is incorrect. */ - TEE_ERROR_CIPHERTEXT_INVALID = 0xF0100006, - /* Protocol error in socket connection. */ - TEE_ISOCKET_ERROR_PROTOCOL = 0xF1007001, - /* The socket is closed by the remote end. */ - TEE_ISOCKET_ERROR_REMOTE_CLOSED = 0xF1007002, - /* The socket connection timed out. */ - TEE_ISOCKET_ERROR_TIMEOUT = 0xF1007003, - /* There is no resource available for the socket connection. */ - TEE_ISOCKET_ERROR_OUT_OF_RESOURCES = 0xF1007004, - /* The buffer is too large for the socket connection. */ - TEE_ISOCKET_ERROR_LARGE_BUFFER = 0xF1007005, - /* A warning is given in the socket connection. */ - TEE_ISOCKET_WARNING_PROTOCOL = 0xF1007006, - /* Generic error. */ - TEE_ERROR_GENERIC = 0xFFFF0000, - /* The access is denied. */ - TEE_ERROR_ACCESS_DENIED = 0xFFFF0001, - /* The operation has been canceled. */ - TEE_ERROR_CANCEL = 0xFFFF0002, - /* An access conflict occurs. */ - TEE_ERROR_ACCESS_CONFLICT = 0xFFFF0003, - /* The data size exceeds the maximum. */ - TEE_ERROR_EXCESS_DATA = 0xFFFF0004, - /* Incorrect data format. */ - TEE_ERROR_BAD_FORMAT = 0xFFFF0005, - /* Incorrect parameters. */ - TEE_ERROR_BAD_PARAMETERS = 0xFFFF0006, - /* The current state does not support the operation. */ - TEE_ERROR_BAD_STATE = 0xFFFF0007, - /* Failed to find the target item. */ - TEE_ERROR_ITEM_NOT_FOUND = 0xFFFF0008, - /* The API is not implemented. */ - TEE_ERROR_NOT_IMPLEMENTED = 0xFFFF0009, - /* The API is not supported. */ - TEE_ERROR_NOT_SUPPORTED = 0xFFFF000A, - /* There is no data available for this operation. */ - TEE_ERROR_NO_DATA = 0xFFFF000B, - /* There is no memory available for this operation. */ - TEE_ERROR_OUT_OF_MEMORY = 0xFFFF000C, - /* The system does not respond to this operation. */ - TEE_ERROR_BUSY = 0xFFFF000D, - /* Failed to communicate with the target. */ - TEE_ERROR_COMMUNICATION = 0xFFFF000E, - /* A security error occurs. */ - TEE_ERROR_SECURITY = 0xFFFF000F, - /* The buffer is insufficient for this operation. */ - TEE_ERROR_SHORT_BUFFER = 0xFFFF0010, - /* The operation has been canceled. */ - TEE_ERROR_EXTERNAL_CANCEL = 0xFFFF0011, - /* The service is in the pending state (asynchronous state). */ - TEE_PENDING = 0xFFFF2000, - /* The service is in the pending state(). */ - TEE_PENDING2 = 0xFFFF2001, - /* Reserved. */ - TEE_PENDING3 = 0xFFFF2002, - /* The operation timed out. */ - TEE_ERROR_TIMEOUT = 0xFFFF3001, - /* Overflow occurs. */ - TEE_ERROR_OVERFLOW = 0xFFFF300f, - /* The TA is crashed. */ - TEE_ERROR_TARGET_DEAD = 0xFFFF3024, - /* There is no enough space to store data. */ - TEE_ERROR_STORAGE_NO_SPACE = 0xFFFF3041, - /* The MAC operation failed. */ - TEE_ERROR_MAC_INVALID = 0xFFFF3071, - /* The signature verification failed. */ - TEE_ERROR_SIGNATURE_INVALID = 0xFFFF3072, - /* Interrupted by CFC. Broken control flow is detected. */ - TEE_CLIENT_INTR = 0xFFFF4000, - /* Time is not set. */ - TEE_ERROR_TIME_NOT_SET = 0xFFFF5000, - /* Time needs to be reset. */ - TEE_ERROR_TIME_NEEDS_RESET = 0xFFFF5001, - /* System error. */ - TEE_FAIL = 0xFFFF5002, - /* Base value of the timer error code. */ - TEE_ERROR_TIMER = 0xFFFF6000, - /* Failed to create the timer. */ - TEE_ERROR_TIMER_CREATE_FAILED = 0xFFFF6001, - /* Failed to destroy the timer. */ - TEE_ERROR_TIMER_DESTORY_FAILED = 0xFFFF6002, - /* The timer is not found. */ - TEE_ERROR_TIMER_NOT_FOUND = 0xFFFF6003, - /* Generic error of RPMB operations. */ - TEE_ERROR_RPMB_GENERIC = 0xFFFF7001, - /* Verify MAC failed in RPMB operations. */ - TEE_ERROR_RPMB_MAC_FAIL = 0xFFFF7002, - /* Incorrect message data MAC in RPMB response. */ - TEE_ERROR_RPMB_RESP_UNEXPECT_MAC = 0xFFFF7105, - /* The file is not found in RPMB. */ - TEE_ERROR_RPMB_FILE_NOT_FOUND = 0xFFFF7106, - /* No spece left for RPMB operations. */ - TEE_ERROR_RPMB_NOSPC = 0xFFFF7107, - /* sec flash is not available. */ - TEE_ERROR_SEC_FLASH_NOT_AVAILABLE = 0xFFFF7118, - /* The BIO service is not available. */ - TEE_ERROR_BIOSRV_NOT_AVAILABLE = 0xFFFF711A, - /* The ROT service is not available. */ - TEE_ERROR_ROTSRV_NOT_AVAILABLE = 0xFFFF711B, - /* The TA Anti-Rollback service is not available. */ - TEE_ERROR_ARTSRV_NOT_AVAILABLE = 0xFFFF711C, - /* The HSM service is not available. */ - TEE_ERROR_HSMSRV_NOT_AVAILABLE = 0xFFFF711D, - /* Failed to verify AntiRoot response. */ - TEE_ERROR_ANTIROOT_RSP_FAIL = 0xFFFF9110, - /* AntiRoot error in invokeCmd(). */ - TEE_ERROR_ANTIROOT_INVOKE_ERROR = 0xFFFF9111, - /* Audit failed. */ - TEE_ERROR_AUDIT_FAIL = 0xFFFF9112, - /* Unused. */ - TEE_FAIL2 = 0xFFFF9113, -}; - -/** - * @brief Login type definitions - * - * @since 12 - */ -enum TEE_LoginMethod { - TEE_LOGIN_PUBLIC = 0x0, - TEE_LOGIN_USER, - TEE_LOGIN_GROUP, - TEE_LOGIN_APPLICATION = 0x4, - TEE_LOGIN_USER_APPLICATION = 0x5, - TEE_LOGIN_GROUP_APPLICATION = 0x6, - TEE_LOGIN_IDENTIFY = 0x7, /* Customized login type */ -}; - -/** - * @brief Definitions the TEE Identity. - * - * @since 12 - */ -typedef struct { - uint32_t login; - TEE_UUID uuid; -} TEE_Identity; - -/** - * @brief Defines the return values. - * - * @since 12 - * @version 1.0 - */ -typedef uint32_t TEE_Result; - -/** - * @brief Defines the return values. - * - * @since 12 - * @version 1.0 - */ -typedef TEE_Result TEEC_Result; - -#define TEE_ORIGIN_TEE 0x00000003 -#define TEE_ORIGIN_TRUSTED_APP 0x00000004 - -#ifndef _TEE_TA_SESSION_HANDLE -#define _TEE_TA_SESSION_HANDLE -/** - * @brief Defines the handle of TA session. - * - * @since 12 - */ -typedef uint32_t TEE_TASessionHandle; -#endif - -/** - * @brief Defines the pointer to TEE_ObjectEnumHandle. - * - * @see __TEE_ObjectEnumHandle - * - * @since 12 - */ -typedef struct __TEE_ObjectEnumHandle *TEE_ObjectEnumHandle; - -/** - * @brief Defines the pointer to __TEE_OperationHandle. - * - * @see __TEE_OperationHandle - * - * @since 12 - */ -typedef struct __TEE_OperationHandle *TEE_OperationHandle; - -#define TEE_TIMEOUT_INFINITE (0xFFFFFFFF) - -/** - * @brief Definitions the TEE time. - * - * @since 12 - */ -typedef struct { - uint32_t seconds; - uint32_t millis; -} TEE_Time; - -/** - * @brief Definitions the date time of TEE. - * - * @since 12 - */ -typedef struct { - int32_t seconds; - int32_t millis; - int32_t min; - int32_t hour; - int32_t day; - int32_t month; - int32_t year; -} TEE_Date_Time; - -/** - * @brief Definitions the timer property of TEE. - * - * @since 12 - */ -typedef struct { - uint32_t type; - uint32_t timer_id; - uint32_t timer_class; - uint32_t reserved2; -} TEE_timer_property; - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_drv_client.h b/tee/include/tee_drv_client.h deleted file mode 100644 index 4adca85f7..000000000 --- a/tee/include/tee_drv_client.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef TEE_DRV_CLIENT_H -#define TEE_DRV_CLIENT_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_drv_client.h - * - * @brief Declare tee driver client API. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Open the specified driver in the TEE. - * - * @param drv_name [IN] The driver name. - * @param param [IN] The parameter information. - * @param param_len [IN] The length of the parameter. - * - * @return Returns greater than 0, which means the fd of the corresponding driver. - * Returns less than or equal to 0, which means falied to open the driver. - * - * @since 12 - * @version 1.0 - */ -int64_t tee_drv_open(const char *drv_name, const void *param, uint32_t param_len); - -/** - * @brief Cancels an operation. - * - * @param fd [IN] The file descriptor of the driver. - * @param cmd_id [IN] The command id. - * @param param [IN] The parameter information. - * @param param_len [IN] The length of the parameter. - * - * @return Returns 0 if the operation is successful. - * Returns -1 if the operation is failed. - * - * @since 12 - * @version 1.0 - */ -int64_t tee_drv_ioctl(int64_t fd, uint32_t cmd_id, const void *param, uint32_t param_len); - -/** - * @brief Open the specified driver in the TEE. - * - * @param fd [IN] The file descriptor of the driver. - * - * @return Returns 0 if the operation is successful. - * Returns -1 if the operation is failed. - * - * @since 12 - * @version 1.0 - */ -int64_t tee_drv_close(int64_t fd); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif - diff --git a/tee/include/tee_dynamic_srv.h b/tee/include/tee_dynamic_srv.h deleted file mode 100644 index 37ef28f68..000000000 --- a/tee/include/tee_dynamic_srv.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _TEE_DYNAMIC_SRV_H_ -#define _TEE_DYNAMIC_SRV_H_ - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_dynamic_srv.h - * - * @brief Provides APIs related to dynamic service development. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include -#include "tee_service_public.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Defines thread initialization information of the dynamic service. - * - * @since 12 - */ -struct srv_thread_init_info { - void *(*func)(void *arg); - /** The maximum number of parallel threads. */ - uint32_t max_thread; - int32_t shadow; - /** The stack size of the thread. */ - uint32_t stack_size; - /** The timeout period for thread (in seconds).*/ - uint32_t time_out_sec; -}; - -typedef void (*srv_dispatch_fn_t)(tee_service_ipc_msg *msg, - uint32_t sndr, tee_service_ipc_msg_rsp *rsp); - -struct srv_dispatch_t { - uint32_t cmd; - srv_dispatch_fn_t fn; -}; - -/** - * @brief Get UUID by sender. - * - * @param sender [IN] Indicates the sender's task Id. - * @param uuid [OUT] Indicates the universally unique identifier. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if the input parameter is incorrect, - * or the file name is longer than 64 bytes. - * Returns {@code TEE_ERROR_ITEM_NOT_FOUND} if failed to find the corresponding UUID by sender. - * Returns {@code TEE_ERROR_GENERIC} if failed to obtain the UUID. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_srv_get_uuid_by_sender(uint32_t sender, TEE_UUID *uuid); - -/** - * @brief Releasing the object mapping of a specified address area. - * - * @param va_addr [IN] Indicates the address of the memory area to be released. - * @param size [IN] Indicates the size of the released memory area. - * - * @since 12 - * @version 1.0 - */ -void tee_srv_unmap_from_task(uint32_t va_addr, uint32_t size); - -/** - * @brief Create a new mapping in the virtual address space of the calling process. - * - * @param in_task_id [IN] Indicates the task Id. - * @param va_addr [IN] Indicates the address of the memory area to be mapped. - * @param size [IN] Indicates the size of the memory area to be mapped. - * @param virt_addr [OUT] Indicates the new mapping vitural address. - * - * @return Returns 0 if the operation is successful. - * @return Returns -1 if the operation is failed. - * - * @since 12 - * @version 1.0 - */ -int tee_srv_map_from_task(uint32_t in_task_id, uint32_t va_addr, uint32_t size, uint32_t *virt_addr); - -/** - * @brief Dispatch task by task name. - * - * @param task_name [IN] Indicates the task name. - * @param dispatch [IN] Indicates the dispatch information. - * @param n_dispatch [IN] Indicates the dispatch number. - * @param cur_thread [IN] Indicates the current thread information. - * - * @since 12 - * @version 1.0 - */ -void tee_srv_cs_server_loop(const char *task_name, const struct srv_dispatch_t *dispatch, - uint32_t n_dispatch, struct srv_thread_init_info *cur_thread); -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_ext_api.h b/tee/include/tee_ext_api.h deleted file mode 100644 index 37481f6c6..000000000 --- a/tee/include/tee_ext_api.h +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TEE_EXT_API_H -#define TEE_EXT_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_ext_api.h - * - * @brief Provides extended interfaces. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" -#include "tee_hw_ext_api.h" - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif /* __cpluscplus */ -#endif /* __cpluscplus */ - -/** - * @brief Defines the value of invalid user ID. - * - * @since 12 - */ -#define INVALID_USERID 0xFFFFFFFU - -/** - * @brief Defines the SMC from user mode. - * - * @since 12 - */ -#define TEE_SMC_FROM_USR 0 - -/** - * @brief Defines the SMC from kernel mode. - * - * @since 12 - */ -#define TEE_SMC_FROM_KERNEL 1 - -/** - * @brief Defines the szie of reserved buffer. - * - * @since 12 - */ -#define RESERVED_BUF_SIZE 32 - -/** - * @brief Defines the caller information. - * - * @since 12 - */ -typedef struct ta_caller_info { - uint32_t session_type; - union { - struct { - TEE_UUID caller_uuid; - uint32_t group_id; - }; - uint8_t ca_info[RESERVED_BUF_SIZE]; - } caller_identity; - uint8_t smc_from_kernel_mode; - uint8_t reserved[RESERVED_BUF_SIZE - 1]; -} caller_info; - -/** - * @brief Get caller info of current session, refer caller_info struct for more details. - * - * @param ca_name Indicates the process name of the caller of the CA. - * @param ca_uid Indicates the UID of the caller. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other information otherwise. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_get_caller_info(caller_info *caller_info_data, uint32_t length); - -/** - * @brief Get user ID of current TA. - * - * @param user_id Indicates the user ID to be returned. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other information otherwise. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_get_caller_userid(uint32_t *user_id); - -/** - * @brief Adds information about a caller that can invoke this TA. - * This API applies to the client applications (CAs) in the binary executable file format. - * - * @param ca_name Indicates the process name of the caller of the CA. - * @param ca_uid Indicates the UID of the caller. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other information otherwise. - * - * @since 12 - * @version 1.0 - */ -TEE_Result AddCaller_CA_exec(const char *ca_name, uint32_t ca_uid); - -/** - * @brief Adds information about a caller that can invoke this TA. - * This API applies to the client applications (CAs) in the native CA and HAP format. - * - * @param cainfo_hash Indicates the hash value of the CA caller information. - * @param length Indicates the length of the hash value. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other information otherwise. - * - * @since 12 - * @version 1.0 - */ -TEE_Result AddCaller_CA(const uint8_t *cainfo_hash, uint32_t length); - -/** - * @brief TA call this API allow others TA open session with itself. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other information otherwise. - * - * @since 12 - * @version 1.0 - */ -TEE_Result AddCaller_TA_all(void); - -/** - * @brief Defines the session caller from CA. - * - * @since 12 - */ -#define SESSION_FROM_CA 0 - -/** - * @brief Defines the session caller from TA. - * - * @since 12 - */ -#define SESSION_FROM_TA 1 - -/** - * @brief Defines the TA task is not found, for example, from TA sub thread. - * - * @since 12 - */ -#define SESSION_FROM_NOT_SUPPORTED 0xFE - -/** - * @brief Defines the TA caller is not found. - * - * @since 12 - */ -#define SESSION_FROM_UNKNOWN 0xFF - -/** - * @brief Obtains the session type. - * - * @return Returns the session type obtained. - * - * @since 12 - * @version 1.0 - */ -uint32_t tee_get_session_type(void); - -#ifdef __cplusplus -#if __cplusplus -} -#endif /* __cpluscplus */ -#endif /* __cpluscplus */ - -#endif diff --git a/tee/include/tee_hw_ext_api.h b/tee/include/tee_hw_ext_api.h deleted file mode 100644 index 3fb350367..000000000 --- a/tee/include/tee_hw_ext_api.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TEE_HW_EXT_API_H -#define TEE_HW_EXT_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_hw_ext_api.h - * - * @brief Provides extended interfaces. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Obtains the unique device ID from the TEE. - * - * @param device_unique_id Indicates the pointer to the buffer for storing the device ID. - * @param length Indicates the pointer to the buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other information otherwise. - * - * @since 12 - */ -TEE_Result tee_ext_get_device_unique_id(uint8_t *device_unique_id, uint32_t *length); - -/** - * @brief Defines the memory information. - * - * @since 12 - */ -struct meminfo_t { - uint64_t buffer; - uint32_t size; -}; - -/** - * @brief Derive key from device rootkey and UUID of the current task for iteration. - * - * @param salt [IN] Indicates the data for salt. - * @param key [OUT] Indicates the pointer where key is saved. - * @param outer_iter_num [IN] Indicates the iteration times in huk service. - * @param inner_iter_num [IN] Indicates the iteration times in platform driver. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_GENERIC} if the processing failed. - * - * @since 12 - */ -TEE_Result tee_ext_derive_key_iter(const struct meminfo_t *salt, struct meminfo_t *key, - uint32_t outer_iter_num, uint32_t inner_iter_num); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/tee_hw_ext_api_legacy.h b/tee/include/tee_hw_ext_api_legacy.h deleted file mode 100644 index c50471ea9..000000000 --- a/tee/include/tee_hw_ext_api_legacy.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __TEE_HW_EXT_API_LEGACY_H__ -#define __TEE_HW_EXT_API_LEGACY_H__ - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_hw_ext_api_legacy.h - * - * @brief Provides extended interfaces. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Derive key from device root key. - * - * @param salt [IN] Indicates the data for salt. - * @param size [IN] Indicates the length of salt. - * @param key [OUT] Indicates the pointer where key is saved. - * @param key_size [IN] Indicates the size of the key, which must be integer times of 16. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_GENERIC} if the processing failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_EXT_DeriveTARootKey(const uint8_t *salt, uint32_t size, uint8_t *key, uint32_t key_size); - -/** - * @brief Derive key from device root key by HUK2. - * @attention If the device does not support HUK2, the key is derived by HUK. - * - * @param salt [IN] Indicates the data for salt. - * @param size [IN] Indicates the length of salt. - * @param key [OUT] Indicates the pointer where key is saved. - * @param key_size [IN] Indicates the size of the key, which must be integer times of 16. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_GENERIC} if the processing failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_derive_ta_root_key_by_huk2(const uint8_t *salt, uint32_t size, uint8_t *key, uint32_t key_size); - -/** - * @brief Derive key from device root key by HUK2. - * @attention If the device does not support HUK2, the key is derived by HUK. - * - * @param secret [IN] Indicates the input secret. - * @param secret_len [IN] Indicates the length of the input secret. - * @param key [OUT] Indicates the derived key. - * @param key_len [IN] Indicates the length of the derived key. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_GENERIC} if the processing failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_root_derive_key2_by_huk2(const uint8_t *secret, uint32_t secret_len, uint8_t *key, uint32_t key_len); - -/** - * @brief Derive key from device root key and UUID of the current task by HUK2. - * @attention If the device does not support HUK2, the key is derived by HUK. - * - * @param salt [IN] Indicates the data for salt. - * @param size [IN] Indicates the length of salt. - * @param key [OUT] Indicates the pointer where key is saved. - * @param key_size [IN] Indicates the size of the generated key, fix-size 32 bytes. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_GENERIC} if the processing failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_root_uuid_derive_key_by_huk2(const uint8_t *salt, uint32_t size, uint8_t *key, uint32_t key_size); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_internal_se_api.h b/tee/include/tee_internal_se_api.h deleted file mode 100644 index 9e4ad28e6..000000000 --- a/tee/include/tee_internal_se_api.h +++ /dev/null @@ -1,498 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TEE_INTERNAL_SE_API_H -#define TEE_INTERNAL_SE_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_internal_se_api.h - * - * @brief Provides APIs related to the TEE Secure Element. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct __TEE_SEServiceHandle; -struct __TEE_SEReaderHandle; -struct __TEE_SESessionHandle; -struct __TEE_SEChannelHandle; - -typedef struct __TEE_SEServiceHandle *TEE_SEServiceHandle; -typedef struct __TEE_SEReaderHandle *TEE_SEReaderHandle; -typedef struct __TEE_SESessionHandle *TEE_SESessionHandle; -typedef struct __TEE_SEChannelHandle *TEE_SEChannelHandle; - -#define ATR_LEN_MAX 32U -#define AID_LEN_MIN 5U -#define AID_LEN_MAX 16U - -/** - * @brief Defines the maximum of the logic channel. - * - * @since 12 - */ -#define SE_LOGIC_CHANNEL_MAX 8U - -#define TEE_SC_TYPE_SCP03 0x01 - -#define BYTE_LEN 8 - -/** - * @brief Represents the properties of the SE reader. - * - * @since 12 - */ -typedef struct __TEE_SEReaderProperties { - /** If an SE is present in the reader, the value is true. */ - bool sePresent; - /** If this reader is only accessible via the TEE, the value is true. */ - bool teeOnly; - /** If the response to a SELECT is available in the TEE, the value is true.*/ - bool selectResponseEnable; -} TEE_SEReaderProperties; - -/** - * @brief Defines the SE AID. - * - * @since 12 - */ -typedef struct __TEE_SEAID { - /** The value of the applet's AID. */ - uint8_t *buffer; - /** The lenght of the applet's AID. */ - uint32_t bufferLen; -} TEE_SEAID; - -/** - * @brief Enumerates the types of the key. - * - * @since 12 - */ -typedef enum { - /** A base key acc. to SCP02. */ - TEE_SC_BASE_KEY = 0, - /** A key set (key-MAC, key_ENC) acc. to SCP02, SCP03. */ - TEE_SC_KEY_SET = 1 -} TEE_SC_KeyType; - -typedef struct __TEE_SC_KeySetRef { - /** Key-ENC (Static encryption key). */ - TEE_ObjectHandle scKeyEncHandle; - /** Key-MAC (Static MAC key). */ - TEE_ObjectHandle scKeyMacHandle; -} TEE_SC_KeySetRef; - -/** - * @brief Enumerates the levels of the security. - * - * @since 12 - */ -typedef enum { - /** Nothing will be applied. */ - TEE_SC_NO_SECURE_MESSAGING = 0x00, - /** Command and response APDU not be secured. */ - TEE_SC_AUTHENTICATE = 0x80, - /** Command APDU shall be MAC protected. */ - TEE_SC_C_MAC = 0x01, - /** Response APDU shall be MAC protected. */ - TEE_SC_R_MAC = 0x10, - /** Command and response APDU shall be MAC protected. */ - TEE_SC_CR_MAC = 0x11, - /** Command APDU shall be encrypted and MAC protected. */ - TEE_SC_C_ENC_MAC = 0x03, - /** Response APDU shall be encrypted and MAC protected. */ - TEE_SC_R_ENC_MAC = 0x30, - /** Command and response APDU shall be encrypted and MAC protected. */ - TEE_SC_CR_ENC_MAC = 0x33, - /** Command APDU shall be encrypted, and the command and response APDU shall be MAC protected.*/ - TEE_SC_C_ENC_CR_MAC = 0x13 -} TEE_SC_SecurityLevel; - -#define TEE_AUTHENTICATE TEE_SC_AUTHENTICATE - -/** - * @brief Represents the reference about SC card key. - * - * @since 12 - */ -typedef struct __TEE_SC_CardKeyRef { - /** The key identifier of the SC card key. */ - uint8_t scKeyID; - /** The key version if the SC card key. */ - uint8_t scKeyVersion; -} TEE_SC_CardKeyRef; - -/** - * @brief Represents the reference about the SC device key. - * - * @since 12 - */ -typedef struct __TEE_SC_DeviceKeyRef { - TEE_SC_KeyType scKeyType; - union { - TEE_ObjectHandle scBaseKeyHandle; - TEE_SC_KeySetRef scKeySetRef; - } __TEE_key; -} TEE_SC_DeviceKeyRef; - -/** - * @brief Defines the OID of the SC. - * - * @since 12 - */ -typedef struct __TEE_SC_OID { - /** The value of the OID. */ - uint8_t *buffer; - /** The length of the OID. */ - uint32_t bufferLen; -} TEE_SC_OID; - -/** - * @brief Represents the paramaters about the SC. - * - * @since 12 - */ -typedef struct __TEE_SC_Params { - /** The SC type. */ - uint8_t scType; - /** The SC type defined by OID. */ - TEE_SC_OID scOID; - /** The SC security level. */ - TEE_SC_SecurityLevel scSecurityLevel; - /** Reference to SC card keys. */ - TEE_SC_CardKeyRef scCardKeyRef; - /** Reference to SC device keys. */ - TEE_SC_DeviceKeyRef scDeviceKeyRef; -} TEE_SC_Params; - -/** - * @brief Open the SE service. - * - * @param se_service_handle [IN] Indicates the handle of SE service. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_ACCESS_CONFLICT} if failed to access the SE service due to conflict. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEServiceOpen(TEE_SEServiceHandle *se_service_handle); - -/** - * @brief Close the SE service. - * - * @param se_service_handle [IN] Indicates the handle of SE service. - * - * @since 12 - * @version 1.0 - */ -void TEE_SEServiceClose(TEE_SEServiceHandle se_service_handle); - -/** - * @brief Get the available readers handle of the SE service. - * - * @param se_service_handle [IN] Indicates the handle of SE service. - * @param se_reader_handle_list [OUT] Indicates the available readers handle list. - * @param se_reader_handle_list_len [OUT] Indicates the length of the handle list. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ITEM_NOT_FOUND} if cannot find the input SE service handle. - * Returns {@code TEE_ERROR_SHORT_BUFFER} if the provided buffer is too small to store the readers handle. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEServiceGetReaders(TEE_SEServiceHandle se_service_handle, TEE_SEReaderHandle *se_reader_handle_list, - uint32_t *se_reader_handle_list_len); - -/** - * @brief Get the available readers handle of the SE service. - * - * @param se_reader_handle [IN] Indicates the SE readers handle. - * @param reader_properties [OUT] Indicates the reader's properties. - * - * @since 12 - * @version 1.0 - */ -void TEE_SEReaderGetProperties(TEE_SEReaderHandle se_reader_handle, TEE_SEReaderProperties *reader_properties); - -/** - * @brief Get the SE reader's name. - * - * @param se_reader_handle [IN] Indicates the SE readers handle. - * @param reader_name [OUT] Indicates the SE reader's name. - * @param reader_name_len [OUT] Indicates the length of the reader's name. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ITEM_NOT_FOUND} if cannot find the input SE reader handle. - * Returns {@code TEE_ERROR_BAD_FORMAT} if the input se_reader_handle points to the reader illegally. - * Returns {@code TEE_ERROR_SHORT_BUFFER} if the reader_name_len is too small to store the readers name. - * Returns {@code TEE_ERROR_SECURITY} if the security error is detected. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEReaderGetName(TEE_SEReaderHandle se_reader_handle, char *reader_name, uint32_t *reader_name_len); - -/** - * @brief Open a session between the SE reader to the SE. - * - * @param se_reader_handle Indicates the SE readers handle. - * @param se_session_handle Indicates the session handle. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ITEM_NOT_FOUND} if cannot find the input SE reader handle. - * Returns {@code TEE_ERROR_COMMUNICATION} if communicte failed with the SE. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEReaderOpenSession(TEE_SEReaderHandle se_reader_handle, TEE_SESessionHandle *se_session_handle); - -/** - * @brief Close sessions between the SE reader to the SE. - * - * @param se_reader_handle Indicates the SE readers handle. - * - * @since 12 - * @version 1.0 - */ -void TEE_SEReaderCloseSessions(TEE_SEReaderHandle se_reader_handle); - -/** - * @brief Get the SE ATR. - * - * @param se_session_handle Indicates the session handle. - * @param atr Indicates the SE ATR. - * @param atrLen Indicates the length of ATR. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_SHORT_BUFFER} if the provided buffer is too small to store the ATR. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SESessionGetATR(TEE_SESessionHandle se_session_handle, void *atr, uint32_t *atrLen); - -/** - * @brief Check whether the session is closed. - * - * @param se_session_handle Indicates the session handle. - * - * @return Returns {@code TEE_SUCCESS} if the session is closed or the input handle is invalid. - * Returns {@code TEE_ERROR_COMMUNICATION} if session state is invalid. - * Returns {@code TEE_ERROR_BAD_STATE} if the session is opened. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SESessionIsClosed(TEE_SESessionHandle se_session_handle); - -/** - * @brief Close the SE session. - * - * @param se_session_handle Indicates the session handle. - * - * @since 12 - * @version 1.0 - */ -void TEE_SESessionClose(TEE_SESessionHandle se_session_handle); - -/** - * @brief Close all channels which pointed to by the SE session. - * - * @param se_session_handle Indicates the session handle. - * - * @since 12 - * @version 1.0 - */ -void TEE_SESessionCloseChannels(TEE_SESessionHandle se_session_handle); - -/** - * @brief Open a basic channel which pointed to by the SE session. - * - * @param se_session_handle Indicates the session handle. - * @param se_aid Indicates the SE AID. - * @param se_channel_handle Indicates the SE channel handle. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_STATE} if the session is closed. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ITEM_NOT_FOUND} if cannot find the input SE reader handle. - * Returns other when SE responding to the abnormal status word. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SESessionOpenBasicChannel(TEE_SESessionHandle se_session_handle, TEE_SEAID *se_aid, - TEE_SEChannelHandle *se_channel_handle); - -/** - * @brief Open a logical channel which pointed to by the SE session. - * - * @param se_session_handle Indicates the session handle. - * @param se_aid Indicates the SE AID. - * @param se_channel_handle Indicates the SE channel handle. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_STATE} if the session is closed. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ITEM_NOT_FOUND} if cannot find the input SE reader handle. - * Returns other when SE responding to the abnormal status word. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SESessionOpenLogicalChannel(TEE_SESessionHandle se_session_handle, TEE_SEAID *se_aid, - TEE_SEChannelHandle *se_channel_handle); - -/** - * @brief Close the channel which pointed to by the channel handle. - * - * @param se_channel_handle Indicates the SE channel handle. - * - * @since 12 - * @version 1.0 - */ -void TEE_SEChannelClose(TEE_SEChannelHandle se_channel_handle); - -/** - * @brief Select the next SE service which pointed to by the channel handle. - * - * @param se_channel_handle Indicates the SE channel handle. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is invalid or the mode of SE is wrong. - * Returns other when SE responding to the abnormal status word. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEChannelSelectNext(TEE_SEChannelHandle se_channel_handle); - -/** - * @brief Get the SELECT command response of SE when open the channel handle. - * - * @param se_channel_handle Indicates the SE channel handle. - * @param response Indicates the response of SE. - * @param response_len Indicates the length of the response. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is invalid. - * Returns {@code TEE_ERROR_SHORT_BUFFER} if the provided buffer is too small to store the response. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEChannelGetSelectResponse(TEE_SEChannelHandle se_channel_handle, void *response, - uint32_t *response_len); - -/** - * @brief Transmit the command through the channle. - * - * @param se_channel_handle Indicates the SE channel handle. - * @param command Indicates the transmitted command. - * @param command_len Indicates the length of the command. - * @param response Indicates the response of SE. - * @param response_len Indicates the length of the response. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_COMMUNICATION} if length of command is less than 4. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is invalid. - * Returns {@code TEE_ERROR_BAD_STATE} if the channel is closed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEChannelTransmit(TEE_SEChannelHandle se_channel_handle, void *command, uint32_t command_len, - void *response, uint32_t *response_len); - -/** - * @brief Open a SE secure channel based on the input channel handle. - * Thereafter, when the {@code TEE_SEChannelTransmit} is called, all APDUs(ENC/MAC protected) transmitted based on - * the handle are automatically protected based on the defined secure channel parameter options. - * Currently, only SCP03 is supported. - * - * @param se_channel_handle Indicates the SE channel handle. - * @param sc_params Indicates the parameter reference for the secure channel protocol. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_COMMUNICATION} if communicate failed with the SE. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is invalid or the mode of SE is wrong. - * Returns {@code TEE_ERROR_NOT_SUPPORTED} if the parameter of the sc_params is not supported - * Returns {@code TEE_ERROR_MAC_INVALID} if the verification failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SESecureChannelOpen(TEE_SEChannelHandle se_channel_handle, TEE_SC_Params *sc_params); - -/** - * @brief Close the SE secure channel based on the input channel handle. - * The channel, which pointed to by the input channel handle, is not closed. - * It can be used for insecure communication, but the APDU that calls {@code TEE_SEChannelTransmit} - * transmission is not secure. - * - * @param se_channel_handle Indicates the SE channel handle. - * - * @since 12 - * @version 1.0 - */ -void TEE_SESecureChannelClose(TEE_SEChannelHandle se_channel_handle); - -/** - * @brief Get the channel Id which pointed to by the input channel handle. - * - * @param se_channel_handle Indicates the SE channel handle. - * @param channel_id Indicates the SE channel Id. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is invalid. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEChannelGetID(TEE_SEChannelHandle se_channel_handle, uint8_t *channel_id); -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/tee_log.h b/tee/include/tee_log.h deleted file mode 100644 index 0489ba0ef..000000000 --- a/tee/include/tee_log.h +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __TEE_LOG_H -#define __TEE_LOG_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_log.h - * - * @brief Provides TEE log APIs. - * - * Reference of TEE log APIs and internal definitions. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Defines the ERROR level of the TA log. - * - * @since 12 - */ -#define TA_LOG_LEVEL_ERROR 0 - -/** - * @brief Defines the WARNING level of the TA log. - * - * @since 12 - */ -#define TA_LOG_LEVEL_WARNING 1 - -/** - * @brief Defines the INFO level of the TA log. - * - * @since 12 - */ -#define TA_LOG_LEVEL_INFO 2 - -/** - * @brief Defines the DEBUG level of the TA log. - * - * @since 12 - */ -#define TA_LOG_LEVEL_DEBUG 3 - -/** - * @brief Defines the VERBO level of the TA log. - * - * @since 12 - */ -#define TA_LOG_LEVEL_VERBO 4 - -/** - * @brief Defines the default level of the TA log. - * - * @since 12 - */ -#define TA_LOG_LEVEL_DEFAULT TA_LOG_LEVEL_INFO - -/** - * @brief Defines the default level of the TA log. - * {@code TA_LOG_LEVEL} can be redefined by TA developers - * - * @since 12 - */ -#ifndef TA_LOG_LEVEL -#define TA_LOG_LEVEL TA_LOG_LEVEL_DEFAULT -#endif - -/** - * @brief Defines the tag of the VERBO level TA log. - * - * @since 12 - */ -#define TAG_VERB "[verb]" - -/** - * @brief Defines the tag of the DEBUG level TA log. - * - * @since 12 - */ -#define TAG_DEBUG "[debug]" - -/** - * @brief Defines the tag of the INFO level TA log. - * - * @since 12 - */ -#define TAG_INFO "[info]" - -/** - * @brief Defines the tag of the WARNING level TA log. - * - * @since 12 - */ -#define TAG_WARN "[warn]" - -/** - * @brief Defines the tag of the ERROR level TA log. - * - * @since 12 - */ -#define TAG_ERROR "[error]" - -/** - * @brief Enumerates the levels of the log. - * - * @since 12 - */ -typedef enum { - LOG_LEVEL_ERROR = 0, - LOG_LEVEL_WARN = 1, - LOG_LEVEL_INFO = 2, - LOG_LEVEL_DEBUG = 3, - LOG_LEVEL_VERBO = 4, - LOG_LEVEL_ON = 5, -} LOG_LEVEL; - -/** - * @brief Provides to print UART logs. - * - * @param fmt [IN] The log information. - * - * @since 12 - */ -void uart_cprintf(const char *fmt, ...); - -/** - * @brief Provides to print UART logs. - * - * @param fmt [IN] The log information. - * - * @since 12 - */ -void uart_printf_func(const char *fmt, ...); - -/** - * @brief Provides to print TEE logs. - * - * @param log_level [IN] The level of the log. - * @param fmt [IN] The log information. - * - * @since 12 - */ -void tee_print(LOG_LEVEL log_level, const char *fmt, ...); - -/** - * @brief Provides to print TEE driver logs. - * - * @param log_level [IN] The level of the log. - * @param log_tag [IN] The tag of the log. - * @param fmt [IN] The log information. - * - * @since 12 - */ -void tee_print_driver(LOG_LEVEL log_level, const char *log_tag, const char *fmt, ...); - -extern const char *g_debug_prefix; - -/** - * @brief Defines the API to print TEE log at the VERBO level. - * - * @since 12 - */ -#if (TA_LOG_LEVEL >= TA_LOG_LEVEL_VERBO) -#ifdef DRIVER_LOG_TAG -#define tlogv(fmt, args...) \ - tee_print_driver(LOG_LEVEL_VERBO, DRIVER_LOG_TAG, "%s %d:" fmt "", TAG_VERB, __LINE__, ##args) -#else -#define tlogv(fmt, args...) tee_print(LOG_LEVEL_VERBO, "%s %d:" fmt "", TAG_VERB, __LINE__, ##args) -#endif /* DRIVER_LOG_TAG */ -#else -#define tlogv(fmt, args...) \ - do { \ - } while (0) -#endif /* TA_LOG_LEVEL >= TA_LOG_LEVEL_VERBO */ - -/** - * @brief Defines the API to print TEE log at the DEBUG level. - * - * @since 12 - */ -#if (TA_LOG_LEVEL >= TA_LOG_LEVEL_DEBUG) -#ifdef DRIVER_LOG_TAG -#define tlogd(fmt, args...) \ - tee_print_driver(LOG_LEVEL_DEBUG, DRIVER_LOG_TAG, "%s %d:" fmt "", TAG_DEBUG, __LINE__, ##args) -#else -#define tlogd(fmt, args...) tee_print(LOG_LEVEL_DEBUG, "%s %d:" fmt "", TAG_DEBUG, __LINE__, ##args) -#endif /* DRIVER_LOG_TAG */ -#else -#define tlogd(fmt, args...) \ - do { \ - } while (0) -#endif /* TA_LOG_LEVEL >= TA_LOG_LEVEL_DEBUG */ - -/** - * @brief Defines the API to print TEE log at the INFO level. - * - * @since 12 - */ -#if (TA_LOG_LEVEL >= TA_LOG_LEVEL_INFO) -#ifdef DRIVER_LOG_TAG -#define tlogi(fmt, args...) \ - tee_print_driver(LOG_LEVEL_INFO, DRIVER_LOG_TAG, "%s %d:" fmt "", TAG_INFO, __LINE__, ##args) -#else -#define tlogi(fmt, args...) tee_print(LOG_LEVEL_INFO, "%s %d:" fmt "", TAG_INFO, __LINE__, ##args) -#endif /* DRIVER_LOG_TAG */ -#else -#define tlogi(fmt, args...) \ - do { \ - } while (0) -#endif /* TA_LOG_LEVEL >= TA_LOG_LEVEL_INFO */ - -/** - * @brief Defines the API to print TEE log at the WARNING level. - * - * @since 12 - */ -#if (TA_LOG_LEVEL >= TA_LOG_LEVEL_WARNING) -#ifdef DRIVER_LOG_TAG -#define tlogw(fmt, args...) \ - tee_print_driver(LOG_LEVEL_WARN, DRIVER_LOG_TAG, "%s %d:" fmt "", TAG_WARN, __LINE__, ##args) -#else -#define tlogw(fmt, args...) tee_print(LOG_LEVEL_WARN, "%s %d:" fmt "", TAG_WARN, __LINE__, ##args) -#endif /* DRIVER_LOG_TAG */ -#else -#define tlogw(fmt, args...) \ - do { \ - } while (0) -#endif /* TA_LOG_LEVEL >= TA_LOG_LEVEL_WARNING */ - -/** - * @brief Defines the API to print TEE log at the ERROR level. - * - * @since 12 - */ -#if (TA_LOG_LEVEL >= TA_LOG_LEVEL_ERROR) /* Always meet this condition. */ -#ifndef TLOGE_NO_TIMESTAMP -#ifdef DRIVER_LOG_TAG -#define tloge(fmt, args...) \ - tee_print_driver(LOG_LEVEL_ERROR, DRIVER_LOG_TAG, "%s %d:" fmt " ", TAG_ERROR, __LINE__, ##args) -#else -#define tloge(fmt, args...) tee_print(LOG_LEVEL_ERROR, "%s %d:" fmt " ", TAG_ERROR, __LINE__, ##args) -#endif /* DRIVER_LOG_TAG */ -#else -#define tloge(fmt, args...) printf("[%s] %s %d:" fmt " ", g_debug_prefix, TAG_ERROR, __LINE__, ##args) -#endif /* TLOGE_NO_TIMESTAMP */ -#else -#define tloge(fmt, args...) \ - do { \ - } while (0) -#endif /* TA_LOG_LEVEL >= TA_LOG_LEVEL_ERROR */ - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif /* __TEE_LOG_H */ diff --git a/tee/include/tee_mem_mgmt_api.h b/tee/include/tee_mem_mgmt_api.h deleted file mode 100644 index fa636a384..000000000 --- a/tee/include/tee_mem_mgmt_api.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef TEE_MEM_MGMT_API_H -#define TEE_MEM_MGMT_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_mem_mgmt_api.h - * - * @brief Provides APIs for memory management. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" -#include "tee_mem_monitoring_api.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The definitions below are defined by Global Platform or Platform SDK released previously - * for compatibility. - * Do not make any change to the content below. - */ -#ifndef ZERO_SIZE_PTR -#define ZERO_SIZE_PTR ((void *)16) -#define zero_or_null_ptr(x) ((unsigned long)(x) <= (unsigned long)ZERO_SIZE_PTR) -#endif - -enum MALLOC_HINT { - ZERO = 0, - NOT_ZERO = 1, - ALIGN_004 = 0x80000002, - /* Buffer alignment */ - ALIGN_008 = 0x80000003, - ALIGN_016 = 0x80000004, - ALIGN_032 = 0x80000005, - ALIGN_064 = 0x80000006, - ALIGN_128 = 0x80000007, - ALIGN_256 = 0x80000008, - ALIGN_004_ZERO = 0x80000012, - /* The buffer is 8-byte aligned and initialized to zeros. */ - ALIGN_008_ZERO = 0x80000013, - ALIGN_016_ZERO = 0x80000014, - ALIGN_032_ZERO = 0x80000015, - ALIGN_064_ZERO = 0x80000016, - ALIGN_128_ZERO = 0x80000017, - ALIGN_256_ZERO = 0x80000018, -}; - -#define TEE_MALLOC_FILL_ZERO 0x00000000 -#define TEE_MALLOC_NO_FILL 0x00000001 -#define TEE_MALLOC_NO_SHARE 0x00000002 - -#define TEE_MEMORY_ACCESS_READ 0x00000001 -#define TEE_MEMORY_ACCESS_WRITE 0x00000002 -#define TEE_MEMORY_ACCESS_ANY_OWNER 0x00000004 - -#if defined(API_LEVEL) && (API_LEVEL >= API_LEVEL1_2) -/** - * @brief Fills x into the first size bytes of the buffer. - * - * @param buffer Indicates the pointer to the buffer. - * @param x Indicates the value to fill. - * @param size Indicates the number of bytes to fill. - * - * @since 12 - * @version 1.0 - */ -void TEE_MemFill(void *buffer, uint8_t x, size_t size); -#else -/** - * @brief Fills x into the first size bytes of the buffer. - * - * @param buffer Indicates the pointer to the buffer. - * @param x Indicates the value to fill. - * @param size Indicates the number of bytes to fill. - * - * @since 12 - * @version 1.0 - */ -void TEE_MemFill(void *buffer, uint32_t x, size_t size); -#endif - -/** - * @brief Copies bytes. - * - * @param dest Indicates the pointer to the buffer that holds the bytes copied. - * @param src Indicates the pointer to the buffer that holds the bytes to copy. - * @param size Indicates the number of bytes to copy. - * - * @since 12 - * @version 1.0 - */ -void TEE_MemMove(void *dest, const void *src, size_t size); - -/** - * @brief Allocates space of the specified size for an object. - * - * @param size Indicates the size of the memory to be allocated. - * @param hint Indicates a hint to the allocator. The value 0 indicates that the memory block - * returned is filled with "\0". - * - * @return Returns a pointer to the newly allocated space if the operation is successful. - * @return Returns a NULL pointer if the allocation fails. - * - * @since 12 - * @version 1.0 - */ -void *TEE_Malloc(size_t size, uint32_t hint); - - /** - * @brief Releases the memory allocated by TEE_Malloc. - * - * If the buffer is a NULL pointer, TEE_Free does nothing. - * The buffer to be released must have been allocated by TEE_Malloc or TEE_Realloc and cannot be - * released repeatedly. Otherwise, unexpected result may be caused. - * - * @param buffer Indicates the pointer to the memory to release. - * - * @since 12 - * @version 1.0 - */ -void TEE_Free(void *buffer); - -/** - * @brief Reallocates memory. - * - * If new_size is greater than the old size, the content of the original memory does not change - * and the space in excess of the old size contains unspecified content. - * If the new size of the memory object requires movement of the object, the space for the previous - * instantiation of the object is deallocated. - * If the space cannot be allocated, the original object remains allocated and this function - * returns a NULL pointer. - * If the buffer is NULL, this function is equivalent to TEE_Malloc. - * - * @param buffer Indicates the pointer to the memory to reallocate. - * @param new_size Indicates the new size required. - * - * @return Returns a pointer to the allocated memory if the operation is successful. - * @return Returns a NULL pointer if the operation fails. - * - * @since 12 - * @version 1.0 - */ -void *TEE_Realloc(void *buffer, size_t new_size); - -/** - * @brief Compares memory content from the beginning. - * - * @param buffer1 Indicates the pointer to the first buffer. - * @param buffer2 Indicates the pointer to the second buffer. - * @param size Indicates the number of the bytes to compare. - * - * @return Returns –1 if buffer1 < buffer2. - * @return Returns 0 if buffer1 == buffer2. - * @return Returns 1 if buffer1 > buffer2. - * - * @since 12 - * @version 1.0 - */ -int32_t TEE_MemCompare(const void *buffer1, const void *buffer2, size_t size); - -/** - * @brief Checks whether this TA has the requested permissions to access a buffer. - * - * @param accessFlags Indicates the access permissions to check. - * @param buffer Indicates the pointer to the target buffer. - * @param size Indicates the size of the buffer to check. - * - * @return Returns TEE_SUCCESS if the TA has the requested permissions. - * @return Returns TEE_ERROR_ACCESS_DENIED otherwise. - */ -TEE_Result TEE_CheckMemoryAccessRights(uint32_t accessFlags, const void *buffer, size_t size); - -/** - * @brief Sets the TA instance data pointer. - * - * @param instanceData Indicates the pointer to the global TA instance data. - * - * @since 12 - * @version 1.0 - */ -void TEE_SetInstanceData(void *instanceData); - -/** - * @brief Obtains the instance data pointer set by the TA using TEE_SetInstanceData. - * - * @return Returns the pointer to the instance data set by TEE_SetInstanceData - * @return or NULL if no instance data pointer has been set. - * - * @since 12 - * @version 1.0 - */ -void *TEE_GetInstanceData(void); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/tee_mem_monitoring_api.h b/tee/include/tee_mem_monitoring_api.h deleted file mode 100644 index a95a78efe..000000000 --- a/tee/include/tee_mem_monitoring_api.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TEE_MEM_MONITORING_API_H -#define TEE_MEM_MONITORING_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_mem_monitoring_api.h - * - * @brief Provides APIs for memory monitoring. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Obtains the heap usage of this trusted application (TA). - * - * @param show Indicates whether to print the result in the log file. - * - * @return Returns the heap usage in percentage. - * - * @since 12 - * @version 1.0 - */ -uint32_t get_heap_usage(bool show); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_object_api.h b/tee/include/tee_object_api.h deleted file mode 100644 index 723f576c9..000000000 --- a/tee/include/tee_object_api.h +++ /dev/null @@ -1,384 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __TEE_OBJECT_API_H -#define __TEE_OBJECT_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_object_api.h - * - * @brief Provides trusted storage APIs. - * - * You can use these APIs to implement trusted storage features. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Defines HANDLE_NULL, which is used to denote the absence of a handle. - * - * @since 12 - */ -#define TEE_HANDLE_NULL 0x00000000 - -/** - * @brief Enumerates the usages of the key of the TEE_ObjectHandle. - * - * @since 12 - */ -enum Usage_Constants { - /** The object's key is extractable. */ - TEE_USAGE_EXTRACTABLE = 0x00000001, - /** Used for encryption. */ - TEE_USAGE_ENCRYPT = 0x00000002, - /** Used for decryption. */ - TEE_USAGE_DECRYPT = 0x00000004, - /** Used for hash calculation. */ - TEE_USAGE_MAC = 0x00000008, - /** Used for creating a signature. */ - TEE_USAGE_SIGN = 0x00000010, - /** Used for signature verification. */ - TEE_USAGE_VERIFY = 0x00000020, - /** Used for key derivation. */ - TEE_USAGE_DERIVE = 0x00000040, - /** Used for object initialization, with all permissions assigned by default. */ - TEE_USAGE_DEFAULT = 0xFFFFFFFF, -}; - -/** - * @brief Defines information about the object pointed to by the flag of the TEE_ObjectHandle, - * for example, whether the object is a persistent object or is initialized. - * - * @since 12 - */ -enum Handle_Flag_Constants { - /** The object is a persistent object. */ - TEE_HANDLE_FLAG_PERSISTENT = 0x00010000, - /** The object is initialized. */ - TEE_HANDLE_FLAG_INITIALIZED = 0x00020000, - /** Reserved */ - TEE_HANDLE_FLAG_KEY_SET = 0x00040000, - /** Reserved */ - TEE_HANDLE_FLAG_EXPECT_TWO_KEYS = 0x00080000, -}; - -/** - * @brief Defines a value attribute identifier flag. - * - * @since 12 - */ -#define TEE_ATTR_FLAG_VALUE 0x20000000 - -/** - * @brief Defines a public attribute identifier flag. - * - * @since 12 - */ -#define TEE_ATTR_FLAG_PUBLIC 0x10000000 - -/** - * @brief Check whether the attribute is a buffer. - * - * @since 12 - */ -#define TEE_ATTR_IS_BUFFER(attribute_id) ((((attribute_id) << 2) >> 31) == 0) - -/** - * @brief Check whether the attribute is a value. - * - * @since 12 - */ -#define TEE_ATTR_IS_VALUE(attribute_id) ((((attribute_id) << 2) >> 31) == 1) - -/** - * @brief Check whether the attribute is protected. - * - * @since 12 - */ -#define TEE_ATTR_IS_PROTECTED(attribute_id) ((((attribute_id) << 3) >> 31) == 0) - -/** - * @brief Check whether the attribute is public. - * - * @since 12 - */ -#define TEE_ATTR_IS_PUBLIC(attribute_id) ((((attribute_id) << 3) >> 31) == 1) - -/** - * @brief Obtains a buffer attribute from the TEE_Attribute struct of the object pointed - * to by TEE_ObjectHandle. - * - * The members in the TEE_Attribute struct must be ref. If the TEE_Attribute is private, - * the Usage_Constants of the object must include TEE_USAGE_EXTRACTABLE. - * - * @param object Indicates the handle of the object. - * @param attributeID Indicates the ID of the attribute to obtain, for example, TEE_ObjectAttribute. - * The attribute ID can also be customized. - * @param buffer Indicates the pointer to the buffer that stores the attribute obtained. - * @param size Indicates the pointer to the length of the content stored. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the TEE_Attribute cannot be found in the object - * or the object is not initialized. - * @return Returns TEE_ERROR_SHORT_BUFFER if the buffer is too small to store the content obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetObjectBufferAttribute(TEE_ObjectHandle object, uint32_t attributeID, void *buffer, size_t *size); - -/** - * @brief Obtains a value attribute from the TEE_Attribute of an object. - * - * The members of the TEE_Attribute struct must be values. If the TEE_Attribute is private, - * the Usage_Constants of the object must include TEE_USAGE_EXTRACTABLE. - * - * @param object Indicates the handle of the object. - * @param attributeID Indicates the ID of the attribute to obtain, for example, TEE_ObjectAttribute. - * The attribute ID can also be customized. - * @param a Indicates the pointer to the placeholder filled with the attribute field a. - * @param b Indicates the pointer to the placeholder filled with the attribute field b. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the TEE_Attribute cannot be found in the object - * or the object is not initialized. - * @return Returns TEE_ERROR_ACCESS_DENIED if TEE_Attribute is private - * but the object Usage_Constants does not contain the TEE_USAGE_EXTRACTABLE flag. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetObjectValueAttribute(TEE_ObjectHandle object, uint32_t attributeID, uint32_t *a, uint32_t *b); - -/** - * @brief Closes a TEE_ObjectHandle object. - * - * The object can be persistent or transient. - * - * @param object Indicates the TEE_ObjectHandle object to close. - * - * @since 12 - * @version 1.0 - */ -void TEE_CloseObject(TEE_ObjectHandle object); - -/** - * @brief Allocates an uninitialized object to store keys. - * - * objectType and maxObjectSize must be specified. - * - * @param objectType Indicates the type of the object to create. The value is TEE_ObjectType. - * @param maxObjectSize Indicates the maximum number of bytes of the object. - * @param object Indicates the pointer to the handle of the newly created object. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_OUT_OF_MEMORY if the memory is insufficient. - * @return Returns TEE_ERROR_NOT_SUPPORTED if the object type is not supported. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AllocateTransientObject(uint32_t objectType, uint32_t maxObjectSize, TEE_ObjectHandle *object); - -/** - * @brief Releases a transient object that is previously allocated with TEE_AllocateTransientObject. - * - * After the function is called, the handle becomes invalid and all allocated resources are released. - * TEE_FreeTransientObject and TEE_AllocateTransientObject are used in pairs. - * - * @param object Indicates the TEE_ObjectHandle to release. - * - * @since 12 - * @version 1.0 - */ -void TEE_FreeTransientObject(TEE_ObjectHandle object); - -/** - * @brief Resets a transient object to its initial state after allocation. - * - * You can use an allocated object, which has not been initialized or used to store a key, to store a key. - * - * @param object Indicates the TEE_ObjectHandle to reset. - * - * @since 12 - * @version 1.0 - */ -void TEE_ResetTransientObject(TEE_ObjectHandle object); - -/** - * @brief Populates an uninitialized object with object attributes passed by the TA in the attrs parameter. - * - * The object must be uninitialized. \n - * The attrs parameter is passed by a TA. - * - * @param object Indicates the handle on a created but uninitialized object. - * @param attrs Indicates the pointer to an array of object attributes, which can be one or more TEE_Attributes. - * @param attrCount Indicates the number of members in the attribute array. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_BAD_PARAMETERS if an incorrect or inconsistent attribute value is detected. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_PopulateTransientObject(TEE_ObjectHandle object, TEE_Attribute *attrs, uint32_t attrCount); - -/** - * @brief Initializes the TEE_Attribute of the buffer type. - * - * The members in the TEE_Attribute struct must be ref. - * - * @param attr Indicates the pointer to the TEE_Attribute initialized. - * @param attributeID Indicates the ID assigned to the TEE_Attribute. - * @param buffer Indicates the pointer to the buffer that stores the content to be allocated. - * @param length Indicates the length of the assigned value, in bytes. - * - * @since 12 - * @version 1.0 - */ -void TEE_InitRefAttribute(TEE_Attribute *attr, uint32_t attributeID, void *buffer, size_t length); - -/** - * @brief Initializes a TEE_Attribute. - * - * @param attr Indicates the pointer to the TEE_Attribute initialized. - * @param attributeID Indicates the ID assigned to the TEE_Attribute. - * @param a Indicates the value to be assigned to the member a in the TEE_Attribute. - * @param b Indicates the value to be assigned to the member b in the TEE_Attribute. - * - * @since 12 - * @version 1.0 - */ -void TEE_InitValueAttribute(TEE_Attribute *attr, uint32_t attributeID, uint32_t a, uint32_t b); - -/** - * @brief Generates a random key or a key pair and populates a transient key object with the generated key. - * - * @param object Indicates a transient object used to hold the generated key. - * @param keySize Indicates the number of bytes of the key. - * @param params Indicates the pointer to the parameters for key generation. - * @param paramCount Indicates the number of parameters required for key generation. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_BAD_PARAMETERS if the type of the key generated does not match - * the key that can be held in the transient object. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GenerateKey(TEE_ObjectHandle object, uint32_t keySize, TEE_Attribute *params, uint32_t paramCount); - -/** - * @brief Get the information of the object data part, the total length of the data part and the current - * position of the data stream. - * - * @param object Indicates the handle of the object. - * @param pos Indicates the data stream position. - * @param len Indicates the data stream length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns others if the operation is failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_InfoObjectData(TEE_ObjectHandle object, uint32_t *pos, uint32_t *len); - -/** - * @brief Obtains TEE_ObjectInfo. - * - * This function obtains TEE_ObjectInfo and copies the obtained information to the pre-allocated space - * pointed to by objectInfo. - * - * @param object Indicates the handle of the object. - * @param objectInfo Indicates the pointer to the TEE_ObjectInfo obtained. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_CORRUPT_OBJECT if the object is corrupted and the object handle will be closed. - * @return Returns TEE_ERROR_STORAGE_NOT_AVAILABLE if the object is stored - * in a storage area that is inaccessible currently. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetObjectInfo1(TEE_ObjectHandle object, TEE_ObjectInfo *objectInfo); - -/** - * @brief Assigns the TEE_Attribute of an initialized object to an uninitialized object. - * - * This function populates an uninitialized object with TEE_Attribute. - * That is, it copies TEE_Attribute of srcobject to destobject. - * The TEE_Attribute types and IDs of the two objects must match. - * - * @param destObject Indicates the uninitialized object. - * @param srcObject Indicates the initialized object. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_CORRUPT_OBJECT if the object is corrupted and the object handle will be closed. - * @return Returns TEE_ERROR_STORAGE_NOT_AVAILABLE if the object is stored - * in a storage area that is inaccessible currently. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_CopyObjectAttributes1(TEE_ObjectHandle destObject, TEE_ObjectHandle srcObject); - -/** - * @brief Restricts the objectUse bit of an object. - * - * This bit determines the usage of the key in the object. The value range is Usage_Constant. - * The bit in the objectUse parameter can be set as follows: \n - * If it is set to 1, the corresponding usage flag in the object is left unchanged. \n - * If it is set to 0, the corresponding usage flag in the object is cleared. \n - * The newly created object contains all Usage_Constant, and the usage flag can be cleared only. - * - * @param object Indicates the TEE_ObjectHandle of the target object. - * @param objectUsage Indicates the new object usage. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_CORRUPT_OBJECT if the object is corrupted and the object handle will be closed. - * @return Returns TEE_ERROR_STORAGE_NOT_AVAILABLE if the object is stored - * in a storage area that is inaccessible currently. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RestrictObjectUsage1(TEE_ObjectHandle object, uint32_t objectUsage); -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_property_api.h b/tee/include/tee_property_api.h deleted file mode 100644 index 029e28eb7..000000000 --- a/tee/include/tee_property_api.h +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TEE_PROPERTY_API_H -#define TEE_PROPERTY_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_property_api.h - * - * @brief Reference of TEE object api definitions. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif -/** - * The definitions below are defined by Global Platform or Platform SDK released previously - * for compatibility. - * Do not make any change to the content below. - */ - -/** - * @brief Enumerates the types of the property set. - * - * @since 12 - */ -typedef enum { - TEE_PROPSET_UNKNOW = 0, - TEE_PROPSET_TEE_IMPLEMENTATION = 0xFFFFFFFD, - TEE_PROPSET_CURRENT_CLIENT = 0xFFFFFFFE, - TEE_PROPSET_CURRENT_TA = 0xFFFFFFFF, -} Pseudo_PropSetHandle; - -typedef uint32_t TEE_PropSetHandle; - -/** - * @brief Obtains a property from a property set and converts its value into a printable string. - * - * - * @param propsetOrEnumerator Indicates one of the TEE_PROPSET_XXX pseudo-handles or a handle on a property enumerator. - * @param name Indicates the pointer to the zero-terminated string containing the name of the property to obtain. - * @param valueBuffer Indicates the pointer to the buffer for holding the property value obtained. - * @param valueBufferLen Indicates the pointer to the buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the target property cannot be obtained. - * @return Returns TEE_ERROR_SHORT_BUFFER if the value buffer is too small to hold the property value obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyAsString(TEE_PropSetHandle propsetOrEnumerator, const char *name, char *valueBuffer, - size_t *valueBufferLen); - -/** - * @brief Obtains a property from a property set and converts its value into a Boolean value. - * - * @param propsetOrEnumerator Indicates one of the TEE_PROPSET_XXX pseudo-handles or a handle on a property enumerator. - * @param name Indicates the pointer to the zero-terminated string containing the name of the property to obtain. - * @param value Indicates the pointer to the variable that holds the property value obtained. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the target property cannot be obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyAsBool(TEE_PropSetHandle propsetOrEnumerator, const char *name, bool *value); - -/** - * @brief Obtains a property from a property set and converts its value into a 32-bit unsigned integer. - * - * @param propsetOrEnumerator Indicates one of the TEE_PROPSET_XXX pseudo-handles or a handle on a property enumerator. - * @param name Indicates the pointer to the zero-terminated string containing the name of the property to obtain. - * @param value Indicates the pointer to the variable that holds the property value obtained. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the target property cannot be obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyAsU32(TEE_PropSetHandle propsetOrEnumerator, const char *name, uint32_t *value); - -#if defined(API_LEVEL) && (API_LEVEL >= API_LEVEL1_2) -/** - * @brief Obtains a property from a property set and converts its value into a 64-bit unsigned integer. - * - * @param propsetOrEnumerator Indicates one of the TEE_PROPSET_XXX pseudo-handles or a handle on a property enumerator. - * @param name Indicates the pointer to the zero-terminated string containing the name of the property to obtain. - * @param value Indicates the pointer to the variable that holds the property value obtained. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the target property cannot be obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyAsU64(TEE_PropSetHandle propsetOrEnumerator, const char *name, uint64_t *value); -#endif // API_LEVEL - -/** - * @brief Obtains a property from a property set and converts its value into a binary block. - * - * @param propsetOrEnumerator Indicates one of the TEE_PROPSET_XXX pseudo-handles or a handle on a property enumerator. - * @param name Indicates the pointer to the zero-terminated string containing the name of the property to obtain. - * @param valueBuffer Indicates the pointer to the buffer for holding the property value obtained. - * @param valueBufferLen Indicates the pointer to the buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the target property cannot be obtained. - * @return TEE_ERROR_SHORT_BUFFER the value buffer is not large enough to hold the whole property value - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyAsBinaryBlock(TEE_PropSetHandle propsetOrEnumerator, const char *name, void *valueBuffer, - size_t *valueBufferLen); - -/** - * @brief Obtains a property from a property set and converts its value to the TEE_UUID struct. - * - * @param propsetOrEnumerator Indicates one of the TEE_PROPSET_XXX pseudo-handles or a handle on a property enumerator. - * @param name Indicates the pointer to the zero-terminated string containing the name of the property to obtain. - * @param value Indicates the pointer to the variable that holds the property value obtained. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the target property cannot be obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyAsUUID(TEE_PropSetHandle propsetOrEnumerator, const char *name, TEE_UUID *value); - -/** - * @brief Obtains a property from a property set and converts its value to the TEE_Identity struct. - * - * @param propsetOrEnumerator Indicates one of the TEE_PROPSET_XXX pseudo-handles or a handle on a property enumerator. - * @param name Indicates the pointer to the zero-terminated string containing the name of the property to obtain. - * @param value Indicates the pointer to the variable that holds the property value obtained. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the target property cannot be obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyAsIdentity(TEE_PropSetHandle propsetOrEnumerator, const char *name, TEE_Identity *value); - -/** - * @brief Allocates a property enumerator object. - * - * @param enumerator Indicates the pointer to the property enumerator filled with an opaque handle. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_OUT_OF_MEMORY if there is no enough resources to allocate the property enumerator. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AllocatePropertyEnumerator(TEE_PropSetHandle *enumerator); - -/** - * @brief Releases a property enumerator object. - * - * @param enumerator Indicates the handle on the property enumerator to release. - * - * @return void - * - * @since 12 - * @version 1.0 - */ -void TEE_FreePropertyEnumerator(TEE_PropSetHandle enumerator); - -/** - * @brief Starts to enumerate the properties in an enumerator. - * - * @param enumerator Indicates the handle on the enumerator. - * @param propSet Indicates the pseudo-handle on the property set to enumerate. - * - * @return void - * - * @since 12 - * @version 1.0 - */ -void TEE_StartPropertyEnumerator(TEE_PropSetHandle enumerator, TEE_PropSetHandle propSet); - -/** - * @brief Resets a property enumerator immediately after allocation. - * - * @param enumerator Indicates the handle on the enumerator to reset. - * - * @return void - * - * @since 12 - * @version 1.0 - */ -void TEE_ResetPropertyEnumerator(TEE_PropSetHandle enumerator); - -/** - * @brief Obtains the name of this property in an enumerator. - * - * @param enumerator Indicates the handle on the enumerator. - * @param nameBuffer Indicates the pointer to the buffer that stores the property name obtained. - * @param nameBufferLen Indicates the pointer to the buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the property is not found because the enumerator has not started - * or has reached the end of the property set. - * @return Returns TEE_ERROR_SHORT_BUFFER if the buffer is too small to hold the property name. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyName(TEE_PropSetHandle enumerator, void *nameBuffer, size_t *nameBufferLen); - -/** - * @brief Obtains the next property in an enumerator. - * - * @param enumerator Indicates the handle on the enumerator. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the property is not found because the enumerator - * has not started or has reached the end of the property set. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetNextProperty(TEE_PropSetHandle enumerator); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/tee_rtc_time_api.h b/tee/include/tee_rtc_time_api.h deleted file mode 100644 index 37b7047c5..000000000 --- a/tee/include/tee_rtc_time_api.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __TEE_RTC_TIME_API_H -#define __TEE_RTC_TIME_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_rtc_time_api.h - * - * @brief Provides APIs about rtc timer. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Create a secure timer. - * - * @param time_seconds Indicates the security duration. - * @param timer_property Indicates the property of the timer, where only need to specify the timer type. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other values if the operation fails. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_create_timer(uint32_t time_seconds, TEE_timer_property *timer_property); - -/** - * @brief Destory a secure timer. - * - * @param timer_property Indicates the property of the timer, where only need to specify the timer type. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other values if the operation fails. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_destory_timer(TEE_timer_property *timer_property); - -/** - * @brief Obtain the set timing duration. - * - * @param timer_property Indicates the property of the timer, where only need to specify the timer type. - * @param time_seconds Indicates the timing duration. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other values if the operation fails. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_get_timer_expire(TEE_timer_property *timer_property, uint32_t *time_seconds); - -/** - * @brief Obtain the remain timing duration. - * - * @param timer_property Indicates the property of the timer, where only need to specify the timer type. - * @param time_seconds Indicates the remain timing duration. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other values if the operation fails. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_get_timer_remain(TEE_timer_property *timer_property, uint32_t *time_seconds); - -/** - * @brief Obtain the current timing of the RTC clock. - * @attention The obtained time is in seconds and cannot be converted to universal time. - * - * @return The RTC clock count(in seconds). - * - * @since 12 - * @version 1.0 - */ -unsigned int tee_get_secure_rtc_time(void); -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/tee_service_public.h b/tee/include/tee_service_public.h deleted file mode 100644 index 3a3ea2e0d..000000000 --- a/tee/include/tee_service_public.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _TEE_SERVICE_PUBLIC_H_ -#define _TEE_SERVICE_PUBLIC_H_ - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_service_public.h - * - * @brief Provides the TEE service public function for developers. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*func_ptr)(void); - -/** - * @brief Defines the size of the message queue for the TEE service - * - * @since 12 - */ -#define TEE_SERVICE_MSG_QUEUE_SIZE 100 - -/** - * @brief Defines the arguments of a message. - * - * @since 12 - */ -typedef struct { - uint64_t arg0; - uint64_t arg1; - uint64_t arg2; - uint64_t arg3; - uint64_t arg4; - uint64_t arg5; - uint64_t arg6; - uint64_t arg7; -} args_t; - -/** - * @brief Defines the register information of TA. - * - * @since 12 - */ -struct reg_ta_info { - uint32_t taskid; - TEE_UUID uuid; - uint32_t userid; - /** Just for ssa, other tasks shall ignore it. */ - bool ssa_enum_enable; -}; - -/** - * @brief Defines the IPC message of TEE service. - * - * @since 12 - */ -typedef union { - args_t args_data; - struct reg_ta_info reg_ta; -} tee_service_ipc_msg; - -/** - * @brief Defines the IPC request message of TEE service. - * - * @since 12 - */ -struct tee_service_ipc_msg_req { - uint32_t cmd; - tee_service_ipc_msg msg; -}; - -/** - * @brief Defines the IPC response message of TEE service. - * - * @since 12 - */ -typedef struct { - TEE_Result ret; - tee_service_ipc_msg msg; -} tee_service_ipc_msg_rsp; - -/** - * @brief Defines the message of the TEE service. - * - * @since 12 - */ -typedef struct { - uint32_t msg_id; - uint32_t sender; - tee_service_ipc_msg msg; -} tee_service_msg_t; - -/** - * @brief Defines the message queue for the TEE service. - * - * @since 12 - */ -typedef struct { - uint32_t in; - uint32_t out; - tee_service_msg_t msg[TEE_SERVICE_MSG_QUEUE_SIZE]; -} tee_service_msg_queue_t; - -/** - * @brief Provides to send IPC synchronization messages to a specified service - * and receive responses from the service. - * - * @param task_name Indicates the task name of recipient. - * @param snd_cmd Indicates the command ID of the send message. - * @param snd_msg Indicates the send message. - * @param ack_cmd Indicates the ID of the ack cmd to be received. - * @param rsp_msg Indicates the service response message. - * - * @since 12 - * @version 1.0 - */ -void tee_common_ipc_proc_cmd(const char *task_name, - uint32_t snd_cmd, const tee_service_ipc_msg *snd_msg, - uint32_t ack_cmd, tee_service_ipc_msg_rsp *rsp_msg); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/tee_sharemem_ops.h b/tee/include/tee_sharemem_ops.h deleted file mode 100644 index 479964ff3..000000000 --- a/tee/include/tee_sharemem_ops.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TEE_SHAREMEM_OPS_H -#define TEE_SHAREMEM_OPS_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_sharemem_ops.h - * - * @brief Provides APIs for developers to apply for shared memory. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Alloc shared memory in TEE. - * - * @param uuid Indicates the UUID of TA. - * @param size Indicates the size of the requested shared memory. - * - * @return Returns a pointer to the newly allocated space if the operation is successful. - * Returns a NULL pointer if the allocation fails. - * - * @since 12 - * @version 1.0 - */ -void *tee_alloc_sharemem_aux(const struct tee_uuid *uuid, uint32_t size); - -/** - * @brief Alloc continuous shared memory in TEE. - * - * @param uuid Indicates the UUID of TA. - * @param size Indicates the size of the requested shared memory. - * - * @return Returns a pointer to the newly allocated space if the operation is successful. - * Returns a NULL pointer if the allocation fails. - * - * @since 12 - * @version 1.0 - */ -void *tee_alloc_coherent_sharemem_aux(const struct tee_uuid *uuid, uint32_t size); - -/** - * @brief Free the shared memory in TEE. - * - * @param addr Indicates the shared memory address that will be freed. - * @param size Indicates the size of the shared memory. - * - * @return Returns 0 if the operation is successful. - * Returns others if the operation is failed. - * - * @since 12 - * @version 1.0 - */ -uint32_t tee_free_sharemem(void *addr, uint32_t size); - -/** - * @brief Copy shared memory from source task. - * - * @param src_task Indicates the pid of the source task. - * @param src Indicates the address of the source buffer. - * @param src_size Indicates the size of the source buffer. - * @param dst Indicates the address of the destination buffer. - * @param dst_size Indicates the size of the destination buffer. - * - * @return Returns 0 if the operation is successful. - * Returns -1 if the operation is failed. - * - * @since 12 - * @version 1.0 - */ -int32_t copy_from_sharemem(uint32_t src_task, uint64_t src, uint32_t src_size, uintptr_t dst, uint32_t dst_size); - -/** - * @brief Copy shared memory to destination task. - * - * @param src Indicates the address of the source buffer. - * @param src_size Indicates the size of the source buffer. - * @param dst_task Indicates the pid of the destination task. - * @param dst Indicates the address of the destination buffer. - * @param dst_size Indicates the size of the destination buffer. - * - * @return Returns 0 if the operation is successful. - * Returns -1 if the operation is failed. - * - * @since 12 - * @version 1.0 - */ -int32_t copy_to_sharemem(uintptr_t src, uint32_t src_size, uint32_t dst_task, uint64_t dst, uint32_t dst_size); -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/tee_time_api.h b/tee/include/tee_time_api.h deleted file mode 100644 index 58ea6d51f..000000000 --- a/tee/include/tee_time_api.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __TEE_TIME_API_H -#define __TEE_TIME_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_time_api.h - * - * @brief Provides APIs for managing the Trusted Execution Environment (TEE) time. - * - * You can use these APIs to implement time-related features in a TEE. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Obtains the current TEE system time. - * - * @param time Indicates the pointer to the current system time obtained. - * - * @since 12 - * @version 1.0 - */ -void TEE_GetSystemTime(TEE_Time *time); - -/** - * @brief Waits for the specified period of time, in milliseconds. - * - * @param timeout Indicates the period of time to wait, in milliseconds. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_CANCEL if the wait is canceled. - * @return Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_Wait(uint32_t timeout); - -/** - * @brief Obtains the persistent time of this trusted application (TA). - * - * @param time Indicates the pointer to the persistent time of the TA. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_TIME_NOT_SET if the persistent time has not been set. - * @return Returns TEE_ERROR_TIME_NEEDS_RESET if the persistent time is corrupted and - * the application is not longer trusted. - * @return Returns TEE_ERROR_OVERFLOW if the number of seconds in the TA persistent time - * exceeds the range of uint32_t. - * @return Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetTAPersistentTime(TEE_Time *time); - -/** - * @brief Sets the persistent time for this TA. - * - * @param time Indicates the pointer to the persistent time of the TA. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * @return Returns TEE_ERROR_STORAGE_NO_SPACE if the storage space is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SetTAPersistentTime(TEE_Time *time); - -/** - * @brief Obtains the current Rich Execution Environment (REE) system time. - * - * @param time Indicates the pointer to the REE system time obtained. - * - * @since 12 - * @version 1.0 - */ -void TEE_GetREETime(TEE_Time *time); - -/** - * @brief Obtains the string format of the current Rich Execution Environment (REE) system time. - * - * @param tim_str Indicates the REE system time string. - * @param time_str_len Indicates the length of the string. - * - * @since 12 - * @version 1.0 - */ -void TEE_GetREETimeStr(char *tim_str, uint32_t time_str_len); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_trusted_storage_api.h b/tee/include/tee_trusted_storage_api.h deleted file mode 100644 index 2638db1d4..000000000 --- a/tee/include/tee_trusted_storage_api.h +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __TEE_TRUSTED_STORAGE_API_H -#define __TEE_TRUSTED_STORAGE_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_trusted_storage_api.h - * - * @brief Provides trusted storage APIs. - * - * You can use these APIs to implement trusted storage features. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" -#include "tee_object_api.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Defines the start position in the data stream associated with an object. - * It is used in the TEE_SeekObjectData function. - * - * @since 12 - */ -enum __TEE_Whence { - /* Set the start position to the beginning of the data stream. */ - TEE_DATA_SEEK_SET = 0, - /* Set the start position to the current data stream position. */ - TEE_DATA_SEEK_CUR, - /* Set the start position to the end of the data stream. */ - TEE_DATA_SEEK_END -}; - -struct __TEE_ObjectEnumHandle; - -/** - * @brief Defines the pointer to TEE_ObjectEnumHandle. - * - * @see __TEE_ObjectEnumHandle - * - * @since 12 - */ -typedef struct __TEE_ObjectEnumHandle *TEE_ObjectEnumHandle; - -typedef uint32_t TEE_Whence; - -/** - * @brief Defines the storage ID, which identifies the storage space of the application. - * - * @since 12 - */ -enum Object_Storage_Constants { - /* Separate private storage space for each application. */ - TEE_OBJECT_STORAGE_PRIVATE = 0x00000001, - /* Separate personal storage space for application. */ - TEE_OBJECT_STORAGE_PERSO = 0x00000002, - /* Space for secure flash storage. */ - TEE_OBJECT_SEC_FLASH = 0x80000000, - /* Credential encrypted storage space. */ - TEE_OBJECT_STORAGE_CE = 0x80000002, -}; - -/** - * @brief Defines the system resource constraints, such as the maximum value for the data stream position indicator. - * - * @since 12 - */ -enum Miscellaneous_Constants { - /* Maximum length that the position indicator of the data stream can take. */ - TEE_DATA_MAX_POSITION = 0xFFFFFFFF, - /* Maximum length of the object ID, which can extend to 128 bytes. */ - TEE_OBJECT_ID_MAX_LEN = 64, -}; - -/** - * @brief Defines the maximum number of bytes that can be held in a data stream. - * - * @since 12 - */ -enum TEE_DATA_Size { - TEE_DATA_OBJECT_MAX_SIZE = 0xFFFFFFFF -}; - -/** - * @brief Defines the handleFlags of a TEE_ObjectHandle. - * The handleFlags determines the access permissions to the data stream associated with the object. - * - * @since 12 - */ -enum Data_Flag_Constants { - /** The data stream can be read. */ - TEE_DATA_FLAG_ACCESS_READ = 0x00000001, - /** The data stream can be written or truncated. */ - TEE_DATA_FLAG_ACCESS_WRITE = 0x00000002, - /** The data stream can be deleted or renamed. */ - TEE_DATA_FLAG_ACCESS_WRITE_META = 0x00000004, - /** Multiple TEE_ObjectHandles can be opened for concurrent read. */ - TEE_DATA_FLAG_SHARE_READ = 0x00000010, - /** Multiple TEE_ObjectHandles can be opened for concurrent write. */ - TEE_DATA_FLAG_SHARE_WRITE = 0x00000020, - /** Reserved. */ - TEE_DATA_FLAG_CREATE = 0x00000200, - /** - * Protect the existing file with the same name. Throw an error if the file with the same name exists; - * create a data file otherwise. - */ - TEE_DATA_FLAG_EXCLUSIVE = 0x00000400, - /** - * Protect the existing file with the same name. Throw an error if the file with the same name exists; - * create a data file otherwise. - */ - TEE_DATA_FLAG_OVERWRITE = 0x00000400, - /** Use AES256 if bit 28 is 1; use AES128 if bit 28 is 0. */ - TEE_DATA_FLAG_AES256 = 0x10000000, - /** If bit 29 is set to 1, open the earlier version preferentially. */ - TEE_DATA_FLAG_OPEN_AESC = 0x20000000, -}; - -/** - * @brief Creates a persistent object. - * - * This function creates a persistent object with initialized TEE_Attribute and data stream. - * You can use the returned handle to access the TEE_Attribute and data stream of the object. - * - * @param storageID Indicates the storage to use. The value is specified by Object_Storage_Constants. - * @param ojbectID Indicates the pointer to the object identifier, that is, the name of the object to create. - * @param objectIDLen Indicates the length of the object identifier, in bytes. It cannot exceed 128 bytes. - * @param flags Indicates the flags of the object created. The value can be - * one or more of Data_Flag_Constants or Handle_Flag_Constants. - * @param attributes Indicates the TEE_ObjectHandle of a transient object from which to take - * TEE_Attribute. It can be TEE_HANDLE_NULL if the persistent object contains no attribute. - * @param initialData Indicates the pointer to the initial data used to initialize the data stream data. - * @param initialDataLen Indicates the length of the initial data, in bytes. - * @param object Indicates the pointer to the TEE_ObjectHandle returned - * after the function is successfully executed. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_ITEM_NOT_FOUND if the storage specified by storageID does not exist. - * Returns TEE_ERROR_ACCESS_CONFLICT if an access conflict occurs. - * Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * Returns TEE_ERROR_STORAGE_NO_SPACE if there is no enough space to create the object. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_CreatePersistentObject(uint32_t storageID, const void *ojbectID, size_t objectIDLen, uint32_t flags, - TEE_ObjectHandle attributes, const void *initialData, size_t initialDataLen, - TEE_ObjectHandle *object); - -/** - * @brief Opens an existing persistent object. - * - * The handle returned can be used to access the TEE_Attribute and data stream of the object. - * - * @param storageID Indicates the storage to use. The value is specified by Object_Storage_Constants. - * @param ojbectID Indicates the pointer to the object identifier, that is, the name of the object to open. - * @param objectIDLen Indicates the length of the object identifier, in bytes. It cannot exceed 128 bytes. - * @param flags Indicates the flags of the object opened. - * The value can be one or more of Data_Flag_Constants or Handle_Flag_Constants. - * @param object Indicates the pointer to the TEE_ObjectHandle returned - * after the function is successfully executed. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_ITEM_NOT_FOUND if the storage specified by storageID does not exist - * or the object identifier cannot be found in the storage. - * Returns TEE_ERROR_ACCESS_CONFLICT if an access conflict occurs. - * Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_OpenPersistentObject(uint32_t storageID, const void *ojbectID, size_t objectIDLen, uint32_t flags, - TEE_ObjectHandle *object); - -/** - * @brief Reads data from the data stream associated with an object into the buffer. - * - * The TEE_ObjectHandle of the object must have been opened with the TEE_DATA_FLAG_ACCESS_READ permission. - * - * @param ojbect Indicates the TEE_ObjectHandle of the object to read. - * @param buffer Indicates the pointer to the buffer used to store the data read. - * @param size Indicates the number of bytes to read. - * @param count Indicates the pointer to the variable that contains the number of bytes read. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_ReadObjectData(TEE_ObjectHandle ojbect, void *buffer, size_t size, uint32_t *count); - -/** - * @brief Writes bytes from the buffer to the data stream associated with an object. - * - * The TEE_ObjectHandle must have been opened with the TEE_DATA_FLAG_ACCESS_WRITE permission. - * - * @param ojbect Indicates the TEE_ObjectHandle of the object. - * @param buffer Indicates the pointer to the buffer that stores the data to be written. - * @param size Indicates the number of bytes to be written. It cannot exceed 4096 bytes. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * Returns TEE_ERROR_STORAGE_NO_SPACE if the storage space is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_WriteObjectData(TEE_ObjectHandle ojbect, const void *buffer, size_t size); - -/** - * @brief Changes the size of a data stream. - * - * If the size is less than the current size of the data stream, all bytes beyond size are deleted. If the size - * is greater than the current size of the data stream, add 0s at the end of the stream to extend the stream. - * The object handle must be opened with the TEE_DATA_FLAG_ACCESS_WRITE permission. - * - * @param object Indicates the TEE_ObjectHandle of the object. - * @param size Indicates the new size of the data stream. It cannot exceed 4096 bytes. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_STORAGE_NO_SPACE if the storage space is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TruncateObjectData(TEE_ObjectHandle object, size_t size); - -/** - * @brief Sets the position of the data stream to which TEE_ObjectHandle points. - * - * The data position indicator is determined by the start position and an offset together. - * The whence parameter determines the start position. Its value is set in TEE_Whence as follows: - * TEE_DATA_SEEK_SET = 0: The start position is the beginning of the data stream. - * TEE_DATA_SEEK_CUR: The start position is the current position of the data stream. - * TEE_DATA_SEEK_END: The start position is the end of the data stream. - * If the parameter offset is a positive number, the data position is moved forward. - * If offset is a negative number, the data position is moved backward. - * - * @param object Indicates the TEE_ObjectHandle of the object. - * @param offset Indicates the number of bytes to move the data position. It cannot exceed 4096 bytes. - * @param whence Indicates the start position in the data stream to calculate the new position. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OVERFLOW if the position indicator resulting from this operation - * is greater than TEE_DATA_MAX_POSIT. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SeekObjectData(TEE_ObjectHandle object, int32_t offset, TEE_Whence whence); - -/** - * @brief Synchronizes the opened TEE_ObjectHandle and the corresponding security attribute file to the disk. - * - * @param object Indicates the TEE_ObjectHandle of the object. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SyncPersistentObject(TEE_ObjectHandle object); - -/** - * @brief Changes the object identifier. - * - * The TEE_ObjectHandle must have been opened with the TEE_DATA_FLAG_ACCESS_WRITE_META permission. - * - * @param object Indicates the handle of the target object. - * @param newObjectID Indicates the pointer to the new object identifier. - * @param newObjectIDLen Indicates the length of the new object identifier. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RenamePersistentObject(TEE_ObjectHandle object, void *newObjectID, size_t newObjectIDLen); - -/** - * @brief Allocates a handle on an uninitialized object enumerator. - * - * @param obj_enumerator Indicates the pointer to the handle of the newly created object enumerator. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AllocatePersistentObjectEnumerator(TEE_ObjectEnumHandle *obj_enumerator); - -/** - * @brief Releases all resources associated with an object enumerator handle. - * - * After this function is called, the object handle is no longer valid and all resources associated with - * the object enumerator handle will be reclaimed. - * TEE_FreePersistentObjectEnumerator and TEE_AllocatePersistentObjectEnumeratorare used in pairs. - * - * @param obj_enumerator Indicates the TEE_ObjectEnumHandle to release. - * - * @since 12 - * @version 1.0 - */ -void TEE_FreePersistentObjectEnumerator(TEE_ObjectEnumHandle obj_enumerator); - -/** - * @brief Resets an object enumerator handle to its initial state after allocation. - * - * @param obj_enumerator Indicates the TEE_ObjectEnumHandle of the object enumerator to reset. - * - * @since 12 - * @version 1.0 - */ -void TEE_ResetPersistentObjectEnumerator(TEE_ObjectEnumHandle obj_enumerator); - -/** - * @brief Starts the enumeration of all the objects in the given trusted storage. - * - * The object information can be obtained by using TEE_GetNextPersistentObject. - * - * @param obj_enumerator Indicates the TEE_ObjectEnumHandle of the object enumerator. - * @param storage_id Indicates the storage, in which the objects are enumerated. - * The value is specified by Object_Storage_Constants. - * Currently, only TEE_STORAGE_PRIVATE is supported. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ITEM_NOT_FOUND if storageID is not TEE_STORAGE_PRIVATE - * or there is no object in the specified storage. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_StartPersistentObjectEnumerator(TEE_ObjectEnumHandle obj_enumerator, uint32_t storage_id); - -/** - * @brief Obtains the next object in the object enumerator. - * - * Information such as TEE_ObjectInfo, objectID, and objectIDLen will be obtained. - * - * @param obj_enumerator Indicates the TEE_ObjectEnumHandle of the object enumerator. - * @param object_info Indicates the pointer to the obtainedTEE_ObjectInfo. - * @param object_id Indicates the pointer to the buffer used to store the obtained objectID. - * @param object_id_len Indicates the pointer to the objectIDLen. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ITEM_NOT_FOUND if the object enumerator has no element - * or the enumerator has not been initialized. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetNextPersistentObject(TEE_ObjectEnumHandle obj_enumerator, - TEE_ObjectInfo *object_info, void *object_id, size_t *object_id_len); - -/** - * @brief Closes a TEE_ObjectHandle and deletes the object. - * - * The object must be a persistent object, and the object handle must have been opened with - * the TEE_DATA_FLAG_ACCESS_WRITE_META permission. - * - * @param object Indicates the object handle to close. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_STORAGE_NOT_AVAILABLE if the object is stored - * in a storage area that is inaccessible currently. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_CloseAndDeletePersistentObject1(TEE_ObjectHandle object); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_tui_gp_api.h b/tee/include/tee_tui_gp_api.h deleted file mode 100644 index b50011f69..000000000 --- a/tee/include/tee_tui_gp_api.h +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TASK_TUI_GP_API_H -#define TASK_TUI_GP_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_tui_gp_api.h - * - * @brief Provides APIs for operating big integers. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define TEE_TUI_NUMBER_BUTTON_TYPES 0x00000006 -#define TEE_STORAGE_PRIVATE 0x00000001 -#define DEFAULT_MAX_ENTRY_FIELDS 3 - -#define TUI_EXIT 8 - -/** - * @brief Enumerates the modes supported when displaying characters within an input entry field. - * - * @since 12 - */ -typedef enum { - /** Never visible, displayed as '*'. */ - TEE_TUI_HIDDEN_MODE = 0, - /** Always visible. */ - TEE_TUI_CLEAR_MODE, - /** Visible then hidden. */ - TEE_TUI_TEMPORARY_CLEAR_MODE -} TEE_TUIEntryFieldMode; - -/** - * @brief Enumerates the input types supported of the TUI entry field. - * - * @since 12 - */ -typedef enum { - /** When the field accepts only digits as inputs. */ - TEE_TUI_NUMERICAL = 0, - /** When the field accepts characters and digits as inputs. */ - TEE_TUI_ALPHANUMERICAL, -} TEE_TUIEntryFieldType; - -/** - * @brief Enumerates the TUI screen orientation. - * @attention Currently {@code TEE_TUI_LANDSCAPE} is not supported. - * - * @since 12 - */ -typedef enum { - /** Displayed as a portrait, i.e. vertically. */ - TEE_TUI_PORTRAIT = 0, - /** Displayed as a landscape, i.e. horizontally. */ - TEE_TUI_LANDSCAPE, -} TEE_TUIScreenOrientation; - -/** - * @brief Enumerates the types of the button. - * - * @since 12 - */ -typedef enum { - /** Used to delete the previous input digit. */ - TEE_TUI_CORRECTION = 0, - /** Exits the interface. */ - TEE_TUI_OK, - /** Cancels the operation and exits the interface. */ - TEE_TUI_CANCEL, - /** Used to trigger PIN verifcation and exit the interface.*/ - TEE_TUI_VALIDATE, - /** Exit the current interface and ask the TA to display the previous interface. */ - TEE_TUI_PREVIOUS, - /** Exit the current interface and ask the TA to display the next interface. */ - TEE_TUI_NEXT, -} TEE_TUIButtonType; - -/** - * @brief Enumerates source of the uesd image. - * - * @since 12 - */ -typedef enum { - /** No picture provided in the input. */ - TEE_TUI_NO_SOURCE = 0, - /** The picture provided as a memory pointer. */ - TEE_TUI_REF_SOURCE, - /** The picture provided by an object in the secure storage. */ - TEE_TUI_OBJECT_SOURCE, - /** The picture provided as a file. */ - TEE_TUI_FILE_SOURCE = 0x8001 -} TEE_TUIImageSource; - -/** - * @brief Represents the image in PNG format. - * - * @since 12 - */ -typedef struct { - TEE_TUIImageSource source; - struct { - void *image; - size_t imageLength; - } ref; - struct { - uint32_t storageID; - void *objectID; - size_t objectIDLen; - } object; - /** Represents the number of pixels of the width of the image. */ - uint32_t width; - /** Represents the number of pixels of the height of the image. */ - uint32_t height; -} TEE_TUIImage; - -/** - * @brief Enumerates the GP color index. - * - * @since 12 - */ -enum gp_color_idx { - /** Red color index. */ - RED_IDX = 0, - /** Green color index. */ - GREEN_IDX = 1, - /** Blue color index. */ - BLUE_IDX = 2, - /** RGB color index. */ - RGB_COLOR_IDX = 3, -}; - -/** - * @brief Represents the label for TA branding/message, generally on the top of screen. - * - * @since 12 - */ -typedef struct { - /** It's the string to put in the label area, which can be NULL. */ - char *text; - /** X-coordinate of the upper left corner of the text information. */ - uint32_t textXOffset; - /** Y-coordinate of the upper left corner of the text information. */ - uint32_t textYOffset; - /** RGB color used for displaying the text information. */ - uint8_t textColor[RGB_COLOR_IDX]; - /** The image is placed in the label area. */ - TEE_TUIImage image; - /** X-coordinate of the upper left corner of the image to be displayed. */ - uint32_t imageXOffset; - /** Y-coordinate of the upper left corner of the image to be displayed. */ - uint32_t imageYOffset; -} TEE_TUIScreenLabel; - -/** - * @brief Represents the content displayed on a button. - * - * @since 12 - */ -typedef struct { - /** It's the string to associate with the button, which can be NULL. */ - char *text; - /** The image to associate with the button. */ - TEE_TUIImage image; -} TEE_TUIButton; - -/** - * @brief Represents the configuration about the TUI screen. - * - * @since 12 - */ -typedef struct { - /** The requested screen orientation. */ - TEE_TUIScreenOrientation screenOrientation; - /** The specifies label of the screen.*/ - TEE_TUIScreenLabel label; - /** Customizes the buttons compared to the default. */ - TEE_TUIButton *buttons[TEE_TUI_NUMBER_BUTTON_TYPES]; - /** Specifes which buttons to be displayed. */ - bool requestedButtons[TEE_TUI_NUMBER_BUTTON_TYPES]; -} TEE_TUIScreenConfiguration; - -/** - * @brief Represents the information about a TUI screen button. - * @attention The {@code buttonTextCustom} and {@code buttonImageCustom} cannot be set to true at the same time. - * - * @since 12 - */ -typedef struct { - /** Defaut label value of the button text. If the value is NULL means the parameter is unavailable. */ - const char *buttonText; - /** The pixel width of the button. - * If the text or image on the button cannot be customized, the value is 0. - */ - uint32_t buttonWidth; - /** The pixel height of the button. - * If the text or image on the button cannot be customized, the value is 0. - */ - uint32_t buttonHeight; - /** If the text on the button cannot be customized, the value is true. */ - bool buttonTextCustom; - /** If the image on the button cannot be customized, the value is true. */ - bool buttonImageCustom; -} TEE_TUIScreenButtonInfo; - -/** - * @brief Represents the information displayed on the TUI. - * - * @since 12 - */ -typedef struct { - /** Available grayscale. */ - uint32_t grayscaleBitsDepth; - /** Available red depth level. */ - uint32_t redBitsDepth; - /** Available green depth level. */ - uint32_t greenBitsDepth; - /** Available blue depth level. */ - uint32_t blueBitsDepth; - /** Indicates the number of pixels per inch in the width direction. */ - uint32_t widthInch; - /** Indicates the number of pixels per inch in the height direction. */ - uint32_t heightInch; - /** Indicates the maximum number of entries that can be displayed on the TUI. */ - uint32_t maxEntryFields; - /** Indicates the pixel width of the input region label. */ - uint32_t entryFieldLabelWidth; - /** Indicates the pixel height of the input region label. */ - uint32_t entryFieldLabelHeight; - /** Indicates the maximum number of characters that can be entered in the entry field. */ - uint32_t maxEntryFieldLength; - /** RGB value of the default label canvas. */ - uint8_t labelColor[RGB_COLOR_IDX]; - /** Indicates the pixel width of the label canvas. */ - uint32_t labelWidth; - /** Indicates the pixel height of the label canvas. */ - uint32_t labelHeight; - /** Indicates the information of the buttons on the interface. */ - TEE_TUIScreenButtonInfo buttonInfo[TEE_TUI_NUMBER_BUTTON_TYPES]; -} TEE_TUIScreenInfo; - -/** - * @brief Represents the information in an entry field that requires user input. - * - * @since 12 - */ -typedef struct { - /** Indicates the label of the entry field. */ - char *label; - /** Indicates the mode used to display characters. */ - TEE_TUIEntryFieldMode mode; - /** Indicates the type of the characters can be entered in the entry field. */ - TEE_TUIEntryFieldType type; - /** The minimum number of characters to be entered. */ - uint32_t minExpectedLength; - /** The maximum number of characters to be entered. */ - uint32_t maxExpectedLength; - /** Contains the content entered by user. */ - char *buffer; - /** Indicates the length of the buffer. */ - size_t bufferLength; -} TEE_TUIEntryField; - -/** - * @brief Initializing the TUI resources. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_NOT_SUPPORTED} if the device is not support TUI. - * Returns {@code TEE_ERROR_BUSY} if the TUI resources cannot be reserved. - * Returns {@code TEE_ERROR_OUT_OF_MEMORY} if the system ran out of the resources. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUIInitSession(void); - - -/** - * @brief Releases TUI resources previously acquired. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_STATE} if the current TA is not within a TUI session initially - * started by a successful call to {@code TEE_TUIInitSession}. - * Returns {@code TEE_ERROR_BUSY} if the TUI resources currently are in use. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUICloseSession(void); - -/** - * @brief Allows a TA to check whether a given text can be rendered by the current implementation and - * retrieves information about the size and width that is needed to render it. - * - * @param text Indicates the string to be checked. - * @param width Indicates the width in pixels needed to render the text. - * @param height Indicates the height in pixels needed to render the text. - * @param last_index Indicates the last character that has been checked - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_NOT_SUPPORTED} if at least one of the characters present - * in the text string cannot be rendered. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUICheckTextFormat(const char *text, uint32_t *width, uint32_t *height, uint32_t *last_index); - -/** - * @brief Retrieves information about the screen depending on its orientation and - * the number of required entry fields. - * - * @param screenOrientation Defines for which orientation screen information is requested. - * @param nbEntryFields Indicates the number of the requested entry fields. - * @param screenInfo Indicates the information on the requested screen for a given orientation. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_NOT_SUPPORTED} if the number of entry fields is not supported. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUIGetScreenInfo(TEE_TUIScreenOrientation screenOrientation, - uint32_t nbEntryFields, - TEE_TUIScreenInfo *screenInfo); -/** - * @brief Display a TUI screen. - * - * @param screenConfiguration Indicates the configuration of the labels and optional buttons on the display interface. - * @param closeTUISession If the value is true, the TUI session will automatically closed when exiting the function. - * @param entryFields Indicates the information of entry field. - * @param entryFieldCount Indicates the count of the entry fields. - * @param selectedButton Indicates which button has been selected by the user to exit the TUI screen. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_OUT_OF_MEMORY} if the system ran out of the resources. - * Returns {@code TEE_ERROR_ITEM_NOT_FOUND} if at least one image provided by the TA refers to a storage - * denoted by a storageID which dose not exist or if the corresponding object identifier cannot be found in the storage. - * Returns {@code TEE_ERROR_ACCESS_CONFLICT} if at least one image provided by the TA refers to a data - * object in the trusted storage and an access right conflict was detected while opening the object. - * Returns {@code TEE_ERROR_BAD_FORMAT} if at least one input image is not compliant with PNG format. - * Returns {@code TEE_ERROR_BAD_STATE} if the current TA is not within a TUI session - * initially started by a successful call to {@code TEE_TUIInitSession}. - * Returns {@code TEE_ERROR_BUSY} if the TUI resources are currently in use, i.e. a TUI screen is displayed. - * Returns {@code TEE_ERROR_CANCEL} if the operation has been cancelled while a TUI screen is currently - * displayed. - * Returns {@code TEE_ERROR_EXTERNAL_CANCEL} if the operation has been cancelled by an external event which - * occurred in the REE while a TUI screen is currently displayed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUIDisplayScreen(TEE_TUIScreenConfiguration *screenConfiguration, - bool closeTUISession, - TEE_TUIEntryField *entryFields, - uint32_t entryFieldCount, - TEE_TUIButtonType *selectedButton); - -/** - * @brief Fringerprint identification port. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_NOT_SUPPORTED} if the device is not support TUI. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUINotify_fp(void); - -/** - * @brief Set the Chinese character encoding. The system supports UTF-8 by default. - * - * @param type Indicates the encoding type. The value 1 indicates GBK. Other values are not supported. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_NOT_SUPPORTED} if the device is not support this function. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUISetInfo(int32_t type); - -/** - * @brief Send message to TUI. - * - * @param type Indicates the messages send to the TUI. Only support {@code TUI_EXIT}. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUISendEvent(int32_t type); - -/** - * @brief Setting the TUI background image. - * - * @param label Configure the background image information in the label variable. - * The image must be a PNG image in array format. - * @param len Indicates the label size. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_GENERIC} if input parameter is incorrect. - * Returns {@code TEE_ERROR_ACCESS_DENIED} if the permission verification failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUISetLabel(TEE_TUIScreenLabel *label, uint32_t len); -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/libteec.ndk.json b/tee/libteec.ndk.json deleted file mode 100644 index 2083549f8..000000000 --- a/tee/libteec.ndk.json +++ /dev/null @@ -1,11 +0,0 @@ -[ - { "name": "TEEC_InitializeContext" }, - { "name": "TEEC_FinalizeContext" }, - { "name": "TEEC_OpenSession" }, - { "name": "TEEC_CloseSession" }, - { "name": "TEEC_InvokeCommand" }, - { "name": "TEEC_RegisterSharedMemory" }, - { "name": "TEEC_AllocateSharedMemory" }, - { "name": "TEEC_ReleaseSharedMemory" }, - { "name": "TEEC_RequestCancellation" } -] \ No newline at end of file -- Gitee From a80c2935c4d46534992ab14d808c30f3512bcb17 Mon Sep 17 00:00:00 2001 From: liuyifei Date: Tue, 19 Nov 2024 13:55:44 +0000 Subject: [PATCH 439/620] =?UTF-8?q?=20hilog=20API=20Lint=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuyifei --- hiviewdfx/hilog/include/hilog/log.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hiviewdfx/hilog/include/hilog/log.h b/hiviewdfx/hilog/include/hilog/log.h index 829eee92e..5fa41928a 100644 --- a/hiviewdfx/hilog/include/hilog/log.h +++ b/hiviewdfx/hilog/include/hilog/log.h @@ -13,8 +13,6 @@ * limitations under the License. */ -#ifndef HIVIEWDFX_HILOG_H -#define HIVIEWDFX_HILOG_H /** * @addtogroup HiLog * @{ @@ -57,8 +55,14 @@ * Output result:\n * 05-06 15:01:06.870 1051 1051 W 0201/MY_TAG: Failed to visit , reason:503.\n * + * @library libhilog.so + * @syscap SystemCapability.HiviewDFX.HiLog * @since 8 */ + +#ifndef HIVIEWDFX_HILOG_H +#define HIVIEWDFX_HILOG_H + #include #include -- Gitee From 3e39a8adc94bdd7655928834f989755534d78943 Mon Sep 17 00:00:00 2001 From: liumingxiang Date: Tue, 19 Nov 2024 22:04:08 +0800 Subject: [PATCH 440/620] Add new FontCollection Global Instance interface Signed-off-by: liumingxiang --- .../native_drawing/drawing_font_collection.h | 10 ++++++++++ .../native_drawing/libnative_drawing.ndk.json | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_font_collection.h b/graphic/graphic_2d/native_drawing/drawing_font_collection.h index 5f7277d72..140065374 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font_collection.h +++ b/graphic/graphic_2d/native_drawing/drawing_font_collection.h @@ -105,6 +105,16 @@ OH_Drawing_FontCollection* OH_Drawing_CreateSharedFontCollection(void); * @version 1.0 */ void OH_Drawing_ClearFontCaches(OH_Drawing_FontCollection*); + +/** + * @brief Get the OH_Drawing_FontCollection global instance. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @return Return the pointer to the OH_Drawing_FontCollection global instance. + * @since 14 + * @version 1.0 + */ +OH_Drawing_FontCollection* OH_Drawing_GetFontCollectionGlobalInstance(void); #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 353ce3f53..a0ac4408f 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1721,5 +1721,9 @@ { "first_introduced": "14", "name":"OH_Drawing_GetRunGlyphCount" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetFontCollectionGlobalInstance" } ] \ No newline at end of file -- Gitee From 8ac67cc1f70c796345b230830176578ca5b31d63 Mon Sep 17 00:00:00 2001 From: wangyulie Date: Tue, 19 Nov 2024 20:08:03 +0800 Subject: [PATCH 441/620] =?UTF-8?q?=E8=A7=84=E8=8C=83=E6=80=A7=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyulie --- resourceschedule/ffrt/c/condition_variable.h | 3 ++- resourceschedule/ffrt/c/loop.h | 5 +++-- resourceschedule/ffrt/c/mutex.h | 4 ++-- resourceschedule/ffrt/c/queue.h | 7 ++++--- resourceschedule/ffrt/c/sleep.h | 3 ++- resourceschedule/ffrt/c/task.h | 3 ++- resourceschedule/ffrt/c/timer.h | 5 +++-- resourceschedule/ffrt/c/type_def.h | 10 +++++++++- 8 files changed, 27 insertions(+), 13 deletions(-) diff --git a/resourceschedule/ffrt/c/condition_variable.h b/resourceschedule/ffrt/c/condition_variable.h index 0e80e02c2..0c0534246 100644 --- a/resourceschedule/ffrt/c/condition_variable.h +++ b/resourceschedule/ffrt/c/condition_variable.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares the condition variable interfaces in C. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 10 * @version 1.0 @@ -117,3 +117,4 @@ FFRT_C_API int ffrt_cond_timedwait(ffrt_cond_t* cond, ffrt_mutex_t* mutex, const */ FFRT_C_API int ffrt_cond_destroy(ffrt_cond_t* cond); #endif +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/c/loop.h b/resourceschedule/ffrt/c/loop.h index 95d6a8bef..0b330a18f 100644 --- a/resourceschedule/ffrt/c/loop.h +++ b/resourceschedule/ffrt/c/loop.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares the loop interfaces in C. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 12 * @version 1.0 @@ -133,4 +133,5 @@ FFRT_C_API ffrt_timer_t ffrt_loop_timer_start( */ FFRT_C_API int ffrt_loop_timer_stop(ffrt_loop_t loop, ffrt_timer_t handle); -#endif \ No newline at end of file +#endif +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/c/mutex.h b/resourceschedule/ffrt/c/mutex.h index 1c397cdd3..c8f28ac0f 100644 --- a/resourceschedule/ffrt/c/mutex.h +++ b/resourceschedule/ffrt/c/mutex.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares the mutex interfaces in C. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 10 * @version 1.0 @@ -42,7 +42,6 @@ /** * @brief Initializes mutex attr. * - * @param mutex Indicates a pointer to the mutex. * @param attr Indicates a pointer to the mutex attribute. * @return {@link ffrt_success} 0 - success * {@link ffrt_error_inval} 22 - if attr is null. @@ -142,3 +141,4 @@ FFRT_C_API int ffrt_mutex_trylock(ffrt_mutex_t* mutex); */ FFRT_C_API int ffrt_mutex_destroy(ffrt_mutex_t* mutex); #endif +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/c/queue.h b/resourceschedule/ffrt/c/queue.h index 9b6deb655..fb077e38e 100644 --- a/resourceschedule/ffrt/c/queue.h +++ b/resourceschedule/ffrt/c/queue.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares the queue interfaces in C. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 10 * @version 1.0 @@ -72,7 +72,7 @@ FFRT_C_API void ffrt_queue_attr_destroy(ffrt_queue_attr_t* attr); * @brief Sets the QoS for a queue attribute. * * @param attr Indicates a pointer to the queue attribute. - * @param attr Indicates the QoS. + * @param qos Indicates the QoS. * @since 10 * @version 1.0 */ @@ -233,4 +233,5 @@ FFRT_C_API ffrt_queue_t ffrt_get_main_queue(); */ FFRT_C_API ffrt_queue_t ffrt_get_current_queue(); -#endif // FFRT_API_C_QUEUE_H \ No newline at end of file +#endif // FFRT_API_C_QUEUE_H +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/c/sleep.h b/resourceschedule/ffrt/c/sleep.h index ee4a7196f..777cb553d 100644 --- a/resourceschedule/ffrt/c/sleep.h +++ b/resourceschedule/ffrt/c/sleep.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares the sleep and yield interfaces in C. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 10 * @version 1.0 @@ -59,3 +59,4 @@ FFRT_C_API int ffrt_usleep(uint64_t usec); */ FFRT_C_API void ffrt_yield(void); #endif +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/c/task.h b/resourceschedule/ffrt/c/task.h index b789fdc74..786661d82 100644 --- a/resourceschedule/ffrt/c/task.h +++ b/resourceschedule/ffrt/c/task.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares the task interfaces in C. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 10 * @version 1.0 @@ -276,3 +276,4 @@ FFRT_C_API void ffrt_wait_deps(const ffrt_deps_t* deps); FFRT_C_API void ffrt_wait(void); #endif +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/c/timer.h b/resourceschedule/ffrt/c/timer.h index 99ce5254a..a12610aae 100644 --- a/resourceschedule/ffrt/c/timer.h +++ b/resourceschedule/ffrt/c/timer.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares the timer interfaces in C. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 12 * @version 1.0 @@ -66,4 +66,5 @@ FFRT_C_API ffrt_timer_t ffrt_timer_start(ffrt_qos_t qos, uint64_t timeout, void* * @version 1.0 */ FFRT_C_API int ffrt_timer_stop(ffrt_qos_t qos, ffrt_timer_t handle); -#endif \ No newline at end of file +#endif +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/c/type_def.h b/resourceschedule/ffrt/c/type_def.h index 8d9f7c1ab..2a4343bff 100644 --- a/resourceschedule/ffrt/c/type_def.h +++ b/resourceschedule/ffrt/c/type_def.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares common types. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 10 * @version 1.0 @@ -65,6 +65,7 @@ typedef enum { /** * @brief Enumerates the task QoS types. * + * @since 10 */ typedef enum { /** Inheritance. */ @@ -85,6 +86,7 @@ typedef void(*ffrt_function_t)(void*); /** * @brief Defines a task executor. * + * @since 10 */ typedef struct { /** Function used to execute a task. */ @@ -98,6 +100,7 @@ typedef struct { /** * @brief Defines the storage size of multiple types of structs. * + * @since 10 */ typedef enum { /** Task attribute storage size. */ @@ -115,6 +118,7 @@ typedef enum { /** * @brief Enumerates the task types. * + * @since 10 */ typedef enum { /** General task. */ @@ -126,6 +130,7 @@ typedef enum { /** * @brief dependency type. * + * @since 10 */ typedef enum { /** Data dependency type. */ @@ -137,6 +142,7 @@ typedef enum { /** * @brief dependency data structure. * + * @since 10 */ typedef struct { /** Dependency type. */ @@ -148,6 +154,7 @@ typedef struct { /** * @brief Defines the dependency struct. * + * @since 10 */ typedef struct { /** Number of dependencies. */ @@ -244,3 +251,4 @@ using qos = int; } #endif #endif +/** @} */ \ No newline at end of file -- Gitee From d76364a053265185777fc30d87a76d71a71d1451 Mon Sep 17 00:00:00 2001 From: liufei Date: Wed, 20 Nov 2024 11:56:04 +0800 Subject: [PATCH 442/620] add api lint Signed-off-by: liufei --- .../native_drawing/drawing_text_typography.h | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 10f1c9071..275f0af37 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1247,15 +1247,15 @@ float OH_Drawing_GetBottomFromTextBox(OH_Drawing_TextBox* textbox, int index); int OH_Drawing_GetTextDirectionFromTextBox(OH_Drawing_TextBox* textbox, int index); /** - * @brief Gets size of textbox. + * @brief Gets size of textBox. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextBox Indicates the pointer to an OH_Drawing_TextBox object. - * @return Returns size of textbox. + * @param textBox Indicates the pointer to an OH_Drawing_TextBox object. + * @return Returns size of textBox. * @since 11 * @version 1.0 */ -size_t OH_Drawing_GetSizeOfTextBox(OH_Drawing_TextBox*); +size_t OH_Drawing_GetSizeOfTextBox(OH_Drawing_TextBox* textBox); /** * @brief Gets the glyphposition at coordinate. @@ -1289,12 +1289,12 @@ OH_Drawing_PositionAndAffinity* OH_Drawing_TypographyGetGlyphPositionAtCoordinat * @brief Gets position from position and affinity. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_PositionAndAffinity Indicates the pointer to an OH_Drawing_PositionAndAffinity object. + * @param positionAndAffinity Indicates the pointer to an OH_Drawing_PositionAndAffinity object. * @return Returns position from position and affinity. * @since 11 * @version 1.0 */ -size_t OH_Drawing_GetPositionFromPositionAndAffinity(OH_Drawing_PositionAndAffinity*); +size_t OH_Drawing_GetPositionFromPositionAndAffinity(OH_Drawing_PositionAndAffinity* positionAndAffinity); /** * @brief Gets affinity from position and affinity. @@ -1323,34 +1323,34 @@ OH_Drawing_Range* OH_Drawing_TypographyGetWordBoundary(OH_Drawing_Typography* ty * @brief Gets start from range. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Range Indicates the pointer to an OH_Drawing_Range object. + * @param range Indicates the pointer to an OH_Drawing_Range object. * @return Returns start from range. * @since 11 * @version 1.0 */ -size_t OH_Drawing_GetStartFromRange(OH_Drawing_Range*); +size_t OH_Drawing_GetStartFromRange(OH_Drawing_Range* range); /** * @brief Gets end from range. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Range Indicates the pointer to an OH_Drawing_Range object. + * @param range Indicates the pointer to an OH_Drawing_Range object. * @return Returns end from range. * @since 11 * @version 1.0 */ -size_t OH_Drawing_GetEndFromRange(OH_Drawing_Range*); +size_t OH_Drawing_GetEndFromRange(OH_Drawing_Range* range); /** * @brief Gets the line count. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param typography Indicates the pointer to an OH_Drawing_Typography object. * @return Returns the line count. * @since 11 * @version 1.0 */ -size_t OH_Drawing_TypographyGetLineCount(OH_Drawing_Typography*); +size_t OH_Drawing_TypographyGetLineCount(OH_Drawing_Typography* typography); /** * @brief Sets the decoration style. @@ -1591,12 +1591,12 @@ OH_Drawing_LineMetrics* OH_Drawing_TypographyGetLineMetrics(OH_Drawing_Typograph * @brief Get the number of lines. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_LineMetrics Indicates the pointer to a line metrics object OH_Drawing_LineMetrics. + * @param lineMetrics Indicates the pointer to a line metrics object OH_Drawing_LineMetrics. * @return Returns the number of lines. * @since 12 * @version 1.0 */ -size_t OH_Drawing_LineMetricsGetSize(OH_Drawing_LineMetrics*); +size_t OH_Drawing_LineMetricsGetSize(OH_Drawing_LineMetrics* lineMetrics); /** * @brief Releases the memory occupied by line metrics. @@ -2145,12 +2145,12 @@ void OH_Drawing_TextStyleDestroyFontFeatures(OH_Drawing_FontFeature* fontFeature * @brief Get size of font features. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return Returns the size of fontfeatures map. * @since 12 * @version 1.0 */ -size_t OH_Drawing_TextStyleGetFontFeatureSize(OH_Drawing_TextStyle*); +size_t OH_Drawing_TextStyleGetFontFeatureSize(OH_Drawing_TextStyle* style); /** * @brief Clear font features. @@ -2188,12 +2188,12 @@ double OH_Drawing_TextStyleGetBaselineShift(OH_Drawing_TextStyle* style); * @brief Gets the text color. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @return Returns the text color. * @since 12 * @version 1.0 */ -uint32_t OH_Drawing_TextStyleGetColor(OH_Drawing_TextStyle*); +uint32_t OH_Drawing_TextStyleGetColor(OH_Drawing_TextStyle* style); /** * @brief Gets text decoration style. @@ -2535,17 +2535,18 @@ bool OH_Drawing_TypographyStyleStrutStyleEquals(OH_Drawing_StrutStyle* from, OH_ */ void OH_Drawing_TypographyStyleSetHintsEnabled(OH_Drawing_TypographyStyle* style, bool hintsEnabled); -/* @brief Getting all font metrics from target row. +/** + * @brief Getting all font metrics from target row. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates a pointer to a typesetting object. + * @param typography Indicates a pointer to a typesetting object. * @param lineNumber Indicates specifies the number of rows. * @param fontMetricsSize Indicates the return size of font metrics struct from current line. * @return Returns all character measures for the current row. * @since 12 * @version 1.0 */ -OH_Drawing_Font_Metrics* OH_Drawing_TypographyGetLineFontMetrics(OH_Drawing_Typography*, +OH_Drawing_Font_Metrics* OH_Drawing_TypographyGetLineFontMetrics(OH_Drawing_Typography* typography, size_t lineNumber, size_t* fontMetricsSize); /** @@ -2572,12 +2573,12 @@ void OH_Drawing_TypographyMarkDirty(OH_Drawing_Typography* typography); * @brief Get the unresolved Glyphs count of lines in a text. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to the text OH_Drawing_Typography object. + * @param typography Indicates the pointer to the text OH_Drawing_Typography object. * @return Returns unresolved Glyphs count. * @since 12 * @version 1.0 */ -int32_t OH_Drawing_TypographyGetUnresolvedGlyphsCount(OH_Drawing_Typography*); +int32_t OH_Drawing_TypographyGetUnresolvedGlyphsCount(OH_Drawing_Typography* typography); /** * @brief Update the font size of lines in a text. @@ -2755,13 +2756,13 @@ OH_Drawing_TextDirection OH_Drawing_TypographyGetTextDirection(OH_Drawing_Typogr * @brief Sets the maximum number of lines in a text. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object + * @param style Indicates the pointer to a typography style object * OH_Drawing_TypographyStyle. * @return Return the maximum number of lines in a text. * @since 12 * @version 1.0 */ -size_t OH_Drawing_TypographyGetTextMaxLines(OH_Drawing_TypographyStyle*); +size_t OH_Drawing_TypographyGetTextMaxLines(OH_Drawing_TypographyStyle* style); /** * @brief Get the ellipsis of lines in a text. -- Gitee From 6783976b2d5237c622d4a93545a3ac86a04bcd5c Mon Sep 17 00:00:00 2001 From: sqwlly Date: Thu, 14 Nov 2024 07:51:04 +0000 Subject: [PATCH 443/620] add new interface sdk c Signed-off-by: s30029175 Signed-off-by: sqwlly Change-Id: I4b73da3d896ce70a34ddf58d6172705d6bf68d82 --- .../native_image/libnative_image.ndk.json | 5 +++- .../graphic_2d/native_image/native_image.h | 25 +++++++------------ .../native_window/graphic_error_code.h | 5 ++++ 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/graphic/graphic_2d/native_image/libnative_image.ndk.json b/graphic/graphic_2d/native_image/libnative_image.ndk.json index 02e835ae7..11e9be9cf 100644 --- a/graphic/graphic_2d/native_image/libnative_image.ndk.json +++ b/graphic/graphic_2d/native_image/libnative_image.ndk.json @@ -11,7 +11,10 @@ { "name": "OH_NativeImage_UnsetOnFrameAvailableListener" }, { "name": "OH_NativeImage_Destroy" }, { "name": "OH_NativeImage_GetTransformMatrixV2" }, - { "name": "OH_NativeImage_GetBufferMatrix" }, + { + "first_introduced": "14", + "name": "OH_NativeImage_GetBufferMatrix" + }, { "first_introduced": "12", "name": "OH_NativeImage_AcquireNativeWindowBuffer" diff --git a/graphic/graphic_2d/native_image/native_image.h b/graphic/graphic_2d/native_image/native_image.h index 4d604e8be..d04af1ea7 100644 --- a/graphic/graphic_2d/native_image/native_image.h +++ b/graphic/graphic_2d/native_image/native_image.h @@ -240,27 +240,20 @@ void OH_NativeImage_Destroy(OH_NativeImage** image); int32_t OH_NativeImage_GetTransformMatrixV2(OH_NativeImage* image, float matrix[16]); /** - * @brief Obtains both the cropping information and transform matrix of the texture image. + * @brief Obtains the transform matrix that combines with crop rect. * - * This API is an enhanced version of OH_NativeImage_GetTransformMatrix. In addition to the transform matrix, - * it also returns the cropping information of the texture image that was set in the most recent call to - * OH_NativeImage_UpdateSurfaceImage. - * - * The transform matrix is a 4x4 matrix that combines both the geometric transformation and texture - * coordinates transformation. The first 12 elements represent the geometric transformation (rotation, - * scaling, translation), and the last 4 elements contain texture coordinate mapping information. + * This API returns a transform matrix that combines the crop rect. + * Note that the matrix will not be updated until OH_NativeImage_UpdateSurfaceImage is called.\n + * This interface is a non-thread-safe type interface.\n * * @syscap SystemCapability.Graphic.Graphic2D.NativeImage - * @param image Pointer to an OH_NativeImage instance. - * @param matrix A float array of size 16 to store the retrieved 4x4 transform matrix. The matrix includes - * both geometric transformation and texture coordinates transformation. - * @return Returns 0 if successful, otherwise returns a negative error code: - * - Returns -1 if any parameter is invalid - * - Returns -2 if the image has not been updated with OH_NativeImage_UpdateSurfaceImage + * @param image Indicates the pointer to a OH_NativeImage instance. + * @param matrix Indicates the retrieved 4*4 transform matrix . + * @return {@link NATIVE_ERROR_OK} 0 - Success. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - image is NULL. + * {@link NATIVE_ERROR_MEM_OPERATION_ERROR} 30001000 - Memory operation error, failed to get transform matrix. * @since 14 * @version 1.0 - * @see OH_NativeImage_UpdateSurfaceImage - * @see OH_NativeImage_GetTransformMatrix */ int32_t OH_NativeImage_GetBufferMatrix(OH_NativeImage* image, float matrix[16]); diff --git a/graphic/graphic_2d/native_window/graphic_error_code.h b/graphic/graphic_2d/native_window/graphic_error_code.h index 1b5e9deb0..0fd706ffa 100644 --- a/graphic/graphic_2d/native_window/graphic_error_code.h +++ b/graphic/graphic_2d/native_window/graphic_error_code.h @@ -52,6 +52,11 @@ extern "C" { typedef enum OHNativeErrorCode { /** @error succeed */ NATIVE_ERROR_OK = 0, + /** + * @error memory operation error + * @since 14 + */ + NATIVE_ERROR_MEM_OPERATION_ERROR = 30001000, /** @error input invalid parameter */ NATIVE_ERROR_INVALID_ARGUMENTS = 40001000, /** @error unauthorized operation */ -- Gitee From 01555d7019328957c131977a028c0ab03c336937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=BE=E9=98=B3=E7=86=A0?= Date: Mon, 18 Nov 2024 21:03:32 +0800 Subject: [PATCH 444/620] =?UTF-8?q?Description:=20sdk=5Fc=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E4=BF=AE=E6=94=B9=20IssueNo:=20https://gitee.com/open?= =?UTF-8?q?harmony/drivers=5Fhdf=5Fcore/issues/IB57T6=20Signed-off-by:=20q?= =?UTF-8?q?ianyangyi=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arkui/display_manager/oh_display_capture.h | 1 + arkui/display_manager/oh_display_info.h | 8 ++-- arkui/display_manager/oh_display_manager.h | 55 +++++++++++----------- 3 files changed, 34 insertions(+), 30 deletions(-) diff --git a/arkui/display_manager/oh_display_capture.h b/arkui/display_manager/oh_display_capture.h index a9fd997b1..0e150db68 100644 --- a/arkui/display_manager/oh_display_capture.h +++ b/arkui/display_manager/oh_display_capture.h @@ -49,6 +49,7 @@ extern "C" { /** * @brief Capture a screen pixelmap of the specified display. * + * @permission {@code ohos.permission.CUSTOM_SCREEN_CAPTURE} * @param displayId The ID of the display to be captured. * @param pixelMap The output pixel map of the captured display. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful. diff --git a/arkui/display_manager/oh_display_info.h b/arkui/display_manager/oh_display_info.h index 2a4bda3fb..82b38a098 100644 --- a/arkui/display_manager/oh_display_info.h +++ b/arkui/display_manager/oh_display_info.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OH_NATIVE_DISPLAY_INFO_H -#define OH_NATIVE_DISPLAY_INFO_H - /** * @addtogroup OH_DisplayInfo * @{ @@ -39,6 +36,11 @@ * @version 1.0 */ + +#ifndef OH_NATIVE_DISPLAY_INFO_H +#define OH_NATIVE_DISPLAY_INFO_H + + #include "stdint.h" #ifdef __cplusplus diff --git a/arkui/display_manager/oh_display_manager.h b/arkui/display_manager/oh_display_manager.h index caf6480af..7f8e45c2b 100644 --- a/arkui/display_manager/oh_display_manager.h +++ b/arkui/display_manager/oh_display_manager.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OH_NATIVE_DISPLAY_MANAGER_H -#define OH_NATIVE_DISPLAY_MANAGER_H - /** * @addtogroup OH_DisplayManager * @{ @@ -33,12 +30,16 @@ * @brief Defines the data structures for the C APIs of the display module. * * @kit ArkUI - * @library libnative_display_manager.so. + * @library libnative_display_manager.so * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 12 * @version 1.0 */ +#ifndef OH_NATIVE_DISPLAY_MANAGER_H +#define OH_NATIVE_DISPLAY_MANAGER_H + + #include "oh_display_info.h" #ifdef __cplusplus @@ -48,7 +49,7 @@ extern "C" { /** * @brief Obtain the default display Id. * - * @param { *displayId } Indicates the pointer to an uint64_t object. + * @param displayId Indicates the pointer to an uint64_t object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -60,7 +61,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayId(uint6 /** * @brief Obtain the default display width. * - * @param { *displayWidth } Indicates the pointer to an int32_t object. + * @param displayWidth Indicates the pointer to an int32_t object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -72,7 +73,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayWidth(in /** * @brief Obtain the default display height. * - * @param { *displayHeight } Indicates the pointer to an int32_t object. + * @param displayHeight Indicates the pointer to an int32_t object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -84,7 +85,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayHeight(i /** * @brief Obtain the default display rotation. * - * @param { *displayRotation } Indicates the pointer to an NativeDisplayManager_Rotation object. + * @param displayRotation Indicates the pointer to an NativeDisplayManager_Rotation object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -97,7 +98,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayRotation /** * @brief Obtain the default display orientation. * - * @param { *displayOrientation } Indicates the pointer to an NativeDisplayManager_Orientation object. + * @param displayOrientation Indicates the pointer to an NativeDisplayManager_Orientation object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -110,7 +111,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayOrientat /** * @brief Obtain the default display virtualPixels. * - * @param { *virtualPixels } Indicates the pointer to an float object. + * @param virtualPixels Indicates the pointer to an float object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -122,7 +123,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayVirtualP /** * @brief Obtain the default display refreshRate. * - * @param { *refreshRate } Indicates the pointer to an uint32_t object. + * @param refreshRate Indicates the pointer to an uint32_t object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -134,7 +135,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayRefreshR /** * @brief Obtain the default display densityDpi. * - * @param { *densityDpi } Indicates the pointer to an int32_t object. + * @param densityDpi Indicates the pointer to an int32_t object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -146,7 +147,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityD /** * @brief Obtain the default display densityPixels. * - * @param { *densityPixels } Indicates the pointer to an float object. + * @param densityPixels Indicates the pointer to an float object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -158,7 +159,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityP /** * @brief Obtain the default display scaledDensity. * - * @param { *scaledDensity } Indicates the pointer to an float object. + * @param scaledDensity Indicates the pointer to an float object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -170,7 +171,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayScaledDe /** * @brief Obtain the default display xDpi. * - * @param { *xDpi } Indicates the pointer to an float object. + * @param xDpi Indicates the pointer to an float object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -182,7 +183,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityX /** * @brief Obtain the default display yDpi. * - * @param { *yDpi } Indicates the pointer to an float object. + * @param yDpi Indicates the pointer to an float object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -194,7 +195,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityY /** * @brief Create the cutout info of the device. * - * @param { **cutoutInfo } Indicates the pointer to an NativeDisplayManager_CutoutInfo object. + * @param cutoutInfo Indicates the pointer to an NativeDisplayManager_CutoutInfo object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -207,7 +208,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateDefaultDisplayCutou /** * @brief Destroy an NativeDisplayManager_CutoutInfo object and reclaims the memory occupied by the object. * - * @param { **cutoutInfo } Indicates the pointer to an NativeDisplayManager_CutoutInfo object. + * @param cutoutInfo Indicates the pointer to an NativeDisplayManager_CutoutInfo object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * @syscap SystemCapability.WindowManager.WindowManager.Core @@ -228,7 +229,7 @@ bool OH_NativeDisplayManager_IsFoldable(); /** * @brief Get the display mode of the foldable device. * - * @param { *displayMode } Indicates the pointer to an NativeDisplayManager_FoldDisplayMode object. + * @param displayMode Indicates the pointer to an NativeDisplayManager_FoldDisplayMode object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. @@ -241,7 +242,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetFoldDisplayMode( /** * @brief the callback function type when display change. * - * @param { *displayId } change display id. + * @param displayId change display id. * @syscap SystemCapability.Window.SessionManager * @since 12 */ @@ -250,8 +251,8 @@ typedef void (*OH_NativeDisplayManager_DisplayChangeCallback)(uint64_t displayId /** * @brief Register the callback for display change listener. * - * @param { displayChangeCallback } display change callback. - * @param { *listenerIndex } Indicates the pointer to an uint32_t object. used in unregister call. + * @param displayChangeCallback display change callback. + * @param listenerIndex Indicates the pointer to an uint32_t object. used in unregister call. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -264,7 +265,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterDisplayChangeList /** * @brief Unregister the callback for display changes listener. * - * @param { listenerIndex } display changed listener index. + * @param listenerIndex display changed listener index. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -276,7 +277,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterDisplayChangeLi /** * @brief the callback function type when display fold change. * - * @param { displayMode } current fold display mode. + * @param displayMode current fold display mode. * @syscap SystemCapability.Window.SessionManager * @since 12 */ @@ -286,8 +287,8 @@ typedef void (*OH_NativeDisplayManager_FoldDisplayModeChangeCallback)( /** * @brief Register the callback for display mode change listener. * - * @param { displayModeChangeCallback } display mode change callback. - * @param { *listenerIndex } Indicates the pointer to an uint32_t object. used in unregister call. + * @param displayModeChangeCallback display mode change callback. + * @param listenerIndex Indicates the pointer to an uint32_t object. used in unregister call. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. @@ -301,7 +302,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterFoldDisplayModeCh /** * @brief Unregister the callback for display mode change listener. * - * @param { listenerIndex } display mode change listener index. + * @param listenerIndex display mode change listener index. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. -- Gitee From 41af88bdbcea7933701db7164b87ce3ec7e3104c Mon Sep 17 00:00:00 2001 From: wanglili12 Date: Wed, 20 Nov 2024 15:28:25 +0800 Subject: [PATCH 445/620] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanglili12 Change-Id: I1253c17ccf1ea708571ecf3dc06ba580ec221fcf --- arkui/ace_engine/native/native_node.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 957b003fd..f83f1a181 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -1792,6 +1792,16 @@ typedef enum { */ NODE_TRANSITION = 94, + /** + * @brief Defines the component ID. + * This attribute can be obtained through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for obtaining the attribute:\n + * .value[0].i32: component ID. \n + * + */ + NODE_UNIQUE_ID = 95, + /** * @brief Set the current component system focus box style. * @@ -1806,16 +1816,6 @@ typedef enum { */ NODE_FOCUS_BOX = 96, - /** - * @brief Defines the component ID. - * This attribute can be obtained through APIs. - * - * Format of the {@link ArkUI_AttributeItem} parameter for obtaining the attribute:\n - * .value[0].i32: component ID. \n - * - */ - NODE_UNIQUE_ID = 95, - /** * @brief Defines the moving distance limit for the component-bound tap gesture. * This attribute can be set as required through APIs. -- Gitee From 5ca2cd4bdeab00455bc2314e93557a65abbb4a46 Mon Sep 17 00:00:00 2001 From: GuoLi Date: Wed, 20 Nov 2024 11:36:44 +0000 Subject: [PATCH 446/620] =?UTF-8?q?API=20Lint=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: GuoLi --- network/netstack/net_websocket/net_websocket.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/network/netstack/net_websocket/net_websocket.h b/network/netstack/net_websocket/net_websocket.h index d83f96f73..303e13bf5 100755 --- a/network/netstack/net_websocket/net_websocket.h +++ b/network/netstack/net_websocket/net_websocket.h @@ -51,10 +51,11 @@ extern "C" { /** * @brief Constructor of websocket. * + * @param onOpen Callback function invoked when a connection setup message is received. * @param onMessage Callback function invoked when a message is received. - * @param onClose Callback function invoked when a connection closing message is closed. * @param onError Callback function invoked when a connection error message is received. - * @param onOpen Callback function invoked when a connection setup message is received. + * @param onClose Callback function invoked when a connection closing message is closed. + * * @return Pointer to the websocket client if success; NULL otherwise. * @syscap SystemCapability.Communication.NetStack * @since 11 @@ -107,7 +108,6 @@ int OH_WebSocketClient_Send(struct WebSocket *client, char *data, size_t length) * @brief Closes a webSocket connection. * * @param client Pointer to the websocket client. - * @param url URL for the client to connect to the server. * @param options Optional parameters. * @return 0 if success; non-0 otherwise. For details about error codes, see {@link OH_Websocket_ErrCode}. * @permission ohos.permission.INTERNET -- Gitee From bf28bb017971072cd34bca291dd5f503983fa685 Mon Sep 17 00:00:00 2001 From: GuoLi Date: Wed, 20 Nov 2024 11:51:05 +0000 Subject: [PATCH 447/620] update Signed-off-by: GuoLi --- network/netstack/net_websocket/net_websocket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/netstack/net_websocket/net_websocket.h b/network/netstack/net_websocket/net_websocket.h index 303e13bf5..6506ba5fa 100755 --- a/network/netstack/net_websocket/net_websocket.h +++ b/network/netstack/net_websocket/net_websocket.h @@ -55,7 +55,7 @@ extern "C" { * @param onMessage Callback function invoked when a message is received. * @param onError Callback function invoked when a connection error message is received. * @param onClose Callback function invoked when a connection closing message is closed. - * + * * @return Pointer to the websocket client if success; NULL otherwise. * @syscap SystemCapability.Communication.NetStack * @since 11 -- Gitee From 65ce6a965860369f6cf3b07451e2c0c120e469dc Mon Sep 17 00:00:00 2001 From: wanxiaoqing Date: Thu, 21 Nov 2024 11:20:46 +0800 Subject: [PATCH 448/620] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanxiaoqing --- distributeddatamgr/udmf/include/udmf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distributeddatamgr/udmf/include/udmf.h b/distributeddatamgr/udmf/include/udmf.h index d8d7149e5..5a8491cfc 100644 --- a/distributeddatamgr/udmf/include/udmf.h +++ b/distributeddatamgr/udmf/include/udmf.h @@ -206,7 +206,7 @@ OH_UdmfRecordProvider* OH_UdmfRecordProvider_Create(); /** * @brief Destroy an {@link OH_UdmfRecordProvider} instance. * - * @param subscriber Pointer to the {@link OH_UdmfRecordProvider} instance to destroy. + * @param provider Pointer to the {@link OH_UdmfRecordProvider} instance to destroy. * @return Returns the status code of the execution. For details, see {@link Udmf_ErrCode}. * Returns {@link UDMF_E_OK} if the operation is successful. * Returns {@link UDMF_E_INVALID_PARAM} if invalid args are detected. -- Gitee From b9814c10b9891a6c716f6b22cb62ac8a19b04934 Mon Sep 17 00:00:00 2001 From: shenshiyi2 Date: Thu, 21 Nov 2024 15:12:15 +0800 Subject: [PATCH 449/620] =?UTF-8?q?=E5=9B=BE=E5=BD=A2API=20Lint=E6=95=B4?= =?UTF-8?q?=E6=94=B9=20OH=5FPixelmapImageInfo=5FGetAlphaType?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenshiyi2 --- multimedia/image_framework/include/image/pixelmap_native.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index fb16d8c0d..ba89797c7 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -568,7 +568,7 @@ Image_ErrorCode OH_PixelmapImageInfo_GetRowStride(OH_Pixelmap_ImageInfo *info, u Image_ErrorCode OH_PixelmapImageInfo_GetPixelFormat(OH_Pixelmap_ImageInfo *info, int32_t *pixelFormat); /** - * @brief Get density number for imageinfo struct. + * @brief Get alphaType number for imageinfo struct. * * @param info The imageinfo pointer will be operated. * @param alphaType The number of image alphaType. -- Gitee From d83c40061689aee1eda08a6cea959ef299533330 Mon Sep 17 00:00:00 2001 From: shilong Date: Thu, 21 Nov 2024 07:16:55 +0000 Subject: [PATCH 450/620] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=9F=E5=BC=83?= =?UTF-8?q?=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- drivers/external_device_manager/usb/usb_ddk_types.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/external_device_manager/usb/usb_ddk_types.h b/drivers/external_device_manager/usb/usb_ddk_types.h index a0cb5e5b1..8c51cd726 100644 --- a/drivers/external_device_manager/usb/usb_ddk_types.h +++ b/drivers/external_device_manager/usb/usb_ddk_types.h @@ -298,6 +298,10 @@ typedef struct UsbDeviceMemMap { typedef enum { /** @error The operation is successful. */ USB_DDK_SUCCESS = 0, + /** @error The operation failed. + * @deprecate since 14 + */ + USB_DDK_FAILED = -1, /** @error Permission denied. */ USB_DDK_NO_PERM = 201, /** @error Invalid parameter. */ @@ -306,6 +310,14 @@ typedef enum { * or memory application failure. */ USB_DDK_MEMORY_ERROR = 27400001, + /** @error Null pointer exception + * @deprecate since 14 + */ + USB_DDK_NULL_PTR = -5, + /** @error Device busy. + * @deprecate since 14 + */ + USB_DDK_DEVICE_BUSY = -6, /** @error Invalid operation. */ USB_DDK_INVALID_OPERATION = 27400002, /** @error Device I/O operation failed. */ -- Gitee From e1efc215cdfe2b6ba3db5774bbfd2519e74b2196 Mon Sep 17 00:00:00 2001 From: shenshiyi2 Date: Thu, 21 Nov 2024 07:23:58 +0000 Subject: [PATCH 451/620] update multimedia/image_framework/include/image/pixelmap_native.h. Signed-off-by: shenshiyi2 --- multimedia/image_framework/include/image/pixelmap_native.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index ba89797c7..b897e2a12 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -571,7 +571,7 @@ Image_ErrorCode OH_PixelmapImageInfo_GetPixelFormat(OH_Pixelmap_ImageInfo *info, * @brief Get alphaType number for imageinfo struct. * * @param info The imageinfo pointer will be operated. - * @param alphaType The number of image alphaType. + * @param alphaType The number of imageinfo alphaType. * @return Returns {@link Image_ErrorCode} * @since 12 */ -- Gitee From 8c13f42913d15a0b2475faa4b374ffd4be2cefd8 Mon Sep 17 00:00:00 2001 From: chenjunxiang Date: Thu, 21 Nov 2024 15:42:49 +0800 Subject: [PATCH 452/620] =?UTF-8?q?=E8=A7=A3=E5=86=B3api=20lint=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenjunxiang Change-Id: I34d3931a88447dc561c62b22246db6e9c58674f5 解决api lint整改 Signed-off-by: chenjunxiang Change-Id: I02b6a01eee5f099411f6a8d691353032997fca43 --- arkui/ace_engine/native/native_interface_accessibility.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arkui/ace_engine/native/native_interface_accessibility.h b/arkui/ace_engine/native/native_interface_accessibility.h index 09f8b97e5..d765c7d77 100644 --- a/arkui/ace_engine/native/native_interface_accessibility.h +++ b/arkui/ace_engine/native/native_interface_accessibility.h @@ -27,6 +27,8 @@ * @file native_interface_accessibility.h * * @brief Declares the APIs used to access the native Accessibility. + * + * @library libace_ndk.z.so * @syscap SystemCapability.ArkUI.ArkUI.Full * @kit ArkUI * @since 13 @@ -1031,3 +1033,4 @@ int32_t OH_ArkUI_FindAccessibilityActionArgumentByKey( }; #endif #endif // _NATIVE_INTERFACE_ACCESSIBILITY_H +/** @} */ \ No newline at end of file -- Gitee From 4019c8087f6e2bc17712b893722866a0012cc21f Mon Sep 17 00:00:00 2001 From: huanghan Date: Thu, 21 Nov 2024 22:14:24 +0800 Subject: [PATCH 453/620] =?UTF-8?q?API=20Lint=E7=9A=84=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huanghan --- ark_runtime/jsvm/jsvm.h | 1237 +++++++++++++++++---------------- ark_runtime/jsvm/jsvm_types.h | 9 +- 2 files changed, 624 insertions(+), 622 deletions(-) diff --git a/ark_runtime/jsvm/jsvm.h b/ark_runtime/jsvm/jsvm.h index 3f47366b4..89ce7ffbd 100644 --- a/ark_runtime/jsvm/jsvm.h +++ b/ark_runtime/jsvm/jsvm.h @@ -12,10 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#ifndef ARK_RUNTIME_JSVM_JSVM_H -#define ARK_RUNTIME_JSVM_JSVM_H - /** * @addtogroup JSVM * @{ @@ -43,9 +39,15 @@ * @since 11 */ + +#ifndef ARK_RUNTIME_JSVM_JSVM_H +#define ARK_RUNTIME_JSVM_JSVM_H + + // This file needs to be compatible with C compilers. #include // NOLINT(modernize-deprecated-headers) #include // NOLINT(modernize-deprecated-headers) +#include "jsvm_types.h" // Use INT_MAX, this should only be consumed by the pre-processor anyway. #define JSVM_VERSION_EXPERIMENTAL 2147483647 @@ -63,8 +65,6 @@ #endif #endif -#include "jsvm_types.h" - #ifndef JSVM_EXTERN #ifdef _WIN32 /** @@ -112,8 +112,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Init(const JSVM_InitOptions* options); /** * @brief This API create a new VM instance. * - * @param options: The options for create the VM instance. - * @param result: The new VM instance. + * @param options The options for create the VM instance. + * @param result The new VM instance. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -124,7 +124,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateVM(const JSVM_CreateVMOptions* options, /** * @brief Destroys VM instance. * - * @param vm: The VM instance to be Destroyed. + * @param vm The VM instance to be Destroyed. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -134,8 +134,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DestroyVM(JSVM_VM vm); /** * @brief This API open a new VM scope for the VM instance. * - * @param vm: The VM instance to open scope for. - * @param result: The new VM scope. + * @param vm The VM instance to open scope for. + * @param result The new VM scope. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -146,8 +146,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_OpenVMScope(JSVM_VM vm, /** * @brief This function close the VM scope for the VM instance. * - * @param vm: The VM instance to close scope for. - * @param scope: The VM scope to be closed. + * @param vm The VM instance to close scope for. + * @param scope The VM scope to be closed. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -158,10 +158,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CloseVMScope(JSVM_VM vm, /** * @brief This function create a new environment with optional properties for the context of the new environment. * - * @param vm: The VM instance that the env will be created in. - * @param propertyCount: The number of elements in the properties array. - * @param properties: The array of property descriptor. - * @param result: The new environment created. + * @param vm The VM instance that the env will be created in. + * @param propertyCount The number of elements in the properties array. + * @param properties The array of property descriptor. + * @param result The new environment created. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -174,9 +174,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateEnv(JSVM_VM vm, /** * @brief This function create a new environment from the start snapshot of the vm. * - * @param vm: The VM instance that the env will be created in. - * @param index: The index of the environment in the snapshot. - * @param result: The new environment created. + * @param vm The VM instance that the env will be created in. + * @param index The index of the environment in the snapshot. + * @param result The new environment created. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -188,7 +188,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateEnvFromSnapshot(JSVM_VM vm, /** * @brief This function destroys the environment. * - * @param env: The environment to be destroyed. + * @param env The environment to be destroyed. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -198,8 +198,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DestroyEnv(JSVM_Env env); /** * @brief This function open a new environment scope. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param result: The new environment scope. + * @param env The environment that the JSVM-API call is invoked under. + * @param result The new environment scope. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -210,8 +210,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_OpenEnvScope(JSVM_Env env, /** * @brief This function closes the environment scope of the environment. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param scope: The environment scope to be closed. + * @param env The environment that the JSVM-API call is invoked under. + * @param scope The environment scope to be closed. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -222,8 +222,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CloseEnvScope(JSVM_Env env, /** * @brief This function retrieves the VM instance of the given environment. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param result: The VM instance of the environment. + * @param env The environment that the JSVM-API call is invoked under. + * @param result The VM instance of the environment. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } in all cases.\n * @since 12 @@ -234,13 +234,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetVM(JSVM_Env env, /** * @brief This function compiles a string of JavaScript code and returns the compiled script. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param script: A JavaScript string containing the script yo be compiled. - * @param cachedData: Optional code cache data for the script. - * @param cacheDataLength: The length of cachedData array. - * @param eagerCompile: Whether to compile the script eagerly. - * @param cacheRejected: Whether the code cache rejected by compilation. - * @param result: The compiled script. + * @param env The environment that the JSVM-API call is invoked under. + * @param script A JavaScript string containing the script yo be compiled. + * @param cachedData Optional code cache data for the script. + * @param cacheDataLength The length of cachedData array. + * @param eagerCompile Whether to compile the script eagerly. + * @param cacheRejected Whether the code cache rejected by compilation. + * @param result The compiled script. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -257,14 +257,14 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CompileScript(JSVM_Env env, * @brief This function compiles a string of JavaScript code with the source code information * and returns the compiled script. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param script: A JavaScript string containing the script to be compiled. - * @param cachedData: Optional code cache data for the script. - * @param cacheDataLength: The length of cachedData array. - * @param eagerCompile: Whether to compile the script eagerly. - * @param cacheRejected: Whether the code cache rejected by compilation. - * @param origin: The information of source code. - * @param result: The compiled script. + * @param env The environment that the JSVM-API call is invoked under. + * @param script A JavaScript string containing the script to be compiled. + * @param cachedData Optional code cache data for the script. + * @param cacheDataLength The length of cachedData array. + * @param eagerCompile Whether to compile the script eagerly. + * @param cacheRejected Whether the code cache rejected by compilation. + * @param origin The information of source code. + * @param result The compiled script. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -281,10 +281,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CompileScriptWithOrigin(JSVM_Env env, /** * @brief This function creates code cache for the compiled script. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param script: A compiled script to create code cache for. - * @param data: The data of the code cache. - * @param length: The length of the code cache data. + * @param env The environment that the JSVM-API call is invoked under. + * @param script A compiled script to create code cache for. + * @param data The data of the code cache. + * @param length The length of the code cache data. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -302,9 +302,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateCodeCache(JSVM_Env env, * global object. Variable declarations made using let and const will be visible globally, but will not be added * to the global object.The value of this is global within the script. * - * @param env: The environment that the API is invoked under. - * @param script: A JavaScript string containing the script to execute. - * @param result: The value resulting from having executed the script. + * @param env The environment that the API is invoked under. + * @param script A JavaScript string containing the script to execute. + * @param result The value resulting from having executed the script. * @since 11 */ JSVM_EXTERN JSVM_Status OH_JSVM_RunScript(JSVM_Env env, @@ -315,11 +315,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_RunScript(JSVM_Env env, * @brief This API associates data with the currently running JSVM environment. data can later be retrieved * using OH_JSVM_GetInstanceData(). * - * @param env: The environment that the JSVM-API call is invoked under. - * @param data: The data item to make available to bindings of this instance. - * @param finalizeCb: The function to call when the environment is being torn down. The function receives + * @param env The environment that the JSVM-API call is invoked under. + * @param data The data item to make available to bindings of this instance. + * @param finalizeCb The function to call when the environment is being torn down. The function receives * data so that it might free it. JSVM_Finalize provides more details. - * @param finalizeHint: Optional hint to pass to the finalize callback during collection. + * @param finalizeHint Optional hint to pass to the finalize callback during collection. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -333,8 +333,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_SetInstanceData(JSVM_Env env, * @brief This API retrieves data that was previously associated with the currently running JSVM environment * via OH_JSVM_SetInstanceData(). If no data is set, the call will succeed and data will be set to NULL. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param data: The data item that was previously associated with the currently running JSVM environment by + * @param env The environment that the JSVM-API call is invoked under. + * @param data The data item that was previously associated with the currently running JSVM environment by * a call to OH_JSVM_SetInstanceData(). * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -347,8 +347,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetInstanceData(JSVM_Env env, * @brief This API retrieves a JSVM_ExtendedErrorInfo structure with information about the last error that * occurred. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param result: The JSVM_ExtendedErrorInfo structure with more information about the error. + * @param env The environment that the JSVM-API call is invoked under. + * @param result The JSVM_ExtendedErrorInfo structure with more information about the error. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -359,8 +359,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetLastErrorInfo(JSVM_Env env, /** * @brief This API throws the JavaScript value provided. * - * @param env: The environment that the API is invoked under. - * @param error: The JavaScript value to be thrown. + * @param env The environment that the API is invoked under. + * @param error The JavaScript value to be thrown. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -371,9 +371,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Throw(JSVM_Env env, /** * @brief This API throws a JavaScript Error with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional error code to be set on the error. - * @param msg: C string representing the text to be associated with the error. + * @param env The environment that the API is invoked under. + * @param code Optional error code to be set on the error. + * @param msg C string representing the text to be associated with the error. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -385,9 +385,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ThrowError(JSVM_Env env, /** * @brief This API throws a JavaScript TypeError with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional error code to be set on the error. - * @param msg: C string representing the text to be associated with the error. + * @param env The environment that the API is invoked under. + * @param code Optional error code to be set on the error. + * @param msg C string representing the text to be associated with the error. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -399,9 +399,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ThrowTypeError(JSVM_Env env, /** * @brief This API throws a JavaScript RangeError with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional error code to be set on the error. - * @param msg: C string representing the text to be associated with the error. + * @param env The environment that the API is invoked under. + * @param code Optional error code to be set on the error. + * @param msg C string representing the text to be associated with the error. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -413,9 +413,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ThrowRangeError(JSVM_Env env, /** * @brief This API throws a JavaScript SyntaxError with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional error code to be set on the error. - * @param msg: C string representing the text to be associated with the error. + * @param env The environment that the API is invoked under. + * @param code Optional error code to be set on the error. + * @param msg C string representing the text to be associated with the error. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -427,9 +427,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ThrowSyntaxError(JSVM_Env env, /** * @brief This API queries a JSVM_Value to check if it represents an error object. * - * @param env: The environment that the API is invoked under. - * @param value: The JSVM_Value to be checked. - * @param result: Boolean value that is set to true if JSVM_Value represents an error, + * @param env The environment that the API is invoked under. + * @param value The JSVM_Value to be checked. + * @param result Boolean value that is set to true if JSVM_Value represents an error, * false otherwise. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -442,10 +442,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsError(JSVM_Env env, /** * @brief This API returns a JavaScript Error with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional JSVM_Value with the string for the error code to be associated with the error. - * @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Error. - * @param result: JSVM_Value representing the error created. + * @param env The environment that the API is invoked under. + * @param code Optional JSVM_Value with the string for the error code to be associated with the error. + * @param msg JSVM_Value that references a JavaScript string to be used as the message for the Error. + * @param result JSVM_Value representing the error created. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -458,10 +458,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateError(JSVM_Env env, /** * @brief This API returns a JavaScript TypeError with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional JSVM_Value with the string for the error code to be associated with the error. - * @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Error. - * @param result: JSVM_Value representing the error created. + * @param env The environment that the API is invoked under. + * @param code Optional JSVM_Value with the string for the error code to be associated with the error. + * @param msg JSVM_Value that references a JavaScript string to be used as the message for the Error. + * @param result JSVM_Value representing the error created. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -474,10 +474,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateTypeError(JSVM_Env env, /** * @brief This API returns a JavaScript RangeError with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional JSVM_Value with the string for the error code to be associated with the error. - * @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Error. - * @param result: JSVM_Value representing the error created. + * @param env The environment that the API is invoked under. + * @param code Optional JSVM_Value with the string for the error code to be associated with the error. + * @param msg JSVM_Value that references a JavaScript string to be used as the message for the Error. + * @param result JSVM_Value representing the error created. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -490,10 +490,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateRangeError(JSVM_Env env, /** * @brief This API returns a JavaScript SyntaxError with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional JSVM_Value with the string for the error code to be associated with the error. - * @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Error. - * @param result: JSVM_Value representing the error created. + * @param env The environment that the API is invoked under. + * @param code Optional JSVM_Value with the string for the error code to be associated with the error. + * @param msg JSVM_Value that references a JavaScript string to be used as the message for the Error. + * @param result JSVM_Value representing the error created. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -506,8 +506,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateSyntaxError(JSVM_Env env, /** * @brief This API returns a JavaScript exception if one is pending, NULL otherwise. * - * @param env: The environment that the API is invoked under. - * @param result: The exception if one is pending, NULL otherwise. + * @param env The environment that the API is invoked under. + * @param result The exception if one is pending, NULL otherwise. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -518,8 +518,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetAndClearLastException(JSVM_Env env, /** * @brief This API returns true if an exception is pending, false otherwise. * - * @param env: The environment that the API is invoked under. - * @param result: Boolean value that is set to true if an exception is pending. + * @param env The environment that the API is invoked under. + * @param result Boolean value that is set to true if an exception is pending. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -530,8 +530,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsExceptionPending(JSVM_Env env, /** * @brief This API opens a new scope. * - * @param env: The environment that the API is invoked under. - * @param result: JSVM_Value representing the new scope. + * @param env The environment that the API is invoked under. + * @param result JSVM_Value representing the new scope. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -543,8 +543,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_OpenHandleScope(JSVM_Env env, * @brief This API closes the scope passed in. Scopes must be closed in the reverse * order from which they were created. * - * @param env: The environment that the API is invoked under. - * @param scope: JSVM_Value representing the scope to be closed. + * @param env The environment that the API is invoked under. + * @param scope JSVM_Value representing the scope to be closed. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -555,8 +555,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CloseHandleScope(JSVM_Env env, /** * @brief This API opens a new scope from which one object can be promoted to the outer scope. * - * @param env: The environment that the API is invoked under. - * @param result: JSVM_Value representing the new scope. + * @param env The environment that the API is invoked under. + * @param result JSVM_Value representing the new scope. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -568,8 +568,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_OpenEscapableHandleScope(JSVM_Env env, * @brief This API closes the scope passed in. Scopes must be closed in the reverse order * from which they were created. * - * @param env: The environment that the API is invoked under. - * @param scope: JSVM_Value representing the scope to be closed. + * @param env The environment that the API is invoked under. + * @param scope JSVM_Value representing the scope to be closed. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -582,10 +582,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CloseEscapableHandleScope(JSVM_Env env, * of the outer scope. It can only be called once per scope. If it is called more than once an error * will be returned. * - * @param env: The environment that the API is invoked under. - * @param scope: JSVM_Value representing the current scope. - * @param escapee: JSVM_Value representing the JavaScript Object to be escaped. - * @param result: JSVM_Value representing the handle to the escaped Object in the outer scope. + * @param env The environment that the API is invoked under. + * @param scope JSVM_Value representing the current scope. + * @param escapee JSVM_Value representing the JavaScript Object to be escaped. + * @param result JSVM_Value representing the handle to the escaped Object in the outer scope. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -598,10 +598,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_EscapeHandle(JSVM_Env env, /** * @brief This API creates a new reference with the specified reference count to the value passed in. * - * @param env: The environment that the API is invoked under. - * @param value: The JSVM_Value for which a reference is being created. - * @param initialRefcount: Initial reference count for the new reference. - * @param result: JSVM_Ref pointing to the new reference. + * @param env The environment that the API is invoked under. + * @param value The JSVM_Value for which a reference is being created. + * @param initialRefcount Initial reference count for the new reference. + * @param result JSVM_Ref pointing to the new reference. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -614,8 +614,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateReference(JSVM_Env env, /** * @brief his API deletes the reference passed in. * - * @param env: The environment that the API is invoked under. - * @param ref: JSVM_Ref to be deleted. + * @param env The environment that the API is invoked under. + * @param ref JSVM_Ref to be deleted. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -627,9 +627,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DeleteReference(JSVM_Env env, * @brief his API increments the reference count for the reference passed in and * returns the resulting reference count. * - * @param env: The environment that the API is invoked under. - * @param ref: JSVM_Ref for which the reference count will be incremented. - * @param result: The new reference count. + * @param env The environment that the API is invoked under. + * @param ref JSVM_Ref for which the reference count will be incremented. + * @param result The new reference count. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -642,9 +642,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ReferenceRef(JSVM_Env env, * @brief This API decrements the reference count for the reference passed in and * returns the resulting reference count. * - * @param env: The environment that the API is invoked under. - * @param ref: JSVM_Ref for which the reference count will be decremented. - * @param result: The new reference count. + * @param env The environment that the API is invoked under. + * @param ref JSVM_Ref for which the reference count will be decremented. + * @param result The new reference count. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -657,9 +657,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ReferenceUnref(JSVM_Env env, * @brief If still valid, this API returns the JSVM_Value representing the * JavaScript value associated with the JSVM_Ref. Otherwise, result will be NULL. * - * @param env: The environment that the API is invoked under. - * @param ref: The JSVM_Ref for which the corresponding value is being requested. - * @param result: The JSVM_Value referenced by the JSVM_Ref. + * @param env The environment that the API is invoked under. + * @param ref The JSVM_Ref for which the corresponding value is being requested. + * @param result The JSVM_Value referenced by the JSVM_Ref. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -671,8 +671,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetReferenceValue(JSVM_Env env, /** * @brief This API returns a JSVM-API value corresponding to a JavaScript Array type. * - * @param env: The environment that the API is invoked under. - * @param result: A JSVM_Value representing a JavaScript Array. + * @param env The environment that the API is invoked under. + * @param result A JSVM_Value representing a JavaScript Array. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -686,9 +686,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateArray(JSVM_Env env, * is set to the passed-in length parameter. However, the underlying buffer is not guaranteed to be pre-allocated * by the VM when the array is created. That behavior is left to the underlying VM implementation. * - * @param env: The environment that the API is invoked under. - * @param length: The initial length of the Array. - * @param result: A JSVM_Value representing a JavaScript Array. + * @param env The environment that the API is invoked under. + * @param length The initial length of the Array. + * @param result A JSVM_Value representing a JavaScript Array. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -705,10 +705,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateArrayWithLength(JSVM_Env env, * directly manipulate the buffer. This buffer can only be written to directly from native code. To write to this * buffer from JavaScript, a typed array or DataView object would need to be created. * - * @param env: The environment that the API is invoked under. - * @param byteLength: The length in bytes of the array buffer to create. - * @param data: Pointer to the underlying byte buffer of the ArrayBuffer.data can optionally be ignored by passing NULL. - * @param result: A JSVM_Value representing a JavaScript Array. + * @param env The environment that the API is invoked under. + * @param byteLength The length in bytes of the array buffer to create. + * @param data Pointer to the underlying byte buffer of the ArrayBuffer.data can optionally be ignored by passing NULL. + * @param result A JSVM_Value representing a JavaScript Array. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -721,9 +721,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateArraybuffer(JSVM_Env env, /** * @brief This API allocate the memory of array buffer backing store. * - * @param byteLength: size of backing store memory. - * @param initialized: initialization status of the backing store memory. - * @param data: pointer that recieve the backing store memory pointer. + * @param byteLength size of backing store memory. + * @param initialized initialization status of the backing store memory. + * @param data pointer that recieve the backing store memory pointer. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if allocation succeed.\n * Returns {@link JSVM_INVALID_ARG } if data is null pointer.\n @@ -737,7 +737,7 @@ JSVM_Status JSVM_CDECL OH_JSVM_AllocateArrayBufferBackingStoreData(size_t byteLe /** * @brief This API release the memory of an array buffer backing store. * - * @param data: pointer to the backing store memory. + * @param data pointer to the backing store memory. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if run succeed.\n * Returns {@link JSVM_INVALID_ARG } if data is null pointer.\n @@ -748,12 +748,12 @@ JSVM_Status JSVM_CDECL OH_JSVM_FreeArrayBufferBackingStoreData(void *data); /** * @brief This API create an array buffer using the backing store data. * - * @param env: The environment that the API is invoked under. - * @param data: pointer to the backing store memory. - * @param backingStoreSize: size of backing store memory. - * @param offset: start position of the array buffer in the backing store memory. - * @param arrayBufferSize: size of the array buffer. - * @param result: pointer that recieve the array buffer. + * @param env The environment that the API is invoked under. + * @param data pointer to the backing store memory. + * @param backingStoreSize size of backing store memory. + * @param offset start position of the array buffer in the backing store memory. + * @param arrayBufferSize size of the array buffer. + * @param result pointer that recieve the array buffer. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if creation succeed.\n * Returns {@link JSVM_INVALID_ARG } if any of the following condition reached:\n @@ -773,9 +773,9 @@ JSVM_Status JSVM_CDECL OH_JSVM_CreateArrayBufferFromBackingStoreData(JSVM_Env en * @brief This API does not observe leap seconds; they are ignored, as ECMAScript aligns with POSIX time specification. * This API allocates a JavaScript Date object. * - * @param env: The environment that the API is invoked under. - * @param time: ECMAScript time value in milliseconds since 01 January, 1970 UTC. - * @param result: A JSVM_Value representing a JavaScript Date. + * @param env The environment that the API is invoked under. + * @param time ECMAScript time value in milliseconds since 01 January, 1970 UTC. + * @param result A JSVM_Value representing a JavaScript Date. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -789,14 +789,14 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateDate(JSVM_Env env, * data through JavaScript code, so it can be retrieved later by native code using OH_JSVM_GetValueExternal. * The API adds a JSVM_Finalize callback which will be called when the JavaScript object just created has been garbage * collected.The created value is not an object, and therefore does not support additional properties. It is considered - * a distinct value type: calling OH_JSVM_Typeof() with an external value yields JSVM_EXTERNAL. + * a distinct value type calling OH_JSVM_Typeof() with an external value yields JSVM_EXTERNAL. * - * @param env: The environment that the API is invoked under. - * @param data: Raw pointer to the external data. - * @param finalizeCb: Optional callback to call when the external value is being collected. JSVM_Finalize provides + * @param env The environment that the API is invoked under. + * @param data Raw pointer to the external data. + * @param finalizeCb Optional callback to call when the external value is being collected. JSVM_Finalize provides * more details. - * @param finalizeHint: Optional hint to pass to the finalize callback during collection. - * @param result: A JSVM_Value representing an external value. + * @param finalizeHint Optional hint to pass to the finalize callback during collection. + * @param result A JSVM_Value representing an external value. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -810,8 +810,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateExternal(JSVM_Env env, /** * @brief This API allocates a default JavaScript Object. It is the equivalent of doing new Object() in JavaScript. * - * @param env: The environment that the API is invoked under. - * @param result: A JSVM_Value representing a JavaScript Object. + * @param env The environment that the API is invoked under. + * @param result A JSVM_Value representing a JavaScript Object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -822,10 +822,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateObject(JSVM_Env env, /** * @brief This API creates a JavaScript symbol value from a UTF8-encoded C string. * - * @param env: The environment that the API is invoked under. - * @param description: Optional JSVM_Value which refers to a JavaScript string to be set as the description + * @param env The environment that the API is invoked under. + * @param description Optional JSVM_Value which refers to a JavaScript string to be set as the description * for the symbol. - * @param result: A JSVM_Value representing a JavaScript symbol. + * @param result A JSVM_Value representing a JavaScript symbol. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -838,10 +838,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateSymbol(JSVM_Env env, * @brief This API searches in the global registry for an existing symbol with the given description. * If the symbol already exists it will be returned, otherwise a new symbol will be created in the registry. * - * @param env: The environment that the API is invoked under. - * @param utf8description: UTF-8 C string representing the text to be used as the description for the symbol. - * @param length: The length of the description string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated. - * @param result: A JSVM_Value representing a JavaScript symbol. + * @param env The environment that the API is invoked under. + * @param utf8description UTF-8 C string representing the text to be used as the description for the symbol. + * @param length The length of the description string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated. + * @param result A JSVM_Value representing a JavaScript symbol. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -857,12 +857,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_SymbolFor(JSVM_Env env, * same underlying binary scalar datatype.It's required that (length * size_of_element) + byte_offset should * be <= the size in bytes of the array passed in. If not, a RangeError exception is raised. * - * @param env: The environment that the API is invoked under. - * @param type: Scalar datatype of the elements within the TypedArray. - * @param length: Number of elements in the TypedArray. - * @param arraybuffer: ArrayBuffer underlying the typed array. - * @param byteOffset: The byte offset within the ArrayBuffer from which to start projecting the TypedArray. - * @param result: A JSVM_Value representing a JavaScript TypedArray + * @param env The environment that the API is invoked under. + * @param type Scalar datatype of the elements within the TypedArray. + * @param length Number of elements in the TypedArray. + * @param arraybuffer ArrayBuffer underlying the typed array. + * @param byteOffset The byte offset within the ArrayBuffer from which to start projecting the TypedArray. + * @param result A JSVM_Value representing a JavaScript TypedArray * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -881,11 +881,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateTypedarray(JSVM_Env env, * less than or equal to the size in bytes of the array passed in. If not, a RangeError exception * is raised. * - * @param env: The environment that the API is invoked under. - * @param length: Number of elements in the DataView. - * @param arraybuffer: ArrayBuffer underlying the DataView. - * @param byteOffset: The byte offset within the ArrayBuffer from which to start projecting the DataView. - * @param result:A JSVM_Value representing a JavaScript DataView. + * @param env The environment that the API is invoked under. + * @param length Number of elements in the DataView. + * @param arraybuffer ArrayBuffer underlying the DataView. + * @param byteOffset The byte offset within the ArrayBuffer from which to start projecting the DataView. + * @param result A JSVM_Value representing a JavaScript DataView. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -899,9 +899,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateDataview(JSVM_Env env, /** * @brief This API is used to convert from the C int32_t type to the JavaScript number type. * - * @param env: The environment that the API is invoked under. - * @param value: Integer value to be represented in JavaScript. - * @param result: A JSVM_Value representing a JavaScript number. + * @param env The environment that the API is invoked under. + * @param value Integer value to be represented in JavaScript. + * @param result A JSVM_Value representing a JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -913,9 +913,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateInt32(JSVM_Env env, /** * @brief This API is used to convert from the C uint32_t type to the JavaScript number type. * - * @param env: The environment that the API is invoked under. - * @param value: Unsigned integer value to be represented in JavaScript. - * @param result: A JSVM_Value representing a JavaScript number. + * @param env The environment that the API is invoked under. + * @param value Unsigned integer value to be represented in JavaScript. + * @param result A JSVM_Value representing a JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -927,9 +927,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateUint32(JSVM_Env env, /** * @brief This API is used to convert from the C int64_t type to the JavaScript number type. * - * @param env: The environment that the API is invoked under. - * @param value: Integer value to be represented in JavaScript. - * @param result: A JSVM_Value representing a JavaScript number. + * @param env The environment that the API is invoked under. + * @param value Integer value to be represented in JavaScript. + * @param result A JSVM_Value representing a JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -941,9 +941,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateInt64(JSVM_Env env, /** * @brief This API is used to convert from the C double type to the JavaScript number type. * - * @param env: The environment that the API is invoked under. - * @param value: Double-precision value to be represented in JavaScript. - * @param result: A JSVM_Value representing a JavaScript number. + * @param env The environment that the API is invoked under. + * @param value Double-precision value to be represented in JavaScript. + * @param result A JSVM_Value representing a JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -955,9 +955,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateDouble(JSVM_Env env, /** * @brief This API converts the C int64_t type to the JavaScript BigInt type. * - * @param env: The environment that the API is invoked under. - * @param value: Integer value to be represented in JavaScript. - * @param result: A JSVM_Value representing a JavaScript BigInt. + * @param env The environment that the API is invoked under. + * @param value Integer value to be represented in JavaScript. + * @param result A JSVM_Value representing a JavaScript BigInt. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -969,9 +969,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateBigintInt64(JSVM_Env env, /** * @brief This API converts the C uint64_t type to the JavaScript BigInt type. * - * @param env: The environment that the API is invoked under. - * @param value: Unsigned integer value to be represented in JavaScript. - * @param result: A JSVM_Value representing a JavaScript BigInt. + * @param env The environment that the API is invoked under. + * @param value Unsigned integer value to be represented in JavaScript. + * @param result A JSVM_Value representing a JavaScript BigInt. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -982,13 +982,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateBigintUint64(JSVM_Env env, /** * @brief This API converts an array of unsigned 64-bit words into a single BigInt value. - * The resulting BigInt is calculated as: (–1)sign_bit (words[0] × (264)0 + words[1] × (264)1 + …) + * The resulting BigInt is calculated as (–1)sign_bit (words[0] × (264)0 + words[1] × (264)1 + …) * - * @param env: The environment that the API is invoked under. - * @param signBit: Determines if the resulting BigInt will be positive or negative. - * @param wordCount: The length of the words array. - * @param words: An array of uint64_t little-endian 64-bit words. - * @param result: A JSVM_Value representing a JavaScript BigInt. + * @param env The environment that the API is invoked under. + * @param signBit Determines if the resulting BigInt will be positive or negative. + * @param wordCount The length of the words array. + * @param words An array of uint64_t little-endian 64-bit words. + * @param result A JSVM_Value representing a JavaScript BigInt. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1003,10 +1003,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateBigintWords(JSVM_Env env, * @brief This API creates a JavaScript string value from an ISO-8859-1-encoded C * string. The native string is copied. * - * @param env: The environment that the API is invoked under. - * @param str: Character buffer representing an ISO-8859-1-encoded string. - * @param length: The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated. - * @param result: A JSVM_Value representing a JavaScript string. + * @param env The environment that the API is invoked under. + * @param str Character buffer representing an ISO-8859-1-encoded string. + * @param length The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated. + * @param result A JSVM_Value representing a JavaScript string. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1020,11 +1020,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateStringLatin1(JSVM_Env env, * @brief This API creates a JavaScript string value from a UTF16-LE-encoded C * string. The native string is copied. * - * @param env: The environment that the API is invoked under. - * @param str: Character buffer representing a UTF16-LE-encoded string. - * @param length: The length of the string in two-byte code units, or JSVM_AUTO_LENGTH + * @param env The environment that the API is invoked under. + * @param str Character buffer representing a UTF16-LE-encoded string. + * @param length The length of the string in two-byte code units, or JSVM_AUTO_LENGTH * if it is null-terminated. - * @param result: A JSVM_Value representing a JavaScript string. + * @param result A JSVM_Value representing a JavaScript string. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1038,10 +1038,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateStringUtf16(JSVM_Env env, * @brief This API creates a JavaScript string value from a UTF8-encoded C * string. The native string is copied. * - * @param env: The environment that the API is invoked under. - * @param str: Character buffer representing a UTF8-encoded string. - * @param length: The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated. - * @param result: A JSVM_Value representing a JavaScript string. + * @param env The environment that the API is invoked under. + * @param str Character buffer representing a UTF8-encoded string. + * @param length The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated. + * @param result A JSVM_Value representing a JavaScript string. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1054,9 +1054,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateStringUtf8(JSVM_Env env, /** * @brief This API returns the length of an array. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing the JavaScript Array whose length is being queried. - * @param result: uint32 representing length of the array. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing the JavaScript Array whose length is being queried. + * @param result uint32 representing length of the array. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1068,11 +1068,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetArrayLength(JSVM_Env env, /** * @brief This API is used to retrieve the underlying data buffer of an ArrayBuffer and its length. * - * @param env: The environment that the API is invoked under. - * @param arraybuffer: JSVM_Value representing the ArrayBuffer being queried. - * @param data: The underlying data buffer of the ArrayBuffer. If byte_length is 0, this may be NULL + * @param env The environment that the API is invoked under. + * @param arraybuffer JSVM_Value representing the ArrayBuffer being queried. + * @param data The underlying data buffer of the ArrayBuffer. If byte_length is 0, this may be NULL * or any other pointer value. - * @param byteLength: Length in bytes of the underlying data buffer. + * @param byteLength Length in bytes of the underlying data buffer. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1085,10 +1085,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetArraybufferInfo(JSVM_Env env, /** * @brief This API returns the length of an array. * - * @param env: The environment that the API is invoked under. - * @param object: JSVM_Value representing JavaScript Object whose prototype to return. This returns + * @param env The environment that the API is invoked under. + * @param object JSVM_Value representing JavaScript Object whose prototype to return. This returns * the equivalent of Object.getPrototypeOf (which is not the same as the function's prototype property). - * @param result: JSVM_Value representing prototype of the given object. + * @param result JSVM_Value representing prototype of the given object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1100,15 +1100,15 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetPrototype(JSVM_Env env, /** * @brief This API returns various properties of a typed array. * - * @param env: The environment that the API is invoked under. - * @param typedarray: JSVM_Value representing the TypedArray whose properties to query. - * @param type: Scalar datatype of the elements within the TypedArray. - * @param length: The number of elements in the TypedArray. - * @param data: The data buffer underlying the TypedArray adjusted by the byte_offset value so that it + * @param env The environment that the API is invoked under. + * @param typedarray JSVM_Value representing the TypedArray whose properties to query. + * @param type Scalar datatype of the elements within the TypedArray. + * @param length The number of elements in the TypedArray. + * @param data The data buffer underlying the TypedArray adjusted by the byte_offset value so that it * points to the first element in the TypedArray. If the length of the array is 0, this may be NULL or * any other pointer value. - * @param arraybuffer: The ArrayBuffer underlying the TypedArray. - * @param byteOffset: The byte offset within the underlying native array at which the first element of + * @param arraybuffer The ArrayBuffer underlying the TypedArray. + * @param byteOffset The byte offset within the underlying native array at which the first element of * the arrays is located. The value for the data parameter has already been adjusted so that data points * to the first element in the array. Therefore, the first byte of the native array would be at data - byte_offset. * @return Returns JSVM funtions result code. @@ -1127,13 +1127,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetTypedarrayInfo(JSVM_Env env, * @brief Any of the out parameters may be NULL if that property is unneeded. * This API returns various properties of a DataView. * - * @param env: The environment that the API is invoked under. - * @param dataview: JSVM_Value representing the DataView whose properties to query. - * @param bytelength: Number of bytes in the DataView. - * @param data: The data buffer underlying the DataView. + * @param env The environment that the API is invoked under. + * @param dataview JSVM_Value representing the DataView whose properties to query. + * @param bytelength Number of bytes in the DataView. + * @param data The data buffer underlying the DataView. * If byte_length is 0, this may be NULL or any other pointer value. - * @param arraybuffer: ArrayBuffer underlying the DataView. - * @param byteOffset: The byte offset within the data buffer from which to start projecting the DataView. + * @param arraybuffer ArrayBuffer underlying the DataView. + * @param byteOffset The byte offset within the data buffer from which to start projecting the DataView. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1150,9 +1150,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetDataviewInfo(JSVM_Env env, * passed in it returns JSVM_date_expected.This API returns the C double * primitive of time value for the given JavaScript Date. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing a JavaScript Date. - * @param result: Time value as a double represented as milliseconds + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing a JavaScript Date. + * @param result Time value as a double represented as milliseconds * since midnight at the beginning of 01 January, 1970 UTC. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -1166,9 +1166,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetDateValue(JSVM_Env env, /** * @brief This API returns the C boolean primitive equivalent of the given JavaScript Boolean. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript Boolean. - * @param result: C boolean primitive equivalent of the given JavaScript Boolean. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript Boolean. + * @param result C boolean primitive equivalent of the given JavaScript Boolean. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_BOOLEAN_EXPECTED }If a non-boolean JSVM_Value is passed in it.\n @@ -1181,9 +1181,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueBool(JSVM_Env env, /** * @brief This API returns the C double primitive equivalent of the given JavaScript number. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript number. - * @param result: C double primitive equivalent of the given JavaScript number. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript number. + * @param result C double primitive equivalent of the given JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_NUMBER_EXPECTED } If a non-number JSVM_Value is passed in.\n @@ -1197,10 +1197,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueDouble(JSVM_Env env, * @brief This API returns the C int64_t primitive equivalent of the given JavaScript BigInt. * If needed it will truncate the value, setting lossless to false. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript BigInt. - * @param result: C int64_t primitive equivalent of the given JavaScript BigInt. - * @param lossless: Indicates whether the BigInt value was converted losslessly. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript BigInt. + * @param result C int64_t primitive equivalent of the given JavaScript BigInt. + * @param lossless Indicates whether the BigInt value was converted losslessly. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_BIGINT_EXPECTED } If a non-BigInt is passed in it.\n @@ -1215,10 +1215,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueBigintInt64(JSVM_Env env, * @brief This API returns the C uint64_t primitive equivalent of the given JavaScript BigInt. * If needed it will truncate the value, setting lossless to false. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript BigInt. - * @param result: C uint64_t primitive equivalent of the given JavaScript BigInt. - * @param lossless: Indicates whether the BigInt value was converted losslessly. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript BigInt. + * @param result C uint64_t primitive equivalent of the given JavaScript BigInt. + * @param lossless Indicates whether the BigInt value was converted losslessly. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_BIGINT_EXPECTED } If a non-BigInt is passed in it.\n @@ -1233,12 +1233,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueBigintUint64(JSVM_Env env, * @brief This API converts a single BigInt value into a sign bit, 64-bit little-endian array, and the number * of elements in the array. signBit and words may be both set to NULL, in order to get only wordCount. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript BigInt. - * @param signBit: Integer representing if the JavaScript BigInt is positive or negative. - * @param wordCount: Must be initialized to the length of the words array. Upon return, it will be set to + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript BigInt. + * @param signBit Integer representing if the JavaScript BigInt is positive or negative. + * @param wordCount Must be initialized to the length of the words array. Upon return, it will be set to * the actual number of words that would be needed to store this BigInt. - * @param words: Pointer to a pre-allocated 64-bit word array. + * @param words Pointer to a pre-allocated 64-bit word array. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1252,9 +1252,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueBigintWords(JSVM_Env env, /** * @brief This API retrieves the external data pointer that was previously passed to OH_JSVM_CreateExternal(). * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript external value. - * @param result: Pointer to the data wrapped by the JavaScript external value. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript external value. + * @param result Pointer to the data wrapped by the JavaScript external value. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_INVALID_ARG } If a non-external JSVM_Value is passed in it.\n @@ -1267,9 +1267,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueExternal(JSVM_Env env, /** * @brief This API returns the C int32 primitive equivalent of the given JavaScript number. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript number. - * @param result: C int32 primitive equivalent of the given JavaScript number. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript number. + * @param result C int32 primitive equivalent of the given JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_NUMBER_EXPECTED } If a non-number JSVM_Value is passed in.\n @@ -1282,9 +1282,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueInt32(JSVM_Env env, /** * @brief This API returns the C int64 primitive equivalent of the given JavaScript number. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript number. - * @param result: C int64 primitive equivalent of the given JavaScript number. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript number. + * @param result C int64 primitive equivalent of the given JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_NUMBER_EXPECTED } If a non-number JSVM_Value is passed in.\n @@ -1297,13 +1297,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueInt64(JSVM_Env env, /** * @brief This API returns the ISO-8859-1-encoded string corresponding the value passed in. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript string. - * @param buf: Buffer to write the ISO-8859-1-encoded string into. If NULL is passed in, the + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript string. + * @param buf Buffer to write the ISO-8859-1-encoded string into. If NULL is passed in, the * length of the string in bytes and excluding the null terminator is returned in result. - * @param bufsize: Size of the destination buffer. When this value is insufficient, the returned string + * @param bufsize Size of the destination buffer. When this value is insufficient, the returned string * is truncated and null-terminated. - * @param result: Number of bytes copied into the buffer, excluding the null terminator. + * @param result Number of bytes copied into the buffer, excluding the null terminator. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_NUMBER_EXPECTED } If a non-number JSVM_Value is passed in.\n @@ -1318,13 +1318,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueStringLatin1(JSVM_Env env, /** * @brief This API returns the UTF8-encoded string corresponding the value passed in. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript string. - * @param buf: Buffer to write the UTF8-encoded string into. If NULL is passed in, the length + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript string. + * @param buf Buffer to write the UTF8-encoded string into. If NULL is passed in, the length * of the string in bytes and excluding the null terminator is returned in result. - * @param bufsize: Size of the destination buffer. When this value is insufficient, the returned + * @param bufsize Size of the destination buffer. When this value is insufficient, the returned * string is truncated and null-terminated. - * @param result: Number of bytes copied into the buffer, excluding the null terminator. + * @param result Number of bytes copied into the buffer, excluding the null terminator. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_NUMBER_EXPECTED } If a non-number JSVM_Value is passed in.\n @@ -1339,13 +1339,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueStringUtf8(JSVM_Env env, /** * @brief This API returns the UTF16-encoded string corresponding the value passed in. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript string. - * @param buf: Buffer to write the UTF16-LE-encoded string into. If NULL is passed in, + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript string. + * @param buf Buffer to write the UTF16-LE-encoded string into. If NULL is passed in, * the length of the string in 2-byte code units and excluding the null terminator is returned. - * @param bufsize: Size of the destination buffer. When this value is insufficient, + * @param bufsize Size of the destination buffer. When this value is insufficient, * the returned string is truncated and null-terminated. - * @param result: Number of 2-byte code units copied into the buffer, excluding the null terminator. + * @param result Number of 2-byte code units copied into the buffer, excluding the null terminator. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_NUMBER_EXPECTED } If a non-number JSVM_Value is passed in.\n @@ -1360,9 +1360,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueStringUtf16(JSVM_Env env, /** * @brief This API returns the C primitive equivalent of the given JSVM_Value as a uint32_t. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript number. - * @param result: C primitive equivalent of the given JSVM_Value as a uint32_t. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript number. + * @param result C primitive equivalent of the given JSVM_Value as a uint32_t. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_NUMBER_EXPECTED } If a non-number JSVM_Value is passed in it.\n @@ -1375,9 +1375,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueUint32(JSVM_Env env, /** * @brief This API is used to return the JavaScript singleton object that is used to represent the given boolean value. * - * @param env: The environment that the API is invoked under. - * @param value: The value of the boolean to retrieve. - * @param result: JSVM_Value representing JavaScript Boolean singleton to retrieve. + * @param env The environment that the API is invoked under. + * @param value The value of the boolean to retrieve. + * @param result JSVM_Value representing JavaScript Boolean singleton to retrieve. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1389,8 +1389,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetBoolean(JSVM_Env env, /** * @brief This API returns the global object. * - * @param env: The environment that the API is invoked under. - * @param result: JSVM_Value representing JavaScript global object. + * @param env The environment that the API is invoked under. + * @param result JSVM_Value representing JavaScript global object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1401,8 +1401,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetGlobal(JSVM_Env env, /** * @brief This API returns the null object. * - * @param env: The environment that the API is invoked under. - * @param result: JSVM_Value representing JavaScript null object. + * @param env The environment that the API is invoked under. + * @param result JSVM_Value representing JavaScript null object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1413,8 +1413,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetNull(JSVM_Env env, /** * @brief This API returns the Undefined object. * - * @param env: The environment that the API is invoked under. - * @param result: JSVM_Value representing JavaScript Undefined value. + * @param env The environment that the API is invoked under. + * @param result JSVM_Value representing JavaScript Undefined value. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1425,9 +1425,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetUndefined(JSVM_Env env, /** * @brief This API implements the abstract operation ToBoolean() * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to coerce. - * @param result: JSVM_Value representing the coerced JavaScript Boolean. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to coerce. + * @param result JSVM_Value representing the coerced JavaScript Boolean. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1440,9 +1440,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CoerceToBool(JSVM_Env env, * @brief This API implements the abstract operation ToNumber() as defined. This * function potentially runs JS code if the passed-in value is an object. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to coerce. - * @param result: JSVM_Value representing the coerced JavaScript number. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to coerce. + * @param result JSVM_Value representing the coerced JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1454,9 +1454,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CoerceToNumber(JSVM_Env env, /** * @brief This API implements the abstract operation ToObject(). * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to coerce. - * @param result: JSVM_Value representing the coerced JavaScript Object. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to coerce. + * @param result JSVM_Value representing the coerced JavaScript Object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1469,9 +1469,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CoerceToObject(JSVM_Env env, * @brief This API implements the abstract operation ToString().This * function potentially runs JS code if the passed-in value is an object. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to coerce. - * @param result: JSVM_Value representing the coerced JavaScript string. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to coerce. + * @param result JSVM_Value representing the coerced JavaScript string. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1487,9 +1487,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CoerceToString(JSVM_Env env, * ECMAScript typeof would detect object.If value has a type that is invalid, * an error is returned. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value whose type to query. - * @param result: The type of the JavaScript value. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value whose type to query. + * @param result The type of the JavaScript value. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1501,11 +1501,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Typeof(JSVM_Env env, /** * @brief This API represents invoking the instanceof Operator on the object. * - * @param env: The environment that the API is invoked under. - * @param object: The JavaScript value to check. - * @param constructor: The JavaScript function object of the constructor function + * @param env The environment that the API is invoked under. + * @param object The JavaScript value to check. + * @param constructor The JavaScript function object of the constructor function * to check against. - * @param result: Boolean that is set to true if object instanceof constructor is true. + * @param result Boolean that is set to true if object instanceof constructor is true. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1518,9 +1518,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Instanceof(JSVM_Env env, /** * @brief This API represents invoking the IsArray operation on the object * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param result: Whether the given object is an array. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given object is an array. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1532,9 +1532,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsArray(JSVM_Env env, /** * @brief This API checks if the Object passed in is an array buffer. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param result: Whether the given object is an ArrayBuffer. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given object is an ArrayBuffer. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1560,9 +1560,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsDate(JSVM_Env env, /** * @brief This API checks if the Object passed in is a typed array. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param result: Whether the given JSVM_Value represents a TypedArray. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given JSVM_Value represents a TypedArray. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1574,9 +1574,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsTypedarray(JSVM_Env env, /** * @brief This API checks if the Object passed in is a DataView. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param result: Whether the given JSVM_Value represents a DataView. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given JSVM_Value represents a DataView. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1588,10 +1588,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsDataview(JSVM_Env env, /** * @brief This API represents the invocation of the Strict Equality algorithm. * - * @param env: The environment that the API is invoked under. - * @param lhs: The JavaScript value to check. - * @param rhs: The JavaScript value to check against. - * @param result: Whether the two JSVM_Value objects are equal. + * @param env The environment that the API is invoked under. + * @param lhs The JavaScript value to check. + * @param rhs The JavaScript value to check against. + * @param result Whether the two JSVM_Value objects are equal. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1605,10 +1605,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_StrictEquals(JSVM_Env env, * @brief This API represents the invocation of the Relaxed Equality algorithm. * Returns true as long as the values are equal, regardless of type. * - * @param env: The environment that the API is invoked under. - * @param lhs: The JavaScript value to check. - * @param rhs: The JavaScript value to check against. - * @param result: Whether the two JSVM_Value objects are relaxed equal. + * @param env The environment that the API is invoked under. + * @param lhs The JavaScript value to check. + * @param rhs The JavaScript value to check against. + * @param result Whether the two JSVM_Value objects are relaxed equal. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -1621,8 +1621,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Equals(JSVM_Env env, /** * @brief This API represents the invocation of the ArrayBuffer detach operation. * - * @param env: The environment that the API is invoked under. - * @param arraybuffer: The JavaScript ArrayBuffer to be detached. + * @param env The environment that the API is invoked under. + * @param arraybuffer The JavaScript ArrayBuffer to be detached. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_DETACHABLE_ARRAYBUFFER_EXPECTED } If a non-detachable ArrayBuffer is passed in it.\n @@ -1634,9 +1634,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DetachArraybuffer(JSVM_Env env, /** * @brief This API represents the invocation of the ArrayBuffer IsDetachedBuffer operation. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript ArrayBuffer to be checked. - * @param result: Whether the arraybuffer is detached. + * @param env The environment that the API is invoked under. + * @param value The JavaScript ArrayBuffer to be checked. + * @param result Whether the arraybuffer is detached. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1649,9 +1649,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsDetachedArraybuffer(JSVM_Env env, * @brief This API returns the names of the enumerable properties of object as an array of * strings. The properties of object whose key is a symbol will not be included. * - * @param env: The environment that the API is invoked under. - * @param object: The object from which to retrieve the properties. - * @param result: A JSVM_Value representing an array of JavaScript values that represent + * @param env The environment that the API is invoked under. + * @param object The object from which to retrieve the properties. + * @param result A JSVM_Value representing an array of JavaScript values that represent * the property names of the object. The API can be used to iterate over result using * OH_JSVM_GetArrayLength and OH_JSVM_GetElement. * @return Returns JSVM funtions result code. @@ -1666,12 +1666,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetPropertyNames(JSVM_Env env, * @brief This API returns an array containing the names of the available properties * of this object. * - * @param env: The environment that the API is invoked under. - * @param object: The object from which to retrieve the properties. - * @param keyMode: Whether to retrieve prototype properties as well. - * @param keyFilter: Which properties to retrieve (enumerable/readable/writable). - * @param keyConversion: Whether to convert numbered property keys to strings. - * @param result: result: A JSVM_Value representing an array of JavaScript values + * @param env The environment that the API is invoked under. + * @param object The object from which to retrieve the properties. + * @param keyMode Whether to retrieve prototype properties as well. + * @param keyFilter Which properties to retrieve (enumerable/readable/writable). + * @param keyConversion Whether to convert numbered property keys to strings. + * @param result A JSVM_Value representing an array of JavaScript values * that represent the property names of the object. OH_JSVM_GetArrayLength and * OH_JSVM_GetElement can be used to iterate over result. * @return Returns JSVM funtions result code. @@ -1688,10 +1688,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetAllPropertyNames(JSVM_Env env, /** * @brief This API set a property on the Object passed in. * - * @param env: The environment that the API is invoked under. - * @param object: The object on which to set the property. - * @param key: The name of the property to set. - * @param value: The property value. + * @param env The environment that the API is invoked under. + * @param object The object on which to set the property. + * @param key The name of the property to set. + * @param value The property value. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1704,10 +1704,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_SetProperty(JSVM_Env env, /** * @brief This API gets the requested property from the Object passed in. * - * @param env: The environment that the API is invoked under. - * @param object: The object from which to retrieve the property. - * @param key: The name of the property to retrieve. - * @param result: The value of the property. + * @param env The environment that the API is invoked under. + * @param object The object from which to retrieve the property. + * @param key The name of the property to retrieve. + * @param result The value of the property. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1720,10 +1720,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetProperty(JSVM_Env env, /** * @brief This API checks if the Object passed in has the named property. * - * @param env: The environment that the API is invoked under. - * @param object: The object to query. - * @param key: The name of the property whose existence to check. - * @param result: Whether the property exists on the object or not. + * @param env The environment that the API is invoked under. + * @param object The object to query. + * @param key The name of the property whose existence to check. + * @param result Whether the property exists on the object or not. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1736,10 +1736,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_HasProperty(JSVM_Env env, /** * @brief This API attempts to delete the key own property from object. * - * @param env: The environment that the API is invoked under. - * @param object: The object to query. - * @param key: The name of the property to delete. - * @param result: Whether the property deletion succeeded or not. result + * @param env The environment that the API is invoked under. + * @param object The object to query. + * @param key The name of the property to delete. + * @param result Whether the property deletion succeeded or not. result * can optionally be ignored by passing NULL. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -1755,10 +1755,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DeleteProperty(JSVM_Env env, * key must be a string or a symbol, or an error will be thrown. JSVM-API will * not perform any conversion between data types. * - * @param env: The environment that the API is invoked under. - * @param object: The object to query. - * @param key: The name of the own property whose existence to check. - * @param result: Whether the own property exists on the object or not. + * @param env The environment that the API is invoked under. + * @param object The object to query. + * @param key The name of the own property whose existence to check. + * @param result Whether the own property exists on the object or not. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1770,12 +1770,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_HasOwnProperty(JSVM_Env env, /** * @brief This method is equivalent to calling OH_JSVM_SetProperty with - * a JSVM_Value created from the string passed in as utf8Name. + * a JSVM_Value created from the string passed in as utf8name. * - * @param env: The environment that the API is invoked under. - * @param object: The object on which to set the property. - * @param utf8Name: The name of the property to set. - * @param value: The property value. + * @param env The environment that the API is invoked under. + * @param object The object on which to set the property. + * @param utf8name The name of the property to set. + * @param value The property value. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1787,12 +1787,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_SetNamedProperty(JSVM_Env env, /** * @brief This method is equivalent to calling OH_JSVM_SetProperty with - * a JSVM_Value created from the string passed in as utf8Name. + * a JSVM_Value created from the string passed in as utf8name. * - * @param env: The environment that the API is invoked under. - * @param object: The object from which to retrieve the property. - * @param utf8Name: The name of the property to get. - * @param result: The value of the property. + * @param env The environment that the API is invoked under. + * @param object The object from which to retrieve the property. + * @param utf8name The name of the property to get. + * @param result The value of the property. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1804,12 +1804,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetNamedProperty(JSVM_Env env, /** * @brief This method is equivalent to calling OH_JSVM_SetProperty with - * a JSVM_Value created from the string passed in as utf8Name. + * a JSVM_Value created from the string passed in as utf8name. * - * @param env: The environment that the API is invoked under. - * @param object: The object to query. - * @param utf8Name: The name of the property whose existence to check. - * @param result: Whether the property exists on the object or not. + * @param env The environment that the API is invoked under. + * @param object The object to query. + * @param utf8name The name of the property whose existence to check. + * @param result Whether the property exists on the object or not. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1822,10 +1822,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_HasNamedProperty(JSVM_Env env, /** * @brief This API sets an element on the Object passed in. * - * @param env: The environment that the API is invoked under. - * @param object: The object from which to set the properties. - * @param index: The index of the property to set. - * @param value: The property value. + * @param env The environment that the API is invoked under. + * @param object The object from which to set the properties. + * @param index The index of the property to set. + * @param value The property value. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1838,10 +1838,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_SetElement(JSVM_Env env, /** * @brief This API gets the element at the requested index. * - * @param env: The environment that the API is invoked under. - * @param object: The object from which to retrieve the property. - * @param index: The index of the property to get. - * @param result: The value of the property. + * @param env The environment that the API is invoked under. + * @param object The object from which to retrieve the property. + * @param index The index of the property to get. + * @param result The value of the property. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1855,10 +1855,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetElement(JSVM_Env env, * @brief This API returns if the Object passed in has an element * at the requested index. * - * @param env: The environment that the API is invoked under. - * @param object: The object to query. - * @param index: The index of the property whose existence to check. - * @param result: Whether the property exists on the object or not. + * @param env The environment that the API is invoked under. + * @param object The object to query. + * @param index The index of the property whose existence to check. + * @param result Whether the property exists on the object or not. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1871,10 +1871,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_HasElement(JSVM_Env env, /** * @brief This API attempts to delete the specified index from object. * - * @param env: The environment that the API is invoked under. - * @param object: The object to query. - * @param index: The index of the property to delete. - * @param result: Whether the element deletion succeeded or not. result + * @param env The environment that the API is invoked under. + * @param object The object to query. + * @param index The index of the property to delete. + * @param result Whether the element deletion succeeded or not. result * can optionally be ignored by passing NULL. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -1891,10 +1891,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DeleteElement(JSVM_Env env, * Given an array of such property descriptors, this API will set the properties * on the object one at a time, as defined by DefineOwnProperty(). * - * @param env: The environment that the API is invoked under. - * @param object: The object from which to retrieve the properties. - * @param propertyCount: The number of elements in the properties array. - * @param properties: The array of property descriptors. + * @param env The environment that the API is invoked under. + * @param object The object from which to retrieve the properties. + * @param propertyCount The number of elements in the properties array. + * @param properties The array of property descriptors. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1911,8 +1911,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DefineProperties(JSVM_Env env, * properties, and prevents the values of existing properties from being changed. * It also prevents the object's prototype from being changed. * - * @param env: The environment that the API is invoked under. - * @param object: The object to freeze. + * @param env The environment that the API is invoked under. + * @param object The object to freeze. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1924,8 +1924,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ObjectFreeze(JSVM_Env env, * @brief This method seals a given object. This prevents new properties * from being added to it, as well as marking all existing properties as non-configurable. * - * @param env: The environment that the API is invoked under. - * @param object: The object to seal. + * @param env The environment that the API is invoked under. + * @param object The object to seal. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1938,12 +1938,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ObjectSeal(JSVM_Env env, * a native add-on. This is the primary mechanism of calling back from the * add-on's native code into JavaScript. * - * @param env: The environment that the API is invoked under. - * @param recv: The this value passed to the called function. - * @param func: JSVM_Value representing the JavaScript function to be invoked. - * @param argc: The count of elements in the argv array. - * @param argv: Array of JSVM_values representing JavaScript values passed in as arguments to the function. - * @param result: JSVM_Value representing the JavaScript object returned. + * @param env The environment that the API is invoked under. + * @param recv The this value passed to the called function. + * @param func JSVM_Value representing the JavaScript function to be invoked. + * @param argc The count of elements in the argv array. + * @param argv Array of JSVM_values representing JavaScript values passed in as arguments to the function. + * @param result JSVM_Value representing the JavaScript object returned. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1963,14 +1963,14 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CallFunction(JSVM_Env env, * object that is visible to JavaScript, in order for the function to be accessible * from script. * - * @param env: The environment that the API is invoked under. - * @param utf8Name: Optional name of the function encoded as UTF8. This is visible + * @param env The environment that the API is invoked under. + * @param utf8name Optional name of the function encoded as UTF8. This is visible * within JavaScript as the new function object's name property. - * @param length: The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it + * @param length The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it * is null-terminated. - * @param cb: The native function which should be called when this function + * @param cb The native function which should be called when this function * object is invoked and data. JSVM_Callback provides more details. - * @param result: JSVM_Value representing the JavaScript function object for the newly + * @param result JSVM_Value representing the JavaScript function object for the newly * created function. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -1986,18 +1986,18 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateFunction(JSVM_Env env, * @brief This method is used within a callback function to retrieve details about * the call like the arguments and the this pointer from a given callback info. * - * @param env: The environment that the API is invoked under. - * @param cbinfo: The callback info passed into the callback function. - * @param argc: Specifies the length of the provided argv array and receives the + * @param env The environment that the API is invoked under. + * @param cbinfo The callback info passed into the callback function. + * @param argc Specifies the length of the provided argv array and receives the * actual count of arguments. argc can optionally be ignored by passing NULL. - * @param argv: C array of JSVM_values to which the arguments will be copied. If + * @param argv C array of JSVM_values to which the arguments will be copied. If * there are more arguments than the provided count, only the requested number of * arguments are copied. If there are fewer arguments provided than claimed, the * rest of argv is filled with JSVM_Value values that represent undefined. argv * can optionally be ignored by passing NULL. - * @param thisArg: Receives the JavaScript this argument for the call. thisArg + * @param thisArg Receives the JavaScript this argument for the call. thisArg * can optionally be ignored by passing NULL. - * @param data: Receives the data pointer for the callback. data can optionally + * @param data Receives the data pointer for the callback. data can optionally * be ignored by passing NULL. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -2014,9 +2014,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetCbInfo(JSVM_Env env, * @brief This API returns the new.target of the constructor call. If the * current callback is not a constructor call, the result is NULL. * - * @param env: The environment that the API is invoked under. - * @param cbinfo: The callback info passed into the callback function. - * @param result: The new.target of the constructor call. + * @param env The environment that the API is invoked under. + * @param cbinfo The callback info passed into the callback function. + * @param result The new.target of the constructor call. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2029,12 +2029,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetNewTarget(JSVM_Env env, * @brief his method is used to instantiate a new JavaScript value using * a given JSVM_Value that represents the constructor for the object. * - * @param env: The environment that the API is invoked under. - * @param constructor: JSVM_Value representing the JavaScript function to be invoked as a constructor. - * @param argc: The count of elements in the argv array. - * @param argv: Array of JavaScript values as JSVM_Value representing the arguments to + * @param env The environment that the API is invoked under. + * @param constructor JSVM_Value representing the JavaScript function to be invoked as a constructor. + * @param argc The count of elements in the argv array. + * @param argv Array of JavaScript values as JSVM_Value representing the arguments to * the constructor. If argc is zero this parameter may be omitted by passing in NULL. - * @param result: JSVM_Value representing the JavaScript object returned, which + * @param result JSVM_Value representing the JavaScript object returned, which * in this case is the constructed object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -2051,20 +2051,20 @@ JSVM_EXTERN JSVM_Status OH_JSVM_NewInstance(JSVM_Env env, * should be a static method on the class that calls the actual class constructor, then * wraps the new C++ instance in a JavaScript object, and returns the wrapper object. * - * @param env: The environment that the API is invoked under. - * @param utf8name: Name of the JavaScript constructor function. For clarity, it is + * @param env The environment that the API is invoked under. + * @param utf8name Name of the JavaScript constructor function. For clarity, it is * recommended to use the C++ class name when wrapping a C++ class. - * @param length: The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it + * @param length The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it * is null-terminated. - * @param constructor: Struct include callback function that handles constructing instances of the class. + * @param constructor Struct include callback function that handles constructing instances of the class. * When wrapping a C++ class, this method must be a static member with the JSVM_Callback.callback * signature. A C++ class constructor cannot be used. * Include Optional data to be passed to the constructor callback as the data * property of the callback info. JSVM_Callback provides more details. - * @param propertyCount: Number of items in the properties array argument. - * @param properties: Array of property descriptors describing static and instance data + * @param propertyCount Number of items in the properties array argument. + * @param properties Array of property descriptors describing static and instance data * properties, accessors, and methods on the class See JSVM_PropertyDescriptor. - * @param result: A JSVM_Value representing the constructor function for the class. + * @param result A JSVM_Value representing the constructor function for the class. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2081,14 +2081,14 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DefineClass(JSVM_Env env, * @brief Wraps a native instance in a JavaScript object. The native instance can * be retrieved later using OH_JSVM_Unwrap(). * - * @param env: The environment that the API is invoked under. - * @param jsObject: The JavaScript object that will be the wrapper for the native object. - * @param nativeObject: The native instance that will be wrapped in the JavaScript object. - * @param finalizeCb: Optional native callback that can be used to free the native instance + * @param env The environment that the API is invoked under. + * @param jsObject The JavaScript object that will be the wrapper for the native object. + * @param nativeObject The native instance that will be wrapped in the JavaScript object. + * @param finalizeCb Optional native callback that can be used to free the native instance * when the JavaScript object has been garbage-collected. - * @param finalizeHint: Optional contextual hint that is passed to the finalize callback. + * @param finalizeHint Optional contextual hint that is passed to the finalize callback. * properties, accessors, and methods on the class See JSVM_PropertyDescriptor. - * @param result: Optional reference to the wrapped object. + * @param result Optional reference to the wrapped object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2106,9 +2106,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Wrap(JSVM_Env env, * argument to the callback is the wrapper object; the wrapped C++ instance that is the target of * the call can be obtained then by calling OH_JSVM_Unwrap() on the wrapper object. * - * @param env: The environment that the API is invoked under. - * @param jsObject: The object associated with the native instance. - * @param result: Pointer to the wrapped native instance. + * @param env The environment that the API is invoked under. + * @param jsObject The object associated with the native instance. + * @param result Pointer to the wrapped native instance. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2122,9 +2122,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Unwrap(JSVM_Env env, * using OH_JSVM_Wrap() and removes the wrapping. If a finalize callback was associated with the wrapping, * it will no longer be called when the JavaScript object becomes garbage-collected. * - * @param env: The environment that the API is invoked under. - * @param jsObject: The object associated with the native instance. - * @param result: Pointer to the wrapped native instance. + * @param env The environment that the API is invoked under. + * @param jsObject The object associated with the native instance. + * @param result Pointer to the wrapped native instance. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2139,9 +2139,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_RemoveWrap(JSVM_Env env, * object with one owned by the addon to ensure that the object has the right type. * If the object already has an associated type tag, this API will return JSVM_INVALID_ARG. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript object or external to be marked. - * @param typeTag: The tag with which the object is to be marked. + * @param env The environment that the API is invoked under. + * @param value The JavaScript object or external to be marked. + * @param typeTag The tag with which the object is to be marked. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_INVALID_ARG } If the object already has an associated type tag.\n @@ -2156,10 +2156,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_TypeTagObject(JSVM_Env env, * If no tag is found on js object or, if a tag is found but it does not match typeTag, * then result is set to false. If a tag is found and it matches typeTag, then result is set to true. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript object or external whose type tag to examine. - * @param typeTag: The tag with which to compare any tag found on the object. - * @param result: Whether the type tag given matched the type tag on the object. false is also returned + * @param env The environment that the API is invoked under. + * @param value The JavaScript object or external whose type tag to examine. + * @param typeTag The tag with which to compare any tag found on the object. + * @param result Whether the type tag given matched the type tag on the object. false is also returned * if no type tag was found on the object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -2173,13 +2173,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CheckObjectTypeTag(JSVM_Env env, /** * @brief This API can be called multiple times on a single JavaScript object. * - * @param env: The environment that the API is invoked under. - * @param jsObject: The JavaScript object to which the native data will be attached. - * @param finalizeData: Optional data to be passed to finalizeCb. - * @param finalizeCb: Native callback that will be used to free the native data when the + * @param env The environment that the API is invoked under. + * @param jsObject The JavaScript object to which the native data will be attached. + * @param finalizeData Optional data to be passed to finalizeCb. + * @param finalizeCb Native callback that will be used to free the native data when the * JavaScript object has been garbage-collected. JSVM_Finalize provides more details. - * @param finalizeHint: Optional contextual hint that is passed to the finalize callback. - * @param result: Optional reference to the JavaScript object. + * @param finalizeHint Optional contextual hint that is passed to the finalize callback. + * @param result Optional reference to the JavaScript object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2198,8 +2198,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_AddFinalizer(JSVM_Env env, * API functions. In order to allow an addon to use a newer function when running with versions * of JSVM that support it, while providing fallback behavior when running with JSVM * versions that don't support it. - * @param env: The environment that the API is invoked under. - * @param result: The highest version of JSVM-API supported. + * @param env The environment that the API is invoked under. + * @param result The highest version of JSVM-API supported. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2210,7 +2210,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetVersion(JSVM_Env env, /** * @brief Return information of the VM. * - * @param result: The information of the VM. + * @param result The information of the VM. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2224,10 +2224,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetVMInfo(JSVM_VMInfo* result); * externally allocated memory will trigger global garbage collections more often * than it would otherwise. * - * @param env: The environment that the API is invoked under. - * @param changeInBytes: The change in externally allocated memory that is kept + * @param env The environment that the API is invoked under. + * @param changeInBytes The change in externally allocated memory that is kept * alive by JavaScript objects. - * @param result: The adjusted value + * @param result The adjusted value * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2240,8 +2240,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_AdjustExternalMemory(JSVM_Env env, * @brief This function notifies the VM that the system is running low on memory * and optionally triggers a garbage collection. * - * @param env: The environment that the API is invoked under. - * @param level: The memory pressure level set to the current VM. + * @param env The environment that the API is invoked under. + * @param level The memory pressure level set to the current VM. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2252,11 +2252,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_MemoryPressureNotification(JSVM_Env env, /** * @brief This API creates a deferred object and a JavaScript promise. * - * @param env: The environment that the API is invoked under. - * @param deferred: A newly created deferred object which can later be + * @param env The environment that the API is invoked under. + * @param deferred A newly created deferred object which can later be * passed to OH_JSVM_ResolveDeferred() or OH_JSVM_RejectDeferred() to resolve * resp. reject the associated promise. - * @param promise: The JavaScript promise associated with the deferred object. + * @param promise The JavaScript promise associated with the deferred object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2272,9 +2272,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreatePromise(JSVM_Env env, * that the promise must have been created using OH_JSVM_CreatePromise() and the deferred * object returned from that call must have been retained in order to be passed to this API. * - * @param env: The environment that the API is invoked under. - * @param deferred: The deferred object whose associated promise to resolve. - * @param resolution: The value with which to resolve the promise. + * @param env The environment that the API is invoked under. + * @param deferred The deferred object whose associated promise to resolve. + * @param resolution The value with which to resolve the promise. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2290,9 +2290,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ResolveDeferred(JSVM_Env env, * that the promise must have been created using OH_JSVM_CreatePromise() and the deferred * object returned from that call must have been retained in order to be passed to this API. * - * @param env: The environment that the API is invoked under. - * @param deferred: The deferred object whose associated promise to resolve. - * @param rejection: The value with which to reject the promise. + * @param env The environment that the API is invoked under. + * @param deferred The deferred object whose associated promise to resolve. + * @param rejection The value with which to reject the promise. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2303,9 +2303,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_RejectDeferred(JSVM_Env env, /** * @brief This API return indicating whether promise is a native promise object. - * @param env: The environment that the API is invoked under. - * @param value: The value to examine - * @param isPromise: Flag indicating whether promise is a native promise object + * @param env The environment that the API is invoked under. + * @param value The value to examine + * @param isPromise Flag indicating whether promise is a native promise object * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2316,9 +2316,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsPromise(JSVM_Env env, /** * @brief This API parses a JSON string and returns it as value if successful. - * @param env: The environment that the API is invoked under. - * @param jsonString: The string to parse. - * @param result: The parse value if successful. + * @param env The environment that the API is invoked under. + * @param jsonString The string to parse. + * @param result The parse value if successful. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2329,9 +2329,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_JsonParse(JSVM_Env env, /** * @brief This API stringifies the object and returns it as string if successful. - * @param env: The environment that the API is invoked under. - * @param jsonObject: The object to stringify. - * @param result: The string if successfully stringified. + * @param env The environment that the API is invoked under. + * @param jsonObject The object to stringify. + * @param result The string if successfully stringified. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2342,11 +2342,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_JsonStringify(JSVM_Env env, /** * @brief This API create the startup snapshot of the VM. - * @param vm: The environment that the API is invoked under. - * @param contextCount: The object to stringify. - * @param contexts: The array of contexts to add to the snapshot. - * @param blobData: The snapshot data. - * @param blobSize: The size of snapshot data. + * @param vm The environment that the API is invoked under. + * @param contextCount The object to stringify. + * @param contexts The array of contexts to add to the snapshot. + * @param blobData The snapshot data. + * @param blobSize The size of snapshot data. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2360,8 +2360,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateSnapshot(JSVM_VM vm, /** * @brief This function returns a set of statistics data of the heap of the VM. * - * @param vm: The VM whose heap statistics are returned. - * @param result: The heap statistics data. + * @param vm The VM whose heap statistics are returned. + * @param result The heap statistics data. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } in all cases.\n * @since 12 @@ -2372,8 +2372,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetHeapStatistics(JSVM_VM vm, /** * @brief This function creates and starts a CPU profiler. * - * @param vm: The VM to start CPU profiler for. - * @param result: The pointer to the CPU profiler. + * @param vm The VM to start CPU profiler for. + * @param result The pointer to the CPU profiler. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } in all cases.\n * @since 12 @@ -2384,10 +2384,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_StartCpuProfiler(JSVM_VM vm, /** * @brief This function stops the CPU profiler and output to the stream. * - * @param vm: THe VM to start CPU profiler for. - * @param profiler: The CPU profiler to stop. - * @param stream: The output stream callback for receiving the data. - * @param streamData: Optional data to be passed to the stream callback. + * @param vm THe VM to start CPU profiler for. + * @param profiler The CPU profiler to stop. + * @param stream The output stream callback for receiving the data. + * @param streamData Optional data to be passed to the stream callback. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } in all cases.\n * @since 12 @@ -2400,9 +2400,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_StopCpuProfiler(JSVM_VM vm, /** * @brief This funciton takes the current heap snapshot and output to the stream. * - * @param vm: The VM whose heap snapshot is taken. - * @param stream: The output stream callback for receiving the data. - * @param streamData: Optional data to be passed to the stream callback. + * @param vm The VM whose heap snapshot is taken. + * @param stream The output stream callback for receiving the data. + * @param streamData Optional data to be passed to the stream callback. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } in all cases.\n * @since 12 @@ -2414,9 +2414,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_TakeHeapSnapshot(JSVM_VM vm, /** * @brief This functiong activates insepctor on host and port. * - * @param env: The environment that the API is invoked under. - * @param host: The host to listen to for inspector connections. - * @param port: The port to listen to for inspector connections. + * @param env The environment that the API is invoked under. + * @param host The host to listen to for inspector connections. + * @param port The port to listen to for inspector connections. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_PENDING_EXCEPTION } if an exception occurs.\n @@ -2429,7 +2429,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_OpenInspector(JSVM_Env env, /** * @brief This function attempts to close all remaining inspector connections. * - * @param env: The environment that the API is invoked under. + * @param env The environment that the API is invoked under. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_PENDING_EXCEPTION } if an exception occurs.\n @@ -2441,8 +2441,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CloseInspector(JSVM_Env env); * @brief This function will block until a client (existing or connected later) * has sent Runtime.runIfWaitingForDebugger command. * - * @param env: The environment that the API is invoked under. - * @param breakNextLine: Whether break on the next line of JavaScript code. + * @param env The environment that the API is invoked under. + * @param breakNextLine Whether break on the next line of JavaScript code. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_PENDING_EXCEPTION } if an exception occurs.\n @@ -2455,22 +2455,22 @@ JSVM_EXTERN JSVM_Status OH_JSVM_WaitForDebugger(JSVM_Env env, * @brief Define a JavaScript class with given class name, constructor, properties, callback handlers for * property operations including get, set, delete, enum etc., and call as function callback. * - * @param env: The environment that the API is invoked under. - * @param utf8name: Name of the JavaScript constructor function. For clarity, it is + * @param env The environment that the API is invoked under. + * @param utf8name Name of the JavaScript constructor function. For clarity, it is * recommended to use the C++ class name when wrapping a C++ class. - * @param length: The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it + * @param length The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it * is null-terminated. - * @param constructor: Struct include callback function that handles constructing instances of the class. + * @param constructor Struct include callback function that handles constructing instances of the class. * When wrapping a C++ class, this method must be a static member with the JSVM_Callback.callback * signature. A C++ class constructor cannot be used. * Include Optional data to be passed to the constructor callback as the data * property of the callback info. JSVM_Callback provides more details. - * @param propertyCount: Number of items in the properties array argument. - * @param properties: Array of property descriptors describing static and instance data + * @param propertyCount Number of items in the properties array argument. + * @param properties Array of property descriptors describing static and instance data * properties, accessors, and methods on the class See JSVM_PropertyDescriptor. - * @param propertyHandlerCfg: The instance object triggers the corresponding callback function. - * @param callAsFunctionCallback: Calling an instance object as a function will trigger this callback. - * @param result: A JSVM_Value representing the constructor function for the class. + * @param propertyHandlerCfg The instance object triggers the corresponding callback function. + * @param callAsFunctionCallback Calling an instance object as a function will trigger this callback. + * @param result A JSVM_Value representing the constructor function for the class. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -2489,8 +2489,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DefineClassWithPropertyHandler(JSVM_Env env, * @brief Determines whether the current thread holds the lock for the specified environment. * Only threads that hold locks can use the environment. * - * @param env: The environment that the API is invoked under. - * @param isLocked: Flag indicating whether the current thread holds the lock for the specified environment. + * @param env The environment that the API is invoked under. + * @param isLocked Flag indicating whether the current thread holds the lock for the specified environment. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -2501,7 +2501,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsLocked(JSVM_Env env, /** * @brief Acquire the lock for the specified environment. Only threads that hold locks can use the environment. * - * @param env: The environment that the API is invoked under. + * @param env The environment that the API is invoked under. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -2511,7 +2511,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_AcquireLock(JSVM_Env env); /** * @brief Release the lock for the specified environment. Only threads that hold locks can use the environment. * - * @param env: The environment that the API is invoked under. + * @param env The environment that the API is invoked under. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -2544,9 +2544,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_PerformMicrotaskCheckpoint(JSVM_VM vm); /** * @brief This API checks if the value passed in is callable. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isCallable: Whether the given value is callable. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isCallable Whether the given value is callable. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -2559,9 +2559,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsCallable(JSVM_Env env, * @brief This API checks if the value passed in is undefined. * This equals to `value === undefined` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isUndefined: Whether the given value is Undefined. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isUndefined Whether the given value is Undefined. * @return Returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2574,9 +2574,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsUndefined(JSVM_Env env, * @brief This API checks if the value passed in is a null object. * This equals to `value === null` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isNull: Whether the given value is Null. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isNull Whether the given value is Null. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2589,9 +2589,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsNull(JSVM_Env env, * @brief This API checks if the value passed in is either a null or an undefined object. * This is equivalent to `value == null` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isNullOrUndefined: Whether the given value is Null or Undefined. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isNullOrUndefined Whether the given value is Null or Undefined. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2604,9 +2604,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsNullOrUndefined(JSVM_Env env, * @brief This API checks if the value passed in is a boolean. * This equals to `typeof value === 'boolean'` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isBoolean: Whether the given value is Boolean. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isBoolean Whether the given value is Boolean. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2619,9 +2619,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsBoolean(JSVM_Env env, * @brief This API checks if the value passed in is a number. * This equals to `typeof value === 'number'` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isNumber: Whether the given value is Number. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isNumber Whether the given value is Number. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2634,9 +2634,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsNumber(JSVM_Env env, * @brief This API checks if the value passed in is a string. * This equals to `typeof value === 'string'` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isString: Whether the given value is String. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isString Whether the given value is String. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2649,9 +2649,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsString(JSVM_Env env, * @brief This API checks if the value passed in is a symbol. * This equals to `typeof value === 'symbol'` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isSymbol: Whether the given value is Symbol. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isSymbol Whether the given value is Symbol. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2664,9 +2664,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsSymbol(JSVM_Env env, * @brief This API checks if the value passed in is a function. * This equals to `typeof value === 'function'` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isFunction: Whether the given value is Function. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isFunction Whether the given value is Function. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2678,9 +2678,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsFunction(JSVM_Env env, /** * @brief This API checks if the value passed in is an object. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isObject: Whether the given value is Object. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isObject Whether the given value is Object. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2693,9 +2693,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsObject(JSVM_Env env, * @brief This API checks if the value passed in is a bigInt. * This equals to `typeof value === 'bigint'` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isBigInt: Whether the given value is BigInt. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isBigInt Whether the given value is BigInt. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2707,8 +2707,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsBigInt(JSVM_Env env, /** * @brief This API returns a JSVM-API value corresponding to a JavaScript Map type. * - * @param env: The environment that the API is invoked under. - * @param result: A JSVM_Value representing a JavaScript Map. + * @param env The environment that the API is invoked under. + * @param result A JSVM_Value representing a JavaScript Map. * @return Only returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2719,9 +2719,9 @@ JSVM_Status JSVM_CDECL OH_JSVM_CreateMap(JSVM_Env env, JSVM_Value* result); /** * @brief This API checks if the value passed in is a Map. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param isMap: Whether the given value is Map. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param isMap Whether the given value is Map. * @return Only returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2734,8 +2734,8 @@ JSVM_Status JSVM_CDECL OH_JSVM_IsMap(JSVM_Env env, /** * @brief This API returns a JSVM-API value corresponding to a JavaScript Set type. * - * @param env: The environment that the API is invoked under. - * @param result: A JSVM_Value representing a JavaScript Set. + * @param env The environment that the API is invoked under. + * @param result A JSVM_Value representing a JavaScript Set. * @return Returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2747,9 +2747,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateSet(JSVM_Env env, /** * @brief This API checks if the value passed in is a Set. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param isSet: Whether the given value is Set. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param isSet Whether the given value is Set. * @return Returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2763,11 +2763,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsSet(JSVM_Env env, * @brief This function compiles a string of JavaScript code with the compile options * and returns the compiled script. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param script: A JavaScript string containing the script to be compiled. - * @param optionCount: length of option array. - * @param options: Compile options to be passed. - * @param result: The compiled script. + * @param env The environment that the JSVM-API call is invoked under. + * @param script A JavaScript string containing the script to be compiled. + * @param optionCount length of option array. + * @param options Compile options to be passed. + * @param result The compiled script. * @return Returns JSVM functions result code * {@link JSVM_OK } if the API succeeded. \n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2782,9 +2782,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CompileScriptWithOptions(JSVM_Env env, /** * @brief This API implements the abstract operation ToBigInt(). * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to coerce. - * @param result: JSVM_Value representing the coerced JavaScript BigInt. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to coerce. + * @param result JSVM_Value representing the coerced JavaScript BigInt. * @return Returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded. * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2799,9 +2799,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CoerceToBigInt(JSVM_Env env, * @brief This API checks if the value passed in is a regExp. * This equals to `value instanceof RegExp` in JS. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param result: Whether the given value is RegExp. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given value is RegExp. * @return Returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2815,9 +2815,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsRegExp(JSVM_Env env, /** * @brief This API checks if the value passed in is a constructor. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param isConstructor: Whether the given value is Constructor. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param isConstructor Whether the given value is Constructor. * @return Only returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2832,10 +2832,10 @@ JSVM_Status JSVM_CDECL OH_JSVM_IsConstructor(JSVM_Env env, * corresponding to the input. * The interface may throw an exception. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript string to convert to a regular expression. - * @param flags: Regular expression flag bits. - * @param result: A JSVM_Value representing a JavaScript RegExp. + * @param env The environment that the API is invoked under. + * @param value The JavaScript string to convert to a regular expression. + * @param flags Regular expression flag bits. + * @param result A JSVM_Value representing a JavaScript RegExp. * @return Only returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2852,10 +2852,10 @@ JSVM_Status JSVM_CDECL OH_JSVM_CreateRegExp(JSVM_Env env, /** * @brief This API returns the Object prototype. * - * @param env: The environment that the API is invoked under. - * @param object: JSVM_Value representing JavaScript Object whose prototype to return. This returns + * @param env The environment that the API is invoked under. + * @param object JSVM_Value representing JavaScript Object whose prototype to return. This returns * the equivalent of Object.getPrototypeOf (which is not the same as the function's prototype property). - * @param result: JSVM_Value representing prototype of the given object. + * @param result JSVM_Value representing prototype of the given object. * @return Returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2868,9 +2868,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ObjectGetPrototypeOf(JSVM_Env env, /** * @brief This API set the prototype on the Object passed in. * - * @param env: The environment that the API is invoked under. - * @param object: The object on which to set the prototype. - * @param prototype: The prototype value. + * @param env The environment that the API is invoked under. + * @param object The object on which to set the prototype. + * @param prototype The prototype value. * @return Returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2883,14 +2883,14 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ObjectSetPrototypeOf(JSVM_Env env, /** * @brief Creates a function with a given script as its body. * - * @param env: The environment that the API is invoked under. - * @param funcName: A string containing the function's name. Pass NULL to create an anonymous function. - * @param length: The length of the funcName in bytes, or JSVM_AUTO_LENGTH if it + * @param env The environment that the API is invoked under. + * @param funcName A string containing the function's name. Pass NULL to create an anonymous function. + * @param length The length of the funcName in bytes, or JSVM_AUTO_LENGTH if it * is null-terminated. - * @param argc: The count of elements in the argv array. - * @param argv: Array of JSVM_Values representing JavaScript strings passed in as arguments to the function. - * @param script: A JavaScript string containing the script to use as the function's body. - * @param result: JSVM_Value representing the JavaScript function object for the newly + * @param argc The count of elements in the argv array. + * @param argv Array of JSVM_Values representing JavaScript strings passed in as arguments to the function. + * @param script A JavaScript string containing the script to use as the function's body. + * @param result JSVM_Value representing the JavaScript function object for the newly * created function. * @return Returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded. @@ -2910,8 +2910,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateFunctionWithScript(JSVM_Env env, * @brief This function keep persistently save a JSVM_Script and extend its lifecycle * beyond the current scope. * - * @param env: The environment that the API is invoked under. - * @param script: A JavaScript string containing the script to be retained. + * @param env The environment that the API is invoked under. + * @param script A JavaScript string containing the script to be retained. * @return Returns JSVM functions result code * {@link JSVM_OK } if the API succeeded. \n * {@link JSVM_INVALID_ARG } if the script is empty or already retained. \n @@ -2922,8 +2922,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_RetainScript(JSVM_Env env, JSVM_Script script); /** * @brief This function release the script retained by OH_JSVM_RetainScript * - * @param env: The environment that the API is invoked under. - * @param script: A JavaScript string containing the script to be retained. + * @param env The environment that the API is invoked under. + * @param script A JavaScript string containing the script to be retained. * @return Returns JSVM functions result code * {@link JSVM_OK } if the API succeeded. \n * {@link JSVM_INVALID_ARG } if the script is empty or not retained. \n @@ -2934,9 +2934,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ReleaseScript(JSVM_Env env, JSVM_Script script); /** * @brief This function activates insepctor with pid and alias it. * - * @param env: The environment that the API is invoked under. - * @param pid: A process id to identify the inspector connection. - * @param name: An alias for the inspector that under a specific pid. + * @param env The environment that the API is invoked under. + * @param pid A process id to identify the inspector connection. + * @param name An alias for the inspector that under a specific pid. * default name is jsvm if a nullptr is passed in. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n @@ -2951,13 +2951,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_OpenInspectorWithName(JSVM_Env env, * @brief Compile WebAssembly bytecode into a WebAssembly module. * If WebAssembly cache provided, deserialization will be performed. * - * @param env: The environment that the API is invoked under. - * @param wasmBytecode: WebAssembly bytecode. - * @param wasmBytecodeLength: WebAssembly bytecode length in byte. - * @param cacheData: Optional WebAssembly cache. - * @param cacheDataLength: Optional WebAssembly cache length in byte. - * @param cacheRejected: Output parameter representing whether the provided cacheData is rejected. - * @param wasmModule: Output parameter representing compiled WebAssembly module. + * @param env The environment that the API is invoked under. + * @param wasmBytecode WebAssembly bytecode. + * @param wasmBytecodeLength WebAssembly bytecode length in byte. + * @param cacheData Optional WebAssembly cache. + * @param cacheDataLength Optional WebAssembly cache length in byte. + * @param cacheRejected Output parameter representing whether the provided cacheData is rejected. + * @param wasmModule Output parameter representing compiled WebAssembly module. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_INVALID_ARG } if any of env, wasmBytecode is NULL, or data length is invalid.\n @@ -2978,10 +2978,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CompileWasmModule(JSVM_Env env, * @brief Compile the function with the specified index in the WebAssembly module * into the specified optimization level. * - * @param env: The environment that the API is invoked under. - * @param wasmModule: The WebAssembly module to which the function to compiled belongs. - * @param functionIndex: The index of the function to be compiled, should never be out of range. - * @param optLevel: Optimization level the function will be compiled with. + * @param env The environment that the API is invoked under. + * @param wasmModule The WebAssembly module to which the function to compiled belongs. + * @param functionIndex The index of the function to be compiled, should never be out of range. + * @param optLevel Optimization level the function will be compiled with. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_INVALID_ARG } if env is NULL, or wasmModule is NULL or is not a WebAssembly module.\n @@ -2998,9 +2998,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CompileWasmFunction(JSVM_Env env, /** * @brief Check whether the given JSVM_Value is a WebAssembly module. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param result: Whether the given value is a WebAssembly module. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given value is a WebAssembly module. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_INVALID_ARG } if any of the input arguments is NULL.\n @@ -3014,10 +3014,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsWasmModuleObject(JSVM_Env env, /** * @brief Create cache for compiled WebAssembly module. * - * @param env: The environment that the API is invoked under. - * @param wasmModule: The compiled WebAssembly module. - * @param data: Output parameter representing generated WebAssembly module cache. - * @param length: Output parameter representing byte length of generated WebAssembly module cache. + * @param env The environment that the API is invoked under. + * @param wasmModule The compiled WebAssembly module. + * @param data Output parameter representing generated WebAssembly module cache. + * @param length Output parameter representing byte length of generated WebAssembly module cache. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_INVALID_ARG } if any of the input arguments is NULL.\n @@ -3033,9 +3033,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateWasmCache(JSVM_Env env, /** * @brief Release cache data with specified cache type. * - * @param env: The environment that the API is invoked under. - * @param cacheData: The cache data to be released, double free is undefined behaviors. - * @param cacheType: The type of cache data. + * @param env The environment that the API is invoked under. + * @param cacheData The cache data to be released, double free is undefined behaviors. + * @param cacheType The type of cache data. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL or cacheType is illegal.\n @@ -3048,3 +3048,4 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ReleaseCache(JSVM_Env env, EXTERN_C_END /** @} */ #endif /* ARK_RUNTIME_JSVM_JSVM_H */ + diff --git a/ark_runtime/jsvm/jsvm_types.h b/ark_runtime/jsvm/jsvm_types.h index 1141b051f..4ee1793b3 100644 --- a/ark_runtime/jsvm/jsvm_types.h +++ b/ark_runtime/jsvm/jsvm_types.h @@ -12,10 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#ifndef ARK_RUNTIME_JSVM_JSVM_TYPE_H -#define ARK_RUNTIME_JSVM_JSVM_TYPE_H - /** * @addtogroup JSVM * @{ @@ -43,6 +39,10 @@ * @since 11 */ +#ifndef ARK_RUNTIME_JSVM_JSVM_TYPE_H +#define ARK_RUNTIME_JSVM_JSVM_TYPE_H + + #include // NOLINT(modernize-deprecated-headers) #include // NOLINT(modernize-deprecated-headers) #include // NOLINT(modernize-deprecated-headers) @@ -772,3 +772,4 @@ typedef enum { } JSVM_CacheType; /** @} */ #endif /* ARK_RUNTIME_JSVM_JSVM_TYPE_H */ + -- Gitee From bcef4169a31b17b87096b24847db848f5671f7a1 Mon Sep 17 00:00:00 2001 From: huanghan Date: Thu, 21 Nov 2024 22:15:30 +0800 Subject: [PATCH 454/620] =?UTF-8?q?API=20Lint=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huanghan --- ark_runtime/jsvm/jsvm.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ark_runtime/jsvm/jsvm.h b/ark_runtime/jsvm/jsvm.h index 3f47366b4..dc7aea524 100644 --- a/ark_runtime/jsvm/jsvm.h +++ b/ark_runtime/jsvm/jsvm.h @@ -102,7 +102,7 @@ EXTERN_C_START /** * @brief Init a JavaScript vm. * - * @param options: The options for initialize the JavaScript VM. + * @param options The options for initialize the JavaScript VM. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } in all cases.\n * @since 11 @@ -1546,9 +1546,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsArraybuffer(JSVM_Env env, /** * @brief This API checks if the Object passed in is a date. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param result: Whether the given JSVM_Value represents a JavaScript Date object. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param isDate Whether the given JSVM_Value represents a JavaScript Date object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2522,8 +2522,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ReleaseLock(JSVM_Env env); * @brief Starts the running of the task queue inside the VM. * This task queue can be executed by an external event loop. * - * @param env: The VM instance on which to start the task queue. - * @param result: Whether the task queue was successfully started. + * @param vm The VM instance on which to start the task queue. + * @param result Whether the task queue was successfully started. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -2534,7 +2534,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_PumpMessageLoop(JSVM_VM vm, /** * @brief Check to see if there are any microtasks waiting in the queue, and if there are, execute them. * - * @param env: The VM instance on which to check microtasks. + * @param vm The VM instance on which to check microtasks. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 -- Gitee From 2267e51a18edfe03290e41f0c490ebf3cf1376d7 Mon Sep 17 00:00:00 2001 From: wangxiuxiu96 Date: Mon, 18 Nov 2024 16:46:41 +0800 Subject: [PATCH 455/620] =?UTF-8?q?keyevent=20=E6=8E=A5=E5=8F=A3=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangxiuxiu96 Change-Id: Iafe513facda3f037b30d3af63260a330c6121bb1 --- arkui/ace_engine/native/libace.ndk.json | 12 ++----- arkui/ace_engine/native/native_key_event.h | 42 ---------------------- arkui/ace_engine/native/ui_input_event.h | 24 +++++++++++++ 3 files changed, 26 insertions(+), 52 deletions(-) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 98b4908b7..1d822febf 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2449,15 +2449,7 @@ }, { "first_introduced": "14", - "name": "OH_ArkUI_KeyEvent_GetDeviceId" - }, - { - "first_introduced": "14", - "name": "OH_ArkUI_KeyEvent_GetMetaKey" - }, - { - "first_introduced": "14", - "name": "OH_ArkUI_KeyEvent_GetTimestamp" + "name": "OH_ArkUI_UIInputEvent_GetDeviceId" }, { "first_introduced": "14", @@ -2465,7 +2457,7 @@ }, { "first_introduced": "14", - "name": "OH_ArkUI_KeyEvent_GetModifierKeyState" + "name": "OH_ArkUI_UIInputEvent_GetPressedKeys" }, { "first_introduced": "14", diff --git a/arkui/ace_engine/native/native_key_event.h b/arkui/ace_engine/native/native_key_event.h index 0ab0303a1..70958a813 100644 --- a/arkui/ace_engine/native/native_key_event.h +++ b/arkui/ace_engine/native/native_key_event.h @@ -447,36 +447,6 @@ const char *OH_ArkUI_KeyEvent_GetKeyText(const ArkUI_UIInputEvent* event); */ ArkUI_KeySourceType OH_ArkUI_KeyEvent_GetKeySource(const ArkUI_UIInputEvent* event); -/** - * @brief Obtains the ID of device that triggers a key event. - * - * @param event Pointer to an ArkUI_UIInputEvent object. - * @return Returns the device ID. - * @since 14 - */ -int32_t OH_ArkUI_KeyEvent_GetDeviceId(const ArkUI_UIInputEvent* event); - -/** - * @brief Obtains the state of the meta key (that is, the WIN key on the Windows keyboard or the Command - * key on the Mac keyboard) when a key event occurs. - * - * @param event Pointer to an ArkUI_UIInputEvent object. - * @return Returns the state of the meta key. The value 1 means that the key is pressed, and 0 means the - * opposite. - * @since 14 - */ -int32_t OH_ArkUI_KeyEvent_GetMetaKey(const ArkUI_UIInputEvent* event); - -/** - * @brief Obtains the timestamp of a key event. It is the interval between the time when the event is triggered and the - * time when the system starts, in nanoseconds. - * - * @param event Pointer to an ArkUI_UIInputEvent object. - * @return Returns the event timestamp, in nanoseconds. - * @since 14 - */ -uint64_t OH_ArkUI_KeyEvent_GetTimestamp(const ArkUI_UIInputEvent* event); - /** * @brief Prevents a key event from bubbling up. * @@ -486,18 +456,6 @@ uint64_t OH_ArkUI_KeyEvent_GetTimestamp(const ArkUI_UIInputEvent* event); */ void OH_ArkUI_KeyEvent_StopPropagation(const ArkUI_UIInputEvent* event, bool stopPropagation); -/** - * @brief Obtains the pressed status of modifier keys from a key event. - * The following modifier keys are supported: Ctrl, Alt, Shift, Fn. However, the Fn key on external keyboards - * is not supported. - * - * @param event Pointer to an ArkUI_UIInputEvent object. - * @param modifierKeys Modifier keys to check, which must be created using {@link ArkUI_ModifierKeyName}. - * @return Returns whether the pressed status of the modifier keys. - * @since 14 - */ -bool OH_ArkUI_KeyEvent_GetModifierKeyState(const ArkUI_UIInputEvent* event, uint32_t modifierKeys); - /** * @brief Obtains the intention code associated with a key event. * diff --git a/arkui/ace_engine/native/ui_input_event.h b/arkui/ace_engine/native/ui_input_event.h index c9373cf0e..9b5aa63fb 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -716,6 +716,30 @@ int32_t OH_ArkUI_MouseEvent_GetMouseAction(const ArkUI_UIInputEvent* event); */ int32_t OH_ArkUI_PointerEvent_SetStopPropagation(const ArkUI_UIInputEvent* event, bool stopPropagation); +/** + * @brief Obtains the ID of device that triggers UI input event. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @return Returns the device ID. + * @since 14 + */ +int32_t OH_ArkUI_UIInputEvent_GetDeviceId(const ArkUI_UIInputEvent* event); + +/** + * @brief Obtains the pressed status of modifier keys from UI input event. + * The following modifier keys are supported: Ctrl, Alt, Shift, Fn. However, the Fn key on external keyboards + * is not supported. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @param pressedKeyCodes Indicates the list of the Modifier keys.You need to create a int array first. + * @param length Indicates the total length of the list array. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} if the giving buffer is not enough. + * @since 14 + */ +int32_t OH_ArkUI_UIInputEvent_GetPressedKeys(const ArkUI_UIInputEvent* event, int32_t* pressedKeyCodes, int32_t length); + #ifdef __cplusplus }; #endif -- Gitee From 3146164c9651a294126a98ba9ae1454d32a478b2 Mon Sep 17 00:00:00 2001 From: jiangwei Date: Fri, 22 Nov 2024 10:49:28 +0800 Subject: [PATCH 456/620] =?UTF-8?q?fix:=20trace.h=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=B7=BB=E5=8A=A0=E7=BB=93=E6=9D=9F=E6=A0=87?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jiangwei --- hiviewdfx/hitrace/include/hitrace/trace.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hiviewdfx/hitrace/include/hitrace/trace.h b/hiviewdfx/hitrace/include/hitrace/trace.h index d9ebed256..21c1c6d82 100644 --- a/hiviewdfx/hitrace/include/hitrace/trace.h +++ b/hiviewdfx/hitrace/include/hitrace/trace.h @@ -687,4 +687,6 @@ void OH_HiTrace_CountTrace(const char *name, int64_t count); #ifdef __cplusplus } #endif +/** @} */ + #endif // HIVIEWDFX_HITRACE_H -- Gitee From e64d1e5cac1e782bedb55554901d7c83441980e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E4=B8=80=E9=B8=A3?= Date: Fri, 22 Nov 2024 13:58:34 +0800 Subject: [PATCH 457/620] API Lint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 蔡一鸣 --- .../memory_utils/libpurgeablemem/purgeable_memory.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/commonlibrary/memory_utils/libpurgeablemem/purgeable_memory.h b/commonlibrary/memory_utils/libpurgeablemem/purgeable_memory.h index f8510ba94..2f9cb9ef2 100644 --- a/commonlibrary/memory_utils/libpurgeablemem/purgeable_memory.h +++ b/commonlibrary/memory_utils/libpurgeablemem/purgeable_memory.h @@ -15,6 +15,7 @@ /** * @addtogroup memory + * @{ * * @brief provides memory management capabilities * @@ -32,7 +33,7 @@ * provides features include create, begin read ,end read, begin write, end write, rebuild, and so on. * when using, it is necessary to link libpurgeable_memory_ndk.z.so * - * @library libpurgeablemem.so + * @library libpurgeablemem.z.so * @syscap SystemCapability.Kernel.Memory * @kit KernelEnhanceKit * @since 10 @@ -206,4 +207,5 @@ bool OH_PurgeableMemory_AppendModify(OH_PurgeableMemory *purgObj, #ifdef __cplusplus } #endif /* End of #ifdef __cplusplus */ -#endif /* OHOS_UTILS_MEMORY_LIBPURGEABLEMEM_C_INCLUDE_PURGEABLE_MEMORY_H */ \ No newline at end of file +#endif /* OHOS_UTILS_MEMORY_LIBPURGEABLEMEM_C_INCLUDE_PURGEABLE_MEMORY_H */ +/** @} */ \ No newline at end of file -- Gitee From cf2e9e51e34062b2151d081114b08fe0b7bba82b Mon Sep 17 00:00:00 2001 From: ZhaoJinghui Date: Fri, 22 Nov 2024 15:11:10 +0800 Subject: [PATCH 458/620] C API syntax correction Change-Id: I535e0a96eb84998aadea6517c1eb2d817ac71772 Signed-off-by: ZhaoJinghui --- .../relational_store/include/data_asset.h | 5 +++++ .../relational_store/include/oh_cursor.h | 18 ++++++++++++++++-- .../relational_store/include/oh_predicates.h | 16 ++++++++++++++-- .../relational_store/include/oh_value_object.h | 17 +++++++++++++++-- .../include/oh_values_bucket.h | 17 +++++++++++++++-- .../include/relational_store.h | 2 +- 6 files changed, 66 insertions(+), 9 deletions(-) diff --git a/distributeddatamgr/relational_store/include/data_asset.h b/distributeddatamgr/relational_store/include/data_asset.h index a8bc9e16a..7178748fd 100644 --- a/distributeddatamgr/relational_store/include/data_asset.h +++ b/distributeddatamgr/relational_store/include/data_asset.h @@ -36,7 +36,12 @@ * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 11 */ +#ifdef __cplusplus #include +#else +#include +#endif + #include #ifdef __cplusplus extern "C" { diff --git a/distributeddatamgr/relational_store/include/oh_cursor.h b/distributeddatamgr/relational_store/include/oh_cursor.h index 30d208ab4..b9b35fa8e 100644 --- a/distributeddatamgr/relational_store/include/oh_cursor.h +++ b/distributeddatamgr/relational_store/include/oh_cursor.h @@ -38,7 +38,12 @@ * @since 10 */ +#ifdef __cplusplus #include +#else +#include +#endif + #include #include #include "database/data/data_asset.h" @@ -93,7 +98,16 @@ typedef enum OH_ColumnType { * * @since 10 */ -typedef struct OH_Cursor { +typedef struct OH_Cursor OH_Cursor; + +/** + * @brief Define the OH_Cursor structure type. + * + * Provides methods for accessing a database result set generated by query the database. + * + * @since 10 + */ +struct OH_Cursor { /** * The id used to uniquely identify the OH_Cursor struct. */ @@ -286,7 +300,7 @@ typedef struct OH_Cursor { * @since 11 */ int (*getAssets)(OH_Cursor *cursor, int32_t columnIndex, Data_Asset **value, uint32_t *length); -} OH_Cursor; +}; #ifdef __cplusplus }; diff --git a/distributeddatamgr/relational_store/include/oh_predicates.h b/distributeddatamgr/relational_store/include/oh_predicates.h index 71f496459..c8fe58ccb 100644 --- a/distributeddatamgr/relational_store/include/oh_predicates.h +++ b/distributeddatamgr/relational_store/include/oh_predicates.h @@ -38,7 +38,12 @@ * @since 10 */ +#ifdef __cplusplus #include +#else +#include +#endif + #include #include "database/rdb/oh_value_object.h" @@ -67,7 +72,14 @@ typedef enum OH_OrderType { * * @since 10 */ -typedef struct OH_Predicates { +typedef struct OH_Predicates OH_Predicates; + +/** + * @brief Define the OH_Predicates structure type. + * + * @since 10 + */ +struct OH_Predicates { /** * The id used to uniquely identify the OH_Predicates struct. */ @@ -395,7 +407,7 @@ typedef struct OH_Predicates { * @since 10 */ int (*destroy)(OH_Predicates *predicates); -} OH_Predicates; +}; #ifdef __cplusplus }; diff --git a/distributeddatamgr/relational_store/include/oh_value_object.h b/distributeddatamgr/relational_store/include/oh_value_object.h index dbe5d0d18..85ee3229e 100644 --- a/distributeddatamgr/relational_store/include/oh_value_object.h +++ b/distributeddatamgr/relational_store/include/oh_value_object.h @@ -38,7 +38,12 @@ * @since 10 */ +#ifdef __cplusplus #include +#else +#include +#endif + #ifdef __cplusplus extern "C" { #endif @@ -48,7 +53,15 @@ extern "C" { * * @since 10 */ -typedef struct OH_VObject { +typedef struct OH_VObject OH_VObject; + + +/** + * @brief Define the OH_VObject structure type. + * + * @since 10 + */ +struct OH_VObject { /** * The id used to uniquely identify the OH_VObject struct. */ @@ -112,7 +125,7 @@ typedef struct OH_VObject { * @since 10 */ int (*destroy)(OH_VObject *valueObject); -} OH_VObject; +}; #ifdef __cplusplus }; diff --git a/distributeddatamgr/relational_store/include/oh_values_bucket.h b/distributeddatamgr/relational_store/include/oh_values_bucket.h index db822d1de..6d21d0879 100644 --- a/distributeddatamgr/relational_store/include/oh_values_bucket.h +++ b/distributeddatamgr/relational_store/include/oh_values_bucket.h @@ -38,7 +38,12 @@ * @since 10 */ +#ifdef __cplusplus #include +#else +#include +#endif + #include "database/data/data_asset.h" #ifdef __cplusplus extern "C" { @@ -49,7 +54,15 @@ extern "C" { * * @since 10 */ -typedef struct OH_VBucket { +typedef struct OH_VBucket OH_VBucket; + + +/** + * @brief Define the OH_VBucket structure type. + * + * @since 10 + */ +struct OH_VBucket { /** * The id used to uniquely identify the OH_VBucket struct. */ @@ -139,7 +152,7 @@ typedef struct OH_VBucket { * @since 10 */ int (*destroy)(OH_VBucket *bucket); -} OH_VBucket; +}; /** * @brief Put the {@link Data_Asset} * value to this {@link OH_VBucket} object for the given column name. diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index b8be9a6aa..2320b635b 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -212,7 +212,7 @@ int OH_Rdb_DestroyConfig(OH_Rdb_ConfigV2 *config); * * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. * Indicates the configuration of the database related to this RDB store. - * @param dataBaseDir Indicates the directory of the database. + * @param databaseDir Indicates the directory of the database. * @return Returns the status code of the execution. Successful execution returns RDB_OK, * {@link RDB_OK} - success. * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. -- Gitee From 1413867be458d4dacaa6cebf774f1ca26751fa65 Mon Sep 17 00:00:00 2001 From: wangyulie Date: Fri, 22 Nov 2024 16:38:16 +0800 Subject: [PATCH 459/620] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E6=89=93?= =?UTF-8?q?=E5=8C=85=E7=9A=84=E5=A4=B4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyulie --- resourceschedule/ffrt/ffrt.h | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 resourceschedule/ffrt/ffrt.h diff --git a/resourceschedule/ffrt/ffrt.h b/resourceschedule/ffrt/ffrt.h deleted file mode 100644 index 32a4ccf54..000000000 --- a/resourceschedule/ffrt/ffrt.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef FFRT_API_FFRT_H -#define FFRT_API_FFRT_H -#ifdef __cplusplus -#include "cpp/task.h" -#include "cpp/mutex.h" -#include "cpp/condition_variable.h" -#include "cpp/sleep.h" -#include "cpp/queue.h" -#include "c/timer.h" -#else -#include "c/task.h" -#include "c/mutex.h" -#include "c/condition_variable.h" -#include "c/sleep.h" -#include "c/queue.h" -#include "c/timer.h" -#endif -#endif -- Gitee From f41b68ef57d53756bf343f7dd9ce88ad2822b9e0 Mon Sep 17 00:00:00 2001 From: leafly2021 Date: Fri, 22 Nov 2024 17:51:58 +0800 Subject: [PATCH 460/620] =?UTF-8?q?=E6=96=B0=E6=8E=A5=E5=8F=A3=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: leafly2021 --- graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json | 1 + 1 file changed, 1 insertion(+) diff --git a/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json b/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json index 28ff64c27..5362d474e 100644 --- a/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json +++ b/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json @@ -4,6 +4,7 @@ { "name": "OH_NativeVSync_RequestFrame" }, { "name": "OH_NativeVSync_RequestFrameWithMultiCallback" }, { "name": "OH_NativeVSync_GetPeriod" }, + { "name": "OH_NativeVSync_Create_ForAssociatedWindow" }, { "first_introduced": "14", "name": "OH_NativeVSync_DVSyncSwitch" -- Gitee From 25b0388abcef2cc934cd2d8b0c2254c8b2ac9b83 Mon Sep 17 00:00:00 2001 From: l00844999 Date: Fri, 22 Nov 2024 17:59:02 +0800 Subject: [PATCH 461/620] drawing fix Signed-off-by: l00844999 --- .../graphic_2d/native_drawing/drawing_image.h | 2 +- .../native_drawing/drawing_memory_stream.h | 2 +- .../native_drawing/drawing_path_effect.h | 2 +- .../native_drawing/drawing_sampling_options.h | 2 +- .../graphic_2d/native_drawing/drawing_types.h | 8 ++++---- .../native_drawing/libnative_drawing.ndk.json | 20 +++++++++---------- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_image.h b/graphic/graphic_2d/native_drawing/drawing_image.h index f4c9fed10..ed2d09789 100644 --- a/graphic/graphic_2d/native_drawing/drawing_image.h +++ b/graphic/graphic_2d/native_drawing/drawing_image.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/graphic/graphic_2d/native_drawing/drawing_memory_stream.h b/graphic/graphic_2d/native_drawing/drawing_memory_stream.h index 3188d3be9..c131dc6b2 100644 --- a/graphic/graphic_2d/native_drawing/drawing_memory_stream.h +++ b/graphic/graphic_2d/native_drawing/drawing_memory_stream.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/graphic/graphic_2d/native_drawing/drawing_path_effect.h b/graphic/graphic_2d/native_drawing/drawing_path_effect.h index 7e3bd8e16..7576c2500 100644 --- a/graphic/graphic_2d/native_drawing/drawing_path_effect.h +++ b/graphic/graphic_2d/native_drawing/drawing_path_effect.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/graphic/graphic_2d/native_drawing/drawing_sampling_options.h b/graphic/graphic_2d/native_drawing/drawing_sampling_options.h index ee55c81b1..12a90a087 100644 --- a/graphic/graphic_2d/native_drawing/drawing_sampling_options.h +++ b/graphic/graphic_2d/native_drawing/drawing_sampling_options.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h index 3827d52ea..c1bfda620 100644 --- a/graphic/graphic_2d/native_drawing/drawing_types.h +++ b/graphic/graphic_2d/native_drawing/drawing_types.h @@ -106,20 +106,20 @@ typedef struct OH_Drawing_Bitmap OH_Drawing_Bitmap; typedef struct OH_Drawing_Point OH_Drawing_Point; /** - * @brief Define color space to determine color information. + * @brief Defines a pixelmap, which is used to wrap real pixelmap supported by image framework. * * @since 12 * @version 1.0 */ -typedef struct OH_Drawing_ColorSpace OH_Drawing_ColorSpace; +typedef struct OH_Drawing_PixelMap OH_Drawing_PixelMap; /** - * @brief Defines a pixelmap, which is used to wrap real pixelmap supported by image framework. + * @brief Define color space to determine color information. * * @since 12 * @version 1.0 */ -typedef struct OH_Drawing_PixelMap OH_Drawing_PixelMap; +typedef struct OH_Drawing_ColorSpace OH_Drawing_ColorSpace; /** * @brief Defines a point of 2d. diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 353ce3f53..20b31b7a1 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -122,13 +122,10 @@ "first_introduced": "12", "name": "OH_Drawing_CanvasSkew" }, - { "name": "OH_Drawing_CanvasSetMatrix" }, { "first_introduced": "12", "name": "OH_Drawing_CanvasResetMatrix" }, - { "name": "OH_Drawing_CanvasReadPixels" }, - { "name": "OH_Drawing_CanvasReadPixelsToBitmap" }, { "name": "OH_Drawing_CanvasGetWidth" }, { "name": "OH_Drawing_CanvasGetHeight" }, { "name": "OH_Drawing_CanvasGetLocalClipBounds" }, @@ -139,6 +136,9 @@ "name": "OH_Drawing_MatrixGetAll" }, { "name": "OH_Drawing_CanvasDrawShadow" }, + { "name": "OH_Drawing_CanvasSetMatrix" }, + { "name": "OH_Drawing_CanvasReadPixels" }, + { "name": "OH_Drawing_CanvasReadPixelsToBitmap" }, { "first_introduced": "12", "name": "OH_Drawing_CanvasIsClipEmpty" @@ -284,8 +284,8 @@ { "name": "OH_Drawing_FontCountText" }, { "name": "OH_Drawing_FontSetTextSkewX" }, { "name": "OH_Drawing_FontSetTypeface" }, - { "name": "OH_Drawing_FontGetMetrics" }, { "name": "OH_Drawing_FontGetTypeface" }, + { "name": "OH_Drawing_FontGetMetrics" }, { "first_introduced": "12", "name": "OH_Drawing_GpuContextCreateFromGL" @@ -752,6 +752,12 @@ { "name": "OH_Drawing_ImageBuildFromBitmap" }, { "name": "OH_Drawing_ImageGetWidth" }, { "name": "OH_Drawing_ImageGetHeight" }, + { + "first_introduced": "12", + "name": "OH_Drawing_ImageGetImageInfo" + }, + { "name": "OH_Drawing_SamplingOptionsCreate" }, + { "name": "OH_Drawing_SamplingOptionsDestroy" }, { "first_introduced": "12", "name": "OH_Drawing_TextStyleGetShadowWithIndex" @@ -788,12 +794,6 @@ "first_introduced": "12", "name": "OH_Drawing_TypographySetIndents" }, - { - "first_introduced": "12", - "name": "OH_Drawing_ImageGetImageInfo" - }, - { "name": "OH_Drawing_SamplingOptionsCreate" }, - { "name": "OH_Drawing_SamplingOptionsDestroy" }, { "first_introduced": "11", "name": "OH_Drawing_TypographyHandlerAddPlaceholder" -- Gitee From 162ca79e8881214aa16dd91d278590845433b4e3 Mon Sep 17 00:00:00 2001 From: bluhuang Date: Mon, 25 Nov 2024 15:40:38 +0800 Subject: [PATCH 462/620] fix preferences ndk warning Signed-off-by: bluhuang --- .../preferences/include/oh_preferences_err_code.h | 2 +- distributeddatamgr/preferences/include/oh_preferences_option.h | 1 + distributeddatamgr/preferences/include/oh_preferences_value.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/distributeddatamgr/preferences/include/oh_preferences_err_code.h b/distributeddatamgr/preferences/include/oh_preferences_err_code.h index 5b77219b9..90a2c6818 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_err_code.h +++ b/distributeddatamgr/preferences/include/oh_preferences_err_code.h @@ -73,5 +73,5 @@ typedef enum OH_Preferences_ErrCode { #ifdef __cplusplus }; #endif - +/** @} */ #endif // OH_PREFERENCES_ERR_CODE_H diff --git a/distributeddatamgr/preferences/include/oh_preferences_option.h b/distributeddatamgr/preferences/include/oh_preferences_option.h index a8a25af9f..80ae78809 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_option.h +++ b/distributeddatamgr/preferences/include/oh_preferences_option.h @@ -115,4 +115,5 @@ int OH_PreferencesOption_Destroy(OH_PreferencesOption *option); #ifdef __cplusplus }; #endif +/** @} */ #endif // OH_PREFERENCES_OPTION_H \ No newline at end of file diff --git a/distributeddatamgr/preferences/include/oh_preferences_value.h b/distributeddatamgr/preferences/include/oh_preferences_value.h index 945e28fc6..5be471f18 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_value.h +++ b/distributeddatamgr/preferences/include/oh_preferences_value.h @@ -172,4 +172,5 @@ int OH_PreferencesValue_GetString(const OH_PreferencesValue *object, char **valu #ifdef __cplusplus }; #endif +/** @} */ #endif // OH_PREFERENCES_VALUE_H \ No newline at end of file -- Gitee From 08622c8c8601c1aceec18d1921e41c2fb834aa51 Mon Sep 17 00:00:00 2001 From: houguobiao Date: Mon, 25 Nov 2024 22:56:54 +0800 Subject: [PATCH 463/620] =?UTF-8?q?CalendarPicker=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AE=E6=9C=80=E5=A4=A7=E6=9C=80?= =?UTF-8?q?=E5=B0=8F=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: houguobiao Change-Id: I48903638e7fc1344018abb2bdaa75ed26e3629d5 --- arkui/ace_engine/native/native_node.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index f83f1a181..079513926 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -3891,6 +3891,32 @@ typedef enum { * */ NODE_CALENDAR_PICKER_TEXT_STYLE, + /** + * @brief Defines the start date of the calendar picker. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .string: date. The value like "1970-1-1". \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .string: date. \n + * + * @since 16 + */ + NODE_CALENDAR_PICKER_START = 16004, + /** + * @brief Defines the end date of the calendar picker. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .string: date. The value like "2100-12-31". \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .string: date. \n + * + * @since 16 + */ + NODE_CALENDAR_PICKER_END = 16005, /** * @brief Defines the color of the slider. This attribute can be set, reset, and obtained as required through APIs. * -- Gitee From e091a59fac70ee4fcd5b1b3cda64c45a91cdbfd3 Mon Sep 17 00:00:00 2001 From: shilong Date: Tue, 26 Nov 2024 02:53:43 +0000 Subject: [PATCH 464/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9sdk=E7=9A=84=E4=BA=A7?= =?UTF-8?q?=E5=87=BA=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- drivers/external_device_manager/base/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/external_device_manager/base/BUILD.gn b/drivers/external_device_manager/base/BUILD.gn index f02cd7542..48407c555 100644 --- a/drivers/external_device_manager/base/BUILD.gn +++ b/drivers/external_device_manager/base/BUILD.gn @@ -14,7 +14,7 @@ import("//build/ohos.gni") ohos_ndk_headers("ddk_header") { - dest_dir = "$ndk_headers_out_dir/ddk/" + dest_dir = "$ndk_headers_out_dir/base/" sources = [ "ddk_api.h", "ddk_types.h", -- Gitee From b3bc677bdd1c9766b8c8c3914ed18b2dacfeade7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=91=E5=B1=91=E5=B1=91?= Date: Tue, 26 Nov 2024 11:53:40 +0800 Subject: [PATCH 465/620] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 屑屑屑 --- .../include/image/pixelmap_native.h | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index b897e2a12..c7ea3eb57 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -858,21 +858,6 @@ Image_ErrorCode OH_PixelmapNative_SetMetadata(OH_PixelmapNative *pixelmap, OH_Pi */ Image_ErrorCode OH_PixelmapNative_GetNativeBuffer(OH_PixelmapNative *pixelmap, OH_NativeBuffer **nativeBuffer); -/** - * @brief Set pixelmap memory name. - * - * @param pixelmap The Pixelmap pointer to be operated. - * @param name The pointer of name that needs to be set. - * @param size The size of name size that needs to be set. - * @return Function result code: - * {@link IMAGE_SUCCESS} If the operation is successful. - * {@link IMAGE_BAD_PARAMETER} If invalid parameter, name and size are incorrect. - * {@link IMAGE_UNSUPPORTED_MEMORY_FORMAT} If memory format is unsupported. - * @see OH_PixelmapNative - * @since 13 - */ -Image_ErrorCode OH_PixelmapNative_SetMemoryName(OH_PixelmapNative *pixelmap, char *name, size_t *size); - /** * @brief Get the native colorspace from the PixelMap. * @@ -901,6 +886,21 @@ Image_ErrorCode OH_PixelmapNative_GetColorSpaceNative(OH_PixelmapNative *pixelma Image_ErrorCode OH_PixelmapNative_SetColorSpaceNative(OH_PixelmapNative *pixelmap, OH_NativeColorSpaceManager *colorSpaceNative); +/** + * @brief Set pixelmap memory name. + * + * @param pixelmap The Pixelmap pointer to be operated. + * @param name The pointer of name that needs to be set. + * @param size The size of name size that needs to be set. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the operation is successful. + * {@link IMAGE_BAD_PARAMETER} If invalid parameter, name and size are incorrect. + * {@link IMAGE_UNSUPPORTED_MEMORY_FORMAT} If memory format is unsupported. + * @see OH_PixelmapNative + * @since 13 + */ +Image_ErrorCode OH_PixelmapNative_SetMemoryName(OH_PixelmapNative *pixelmap, char *name, size_t *size); + #ifdef __cplusplus }; #endif -- Gitee From bff4625f23dd15bc7a5358bb9e85a5c8205c51bc Mon Sep 17 00:00:00 2001 From: linchengfeng Date: Tue, 26 Nov 2024 19:30:07 +0800 Subject: [PATCH 466/620] add OH_CaptureSession_SetQualityPrioritization interface Signed-off-by: linchengfeng --- multimedia/camera_framework/camera.h | 18 ++++++++++++++++++ multimedia/camera_framework/camera.ndk.json | 4 ++++ multimedia/camera_framework/capture_session.h | 13 +++++++++++++ 3 files changed, 35 insertions(+) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 1a907e0f7..14bf57d0e 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -1060,6 +1060,24 @@ Camera_ErrorCode OH_Camera_GetCameraManager(Camera_Manager** cameraManager); */ Camera_ErrorCode OH_Camera_DeleteCameraManager(Camera_Manager* cameraManager); +/** + * @brief Enum for quality prioritization. + * + * @since 14 + * @version 1.0 + */ +typedef enum Camera_QualityPrioritization { + /** + * Hight quality priority. + */ + HIGH_QUALITY = 0, + + /** + * Power balance priority. + */ + POWER_BALANCE = 1 +} Camera_QualityPrioritization; + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index dd8d98bbc..1be252eaa 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -630,5 +630,9 @@ { "first_introduced": "13", "name": "OH_CaptureSession_EnableAutoDeviceSwitch" + }, + { + "first_introduced": "14", + "name": "OH_CaptureSession_SetQualityPrioritization" } ] diff --git a/multimedia/camera_framework/capture_session.h b/multimedia/camera_framework/capture_session.h index 54786c5d9..e1a5bf243 100644 --- a/multimedia/camera_framework/capture_session.h +++ b/multimedia/camera_framework/capture_session.h @@ -916,6 +916,19 @@ Camera_ErrorCode OH_CaptureSession_IsAutoDeviceSwitchSupported(Camera_CaptureSes */ Camera_ErrorCode OH_CaptureSession_EnableAutoDeviceSwitch(Camera_CaptureSession* session, bool enabled); +/** + * @brief Set quality prioritization. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param qualityPrioritization the target {@link Camera_QualityPrioritization} to set. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. + * @since 14 + */ +Camera_ErrorCode OH_CaptureSession_SetQualityPrioritization( + Camera_CaptureSession* session, Camera_QualityPrioritization qualityPrioritization); + #ifdef __cplusplus } #endif -- Gitee From 667dc7701b73b456838aadb0f70cf36f294a0cf2 Mon Sep 17 00:00:00 2001 From: hongzexuan Date: Tue, 26 Nov 2024 21:09:05 +0800 Subject: [PATCH 467/620] fix node_scroll_size Signed-off-by: hongzexuan Change-Id: Ic41a40d2c73a24e085dc3f370e67533181f7c9f5 --- arkui/ace_engine/native/native_node.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index f83f1a181..0058332d4 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -4534,6 +4534,9 @@ typedef enum { * The default unit is vp. \n * .value[1].f32: total height of all child components when fully expanded in the scrollable component. * The default unit is vp. \n + * When NODE_PADDING, NODE_MARGIN, or NODE_BORDER_WIDTH is set, the values are rounded to the + * nearest pixel when being converted from vp to px. + * The returned values are calculated based on these rounded pixel values. \n * * @since 14 */ -- Gitee From 78e31c654a55ed9f577792c7b4eb7abb154d0243 Mon Sep 17 00:00:00 2001 From: "xuqinfeng1@huawei.com" Date: Tue, 26 Nov 2024 21:49:24 +0800 Subject: [PATCH 468/620] =?UTF-8?q?drawable=E7=9A=84=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuqinfeng1@huawei.com Change-Id: I95d8891ec8b1497635a7541611ae6065773db9d9 --- arkui/ace_engine/native/drawable_descriptor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/drawable_descriptor.h b/arkui/ace_engine/native/drawable_descriptor.h index 76b2f1723..ba221641f 100644 --- a/arkui/ace_engine/native/drawable_descriptor.h +++ b/arkui/ace_engine/native/drawable_descriptor.h @@ -142,7 +142,7 @@ int32_t OH_ArkUI_DrawableDescriptor_GetAnimationDuration(ArkUI_DrawableDescripto * @brief Sets the number of playback times. * * @param drawableDescriptor Indicates the pointer to the drawableDescriptor. - * @param iterations Indicates the number of playback times. + * @param iteration Indicates the number of playback times. * @since 12 */ void OH_ArkUI_DrawableDescriptor_SetAnimationIteration( -- Gitee From 6a77f3e8891eb315966aebee1401dcb81208227e Mon Sep 17 00:00:00 2001 From: wangxiuxiu Date: Mon, 25 Nov 2024 12:52:05 +0800 Subject: [PATCH 469/620] keyEvent Signed-off-by: wangxiuxiu --- arkui/ace_engine/native/ui_input_event.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arkui/ace_engine/native/ui_input_event.h b/arkui/ace_engine/native/ui_input_event.h index 9b5aa63fb..85a377f12 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -731,14 +731,17 @@ int32_t OH_ArkUI_UIInputEvent_GetDeviceId(const ArkUI_UIInputEvent* event); * is not supported. * * @param event Pointer to an ArkUI_UIInputEvent object. - * @param pressedKeyCodes Indicates the list of the Modifier keys.You need to create a int array first. - * @param length Indicates the total length of the list array. + * @param pressedKeyCodes Array of all keys that are pressed. You need to allocate the memory space. + * @param length Length of the passed pressedKeyCodes array (when used as an input parameter); + * number of the keys pressed (when used as an output parameter). * @return Returns the result code. * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. * Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} if the giving buffer is not enough. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. * @since 14 */ -int32_t OH_ArkUI_UIInputEvent_GetPressedKeys(const ArkUI_UIInputEvent* event, int32_t* pressedKeyCodes, int32_t length); +int32_t OH_ArkUI_UIInputEvent_GetPressedKeys( + const ArkUI_UIInputEvent* event, int32_t* pressedKeyCodes, int32_t* length); #ifdef __cplusplus }; -- Gitee From e81ec4be55dd335c6a5c132eecdcad331b196231 Mon Sep 17 00:00:00 2001 From: happy Date: Wed, 27 Nov 2024 20:02:45 +0800 Subject: [PATCH 470/620] =?UTF-8?q?api=20Lint=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: happy Change-Id: I2eebe7fe93e9e64ce2e2249ccfc8f29c7edb71c7 --- arkui/ace_engine/native/native_node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index f83f1a181..c1f1aece8 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -7951,4 +7951,4 @@ float OH_ArkUI_SystemFontStyleEvent_GetFontWeightScale(const ArkUI_SystemFontSty #endif #endif // ARKUI_NATIVE_NODE_H -/** @}*/ +/** @} */ -- Gitee From 9c505c221ea2cbc525f9afabb5a23c2d1fbc0dc5 Mon Sep 17 00:00:00 2001 From: ji_xinliu Date: Wed, 27 Nov 2024 11:41:07 +0800 Subject: [PATCH 471/620] Lint Alarm fix Signed-off-by: ji_xinliu --- web/webview/interfaces/native/arkweb_error_code.h | 1 + web/webview/interfaces/native/arkweb_interface.h | 3 ++- web/webview/interfaces/native/arkweb_net_error_list.h | 1 + web/webview/interfaces/native/arkweb_scheme_handler.h | 3 ++- web/webview/interfaces/native/arkweb_type.h | 3 ++- web/webview/interfaces/native/native_interface_arkweb.h | 3 ++- 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/web/webview/interfaces/native/arkweb_error_code.h b/web/webview/interfaces/native/arkweb_error_code.h index a445de2c7..64db3082c 100644 --- a/web/webview/interfaces/native/arkweb_error_code.h +++ b/web/webview/interfaces/native/arkweb_error_code.h @@ -56,3 +56,4 @@ ARKWEB_INVALID_COOKIE_VALUE = 17100104, } ArkWeb_ErrorCode; #endif // ARKWEB_ERROR_CODE_H +/** @} */ diff --git a/web/webview/interfaces/native/arkweb_interface.h b/web/webview/interfaces/native/arkweb_interface.h index f204dab32..03f9f612b 100644 --- a/web/webview/interfaces/native/arkweb_interface.h +++ b/web/webview/interfaces/native/arkweb_interface.h @@ -87,4 +87,5 @@ ArkWeb_AnyNativeAPI* OH_ArkWeb_GetNativeAPI(ArkWeb_NativeAPIVariantKind type); #ifdef __cplusplus }; #endif -#endif // ARKWEB_INTERFACE_H \ No newline at end of file +#endif // ARKWEB_INTERFACE_H +/** @} */ \ No newline at end of file diff --git a/web/webview/interfaces/native/arkweb_net_error_list.h b/web/webview/interfaces/native/arkweb_net_error_list.h index 4a579c45e..feabf1440 100644 --- a/web/webview/interfaces/native/arkweb_net_error_list.h +++ b/web/webview/interfaces/native/arkweb_net_error_list.h @@ -1402,3 +1402,4 @@ typedef enum ArkWeb_NetError { } ArkWeb_NetError; #endif // ARKWEB_NET_ERROR_LIST_H +/** @} */ diff --git a/web/webview/interfaces/native/arkweb_scheme_handler.h b/web/webview/interfaces/native/arkweb_scheme_handler.h index 4ab4b8b94..d88272e7e 100644 --- a/web/webview/interfaces/native/arkweb_scheme_handler.h +++ b/web/webview/interfaces/native/arkweb_scheme_handler.h @@ -672,7 +672,7 @@ void OH_ArkWeb_CreateSchemeHandler(ArkWeb_SchemeHandler** schemeHandler); /** * @brief Destroy a SchemeHandler. - * @param The ArkWeb_SchemeHandler to be destroy. + * @param schemeHandler The ArkWeb_SchemeHandler to be destroy. * * @syscap SystemCapability.Web.Webview.Core * @since 12 @@ -995,3 +995,4 @@ void OH_ArkWeb_ReleaseByteArray(uint8_t* byteArray); }; #endif #endif // ARKWEB_SCHEME_HANDLER_H +/** @} */ diff --git a/web/webview/interfaces/native/arkweb_type.h b/web/webview/interfaces/native/arkweb_type.h index e6738810a..206d6b5d1 100644 --- a/web/webview/interfaces/native/arkweb_type.h +++ b/web/webview/interfaces/native/arkweb_type.h @@ -538,4 +538,5 @@ typedef struct { #ifdef __cplusplus } #endif -#endif // ARKWEB_TYPE_H \ No newline at end of file +#endif // ARKWEB_TYPE_H +/** @} */ \ No newline at end of file diff --git a/web/webview/interfaces/native/native_interface_arkweb.h b/web/webview/interfaces/native/native_interface_arkweb.h index 48c114fce..96b779bf4 100644 --- a/web/webview/interfaces/native/native_interface_arkweb.h +++ b/web/webview/interfaces/native/native_interface_arkweb.h @@ -156,4 +156,5 @@ NativeArkWeb_OnDestroyCallback OH_NativeArkWeb_GetDestroyCallback(const char* we #ifdef __cplusplus }; #endif -#endif // NATIVE_INTERFACE_ARKWEB_H \ No newline at end of file +#endif // NATIVE_INTERFACE_ARKWEB_H +/** @} */ \ No newline at end of file -- Gitee From c6b91438ef92cb7842f96321d6e18f5c2957c499 Mon Sep 17 00:00:00 2001 From: shilong Date: Thu, 28 Nov 2024 09:08:12 +0000 Subject: [PATCH 472/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9ndk.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- drivers/external_device_manager/base/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/external_device_manager/base/BUILD.gn b/drivers/external_device_manager/base/BUILD.gn index 48407c555..f02cd7542 100644 --- a/drivers/external_device_manager/base/BUILD.gn +++ b/drivers/external_device_manager/base/BUILD.gn @@ -14,7 +14,7 @@ import("//build/ohos.gni") ohos_ndk_headers("ddk_header") { - dest_dir = "$ndk_headers_out_dir/base/" + dest_dir = "$ndk_headers_out_dir/ddk/" sources = [ "ddk_api.h", "ddk_types.h", -- Gitee From 027fa38b64aeb54ecf719a5a0746f8ec99b088a8 Mon Sep 17 00:00:00 2001 From: shilong Date: Thu, 28 Nov 2024 09:08:41 +0000 Subject: [PATCH 473/620] =?UTF-8?q?=E6=96=B0=E5=A2=9Endk.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- drivers/external_device_manager/usb/libusb.ndk.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/external_device_manager/usb/libusb.ndk.json b/drivers/external_device_manager/usb/libusb.ndk.json index d3ad5dbd3..eb677bfee 100644 --- a/drivers/external_device_manager/usb/libusb.ndk.json +++ b/drivers/external_device_manager/usb/libusb.ndk.json @@ -5,6 +5,9 @@ { "name": "OH_Usb_Release" }, + { + "name": "OH_Usb_ReleaseResource" + }, { "name": "OH_Usb_GetDeviceDescriptor" }, -- Gitee From 67570a933b3a13952503a7e9e12c83bb01412cab Mon Sep 17 00:00:00 2001 From: xukun_cai <401117262@qq.com> Date: Thu, 28 Nov 2024 12:00:34 +0000 Subject: [PATCH 474/620] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=BC=96=E8=AF=91sdk=E4=BA=A7=E7=89=A9=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xukun_cai <401117262@qq.com> --- ndk_targets.gni | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ndk_targets.gni b/ndk_targets.gni index a97312222..3a6755a88 100644 --- a/ndk_targets.gni +++ b/ndk_targets.gni @@ -294,21 +294,21 @@ _parse_args += _ndk_targets_list all_ndk_targets_list = exec_script(_parse_script, _parse_args, "list lines") -if (ndk_platform == "win") { +if (build_windows_ndk_target) { all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:windows_x86_64" ] -} else if (ndk_platform == "mac") { - if (host_cpu == "arm64") { - all_ndk_targets_list += +} if (build_mac_ndk_target) { + if (host_cpu == "arm64") { + all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:darwin_arm64" ] - } else { - all_ndk_targets_list += + } else { + all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:darwin_x86_64" ] } -} else if (ndk_platform == "linux") { +} if (build_linux_ndk_target) { all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:linux_x86_64" ] -} else if (ndk_platform == "ohos") { +} if (build_ohos_ndk_target) { all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:ohos_arm64" ] } else if (ndk_platform == "default") { -- Gitee From b014775b8d2132fca84923b52a85f7dce3dd59c8 Mon Sep 17 00:00:00 2001 From: xukun_cai <401117262@qq.com> Date: Fri, 29 Nov 2024 10:59:48 +0800 Subject: [PATCH 475/620] gn check Signed-off-by: xukun_cai <401117262@qq.com> --- ndk_targets.gni | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/ndk_targets.gni b/ndk_targets.gni index 3a6755a88..fa07e23a9 100644 --- a/ndk_targets.gni +++ b/ndk_targets.gni @@ -297,18 +297,21 @@ all_ndk_targets_list = exec_script(_parse_script, _parse_args, "list lines") if (build_windows_ndk_target) { all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:windows_x86_64" ] -} if (build_mac_ndk_target) { - if (host_cpu == "arm64") { - all_ndk_targets_list += +} +if (build_mac_ndk_target) { + if (host_cpu == "arm64") { + all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:darwin_arm64" ] - } else { - all_ndk_targets_list += + } else { + all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:darwin_x86_64" ] } -} if (build_linux_ndk_target) { +} +if (build_linux_ndk_target) { all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:linux_x86_64" ] -} if (build_ohos_ndk_target) { +} +if (build_ohos_ndk_target) { all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:ohos_arm64" ] } else if (ndk_platform == "default") { -- Gitee From 8d1aafdb3739509cfa760c179bb3809c7c46cf1f Mon Sep 17 00:00:00 2001 From: liuzerun Date: Fri, 29 Nov 2024 11:26:14 +0800 Subject: [PATCH 476/620] fix Signed-off-by: liuzerun --- filemanagement/environment/include/oh_environment.h | 2 ++ filemanagement/fileio/include/error_code.h | 3 ++- filemanagement/fileio/include/oh_fileio.h | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/filemanagement/environment/include/oh_environment.h b/filemanagement/environment/include/oh_environment.h index 71d1e8495..299e1272b 100644 --- a/filemanagement/environment/include/oh_environment.h +++ b/filemanagement/environment/include/oh_environment.h @@ -15,6 +15,7 @@ /** * @addtogroup Environment + * @{ * * @brief This module provides the ability to access the environment directory and obtain the native interface for public root directory. @@ -80,3 +81,4 @@ FileManagement_ErrCode OH_Environment_GetUserDocumentDir(char **result); #endif #endif //FILE_MANAGEMENT_ENVIRONMENT_OH_ENVIRONMENT_H +/** @} */ diff --git a/filemanagement/fileio/include/error_code.h b/filemanagement/fileio/include/error_code.h index 2fb9847fe..08b32f3a1 100644 --- a/filemanagement/fileio/include/error_code.h +++ b/filemanagement/fileio/include/error_code.h @@ -24,7 +24,7 @@ /** * @file error_code.h * @kit CoreFileKit - * + * @library NA * @brief Declare the error codes of file management module. * @syscap SystemCapability.FileManagement.File.FileIO * @since 12 @@ -81,3 +81,4 @@ typedef enum FileManagement_ErrCode { #endif #endif // FILE_MANAGEMENT_FILEIO_ERROR_CODE_H +/** @} */ diff --git a/filemanagement/fileio/include/oh_fileio.h b/filemanagement/fileio/include/oh_fileio.h index 5fa1677da..b318d4f84 100644 --- a/filemanagement/fileio/include/oh_fileio.h +++ b/filemanagement/fileio/include/oh_fileio.h @@ -15,6 +15,7 @@ /** * @addtogroup FileIO + * @{ * * @brief This module provides the basic file operations. * @since 12 @@ -78,3 +79,4 @@ FileManagement_ErrCode OH_FileIO_GetFileLocation(char *uri, int uriLength, #endif #endif //FILE_MANAGEMENT_FILEIO_OH_FILEIO_H +/** @} */ -- Gitee From b45bba7c4b402409bfb4dd26e78ec01b68225518 Mon Sep 17 00:00:00 2001 From: shilei Date: Fri, 29 Nov 2024 14:37:09 +0800 Subject: [PATCH 477/620] modify napi interface notation Signed-off-by: shilei Change-Id: I1c85ab512d0aa46391b84afee7361bda6d98136f --- arkui/napi/native_api.h | 439 +++++++++++++++++++++++++++++++++------- 1 file changed, 369 insertions(+), 70 deletions(-) diff --git a/arkui/napi/native_api.h b/arkui/napi/native_api.h index a45ce8476..d140aa622 100644 --- a/arkui/napi/native_api.h +++ b/arkui/napi/native_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,33 +15,53 @@ #ifndef FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H #define FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H +/** + * @addtogroup ArkTS_Napi_NativeModule + * @{ + * + * + * @brief Provides native api of ArkTS native module. + * + * @since 10 + */ + +/** + * @file native_api.h + * + * @brief Defines native api of ArkTS native module. + * + * @kit ArkTS + * @library libace_napi.z.so + * @syscap SystemCapability.ArkUI.ArkUI.Napi + * @since 10 + * @version 1.0 + */ #ifndef NAPI_VERSION #define NAPI_VERSION 8 -#endif +#endif // NAPI_VERSION #ifndef NAPI_EXPERIMENTAL #define NAPI_EXPERIMENTAL -#endif +#endif // NAPI_EXPERIMENTAL #include "common.h" #include "node_api.h" #ifdef NAPI_TEST -#ifdef _WIN32 +#ifdef _WIN32 // WIN32 #define NAPI_INNER_EXTERN __declspec(dllexport) -#else +#else // NON-WIN32 #define NAPI_INNER_EXTERN __attribute__((visibility("default"))) -#endif -#else +#endif // _WIN32 + +#else // NAPI_TEST #ifdef _WIN32 #define NAPI_INNER_EXTERN __declspec(deprecated) #else #define NAPI_INNER_EXTERN __attribute__((__deprecated__)) +#endif // __WIN32 #endif -#endif - -NAPI_EXTERN napi_status napi_fatal_exception(napi_env env, napi_value err); NAPI_EXTERN napi_status napi_create_string_utf16(napi_env env, const char16_t* str, @@ -67,7 +87,6 @@ NAPI_INNER_EXTERN napi_status napi_adjust_external_memory(napi_env env, int64_t change_in_bytes, int64_t* adjusted_value); - #ifdef __cplusplus extern "C" { #endif @@ -79,6 +98,7 @@ extern "C" { * @since 11 */ typedef void* (*napi_native_binding_detach_callback)(napi_env env, void* native_object, void* hint); + /** * @brief Native attach callback of napi_coerce_to_native_binding_object that can be used to * bind the js object and the native object. @@ -89,68 +109,216 @@ typedef napi_value (*napi_native_binding_attach_callback)(napi_env env, void* na NAPI_EXTERN napi_status napi_run_script_path(napi_env env, const char* path, napi_value* result); NAPI_EXTERN napi_status napi_queue_async_work_with_qos(napi_env env, napi_async_work work, napi_qos_t qos); -NAPI_EXTERN napi_status napi_load_module(napi_env env, const char* path, napi_value* result); /** - * @brief The module is loaded through the NAPI. By default, the default object is exported from the module. + * @brief Loads an .abc file as a module. This API returns the namespace of the module. + * @param env Current running virtual machine context. + * @param path Path of the .abc file or name of the module to load. + * @param result Result of the module object. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_load_module(napi_env env, + const char* path, + napi_value* result); + +/** + * @brief Associates data with the currently running environment. * * @param env Current running virtual machine context. - * @param path Path name of the module to be loaded, like @ohos.hilog. - * @param module_info Path names of bundle and module, like com.example.application/entry. - * @param result Result of loading a module, which is an exported object of the module. + * @param data Data item to bind with the 'env'. + * @param finalize_cb Optional native callback that will be triggered when 'env' is destroyed or this interface repeatedly calls. + * @param finalize_hint Optional contextual hint that is passed to the finalize callback. + * * @return Returns the function execution status. - * @since 12 -*/ -NAPI_EXTERN napi_status napi_load_module_with_info(napi_env env, - const char* path, - const char* module_info, - napi_value* result); -NAPI_EXTERN napi_status napi_get_instance_data(napi_env env, void** data); + * @since 11 + */ NAPI_EXTERN napi_status napi_set_instance_data(napi_env env, void* data, napi_finalize finalize_cb, void* finalize_hint); -NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(napi_env env, void (*fun)(void* arg), void* arg); -NAPI_EXTERN napi_status napi_add_env_cleanup_hook(napi_env env, void (*fun)(void* arg), void* arg); -NAPI_EXTERN napi_status napi_remove_async_cleanup_hook(napi_async_cleanup_hook_handle remove_handle); + +/** + * @brief Retrieves the data that was previously associated with the currently running environment. + * + * @param env Current running virtual machine context. + * @param data Data item is bound with the 'env'. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_get_instance_data(napi_env env, + void** data); + +/** + * @brief Registers a clean-up hook for releasing resources when the environment exits. + * + * @param env Current running virtual machine context. + * @param fun Function pointer which will be triggered when environment is destroy. + * @param arg The argument is passed to the function pointer 'fun'. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_add_env_cleanup_hook(napi_env env, + void (*fun)(void* arg), + void* arg); + +/** + * @brief Unregisters the clean-up hook. + * + * @param env Current running virtual machine context. + * @param fun Function pointer which will be triggered when environment is destroy. + * @param arg The argument is passed to the function pointer 'fun'. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(napi_env env, + void (*fun)(void* arg), + void* arg); + +/** + * @brief Registers an asynchronous clean-up hook for releasing resources when the environment exits. + * + * @param env Current running virtual machine context. + * @param hook The function pointer to call at environment teardown. + * @param arg The pointer to pass to `hook` when it gets called. + * @param remove_handle Optional handle that refers to the asynchronous cleanup. + * + * @return Returns the function execution status. + * @since 11 + */ NAPI_EXTERN napi_status napi_add_async_cleanup_hook(napi_env env, napi_async_cleanup_hook hook, void* arg, napi_async_cleanup_hook_handle* remove_handle); -NAPI_EXTERN napi_status napi_async_destroy(napi_env env, - napi_async_context async_context); + +/** + * @brief Unregisters the asynchronous clean-up hook. + * + * @param remove_handle Optional handle that refers to the asynchronous cleanup. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_remove_async_cleanup_hook(napi_async_cleanup_hook_handle remove_handle); + +/** + * @brief Creates an asynchronous context. The capabilities related to 'async_hook' are not supported currently. + * + * @param env Current running virtual machine context. + * @param async_resource Object associated with the async work that will be passed to possible 'async_hook'. + * @param async_resource_name Identifier for the kind of resource that is being provided for diagnostic information + * exposed by the async_hooks API. + * @param result The initialized async context. + * + * @return Returns the function execution status. + * @since 11 + */ NAPI_EXTERN napi_status napi_async_init(napi_env env, napi_value async_resource, napi_value async_resource_name, napi_async_context* result); -NAPI_EXTERN napi_status napi_close_callback_scope(napi_env env, napi_callback_scope scope); + +/** + * @brief Destroys the previously created asynchronous context. The capabilities related to 'async_hook' are not supported currently. + * + * @param env Current running virtual machine context. + * @param async_context The async context to be destroyed. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_async_destroy(napi_env env, + napi_async_context async_context); + +/** + * @brief Opens a callback scope. The capabilities related to 'async_hook' are not supported currently. + * @param env Current running virtual machine context. + * @param resource_object The resource object to be passed to possible 'async_hook'. + * @param context The context environment for the async operation. + * @param result The generated callback scope. + * + * @return Returns the function execution status. + * @since 11 + */ NAPI_EXTERN napi_status napi_open_callback_scope(napi_env env, napi_value resource_object, napi_async_context context, napi_callback_scope* result); -NAPI_EXTERN napi_status node_api_get_module_file_name(napi_env env, const char** result); -// Create JSObject with initial properties given by descriptors, note that property key must be String, -// and must can not convert to element_index, also all keys must not duplicate. + +/** + * @brief Closes the callback scope. The capabilities related to 'async_hook' are not supported currently. + * + * @param env Current running virtual machine context. + * @param scope The callback scope to be closed. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_close_callback_scope(napi_env env, + napi_callback_scope scope); + +/** + * @brief Obtains the absolute path of the location, from which the addon is loaded. + * + * @param env Current running virtual machine context. + * @param result The absolute path of the location of the loaded addon. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status node_api_get_module_file_name(napi_env env, + const char** result); + +/** + * @brief Create JSObject with initial properties given by descriptors, note that property key must be String, and + * must can not convert to element_index, also all keys must not duplicate. + * + * @param env Current running virtual machine context. + * @param result The created ArkTS object. + * @param property_count Number of the property descriptors. + * @param properties Array of property descriptors which are expected to be applied to the ArkTS object. + * + * @return Returns the function execution status. + * @since 11 + */ NAPI_EXTERN napi_status napi_create_object_with_properties(napi_env env, napi_value* result, size_t property_count, const napi_property_descriptor* properties); -// Create JSObject with initial properties given by keys and values, note that property key must be String, -// and must can not convert to element_index, also all keys must not duplicate. + +/** + * @brief Create JSObject with initial properties given by keys and values, note that property key must be String, and + * must can not convert to element_index, also all keys must not duplicate. + * + * @param env Current running virtual machine context. + * @param result The absolute path of the location of the loaded addon. + * @param property_count Number of the propertied which needs to be applied on the ArkTS object. + * @param keys Array of the keys of the properties. + * @param values Array of the values of the properties. + * + * @return Returns the function execution status. + * @since 11 + */ NAPI_EXTERN napi_status napi_create_object_with_named_properties(napi_env env, napi_value* result, size_t property_count, const char** keys, const napi_value* values); + /** * @brief This API sets native properties to a object and converts this js object to native binding object. * - * @param[in] env Current running virtual machine context. - * @param[in] js_object The JavaScript value to coerce. - * @param[in] detach_cb Native callback that can be used to detach the js object and the native object. - * @param[in] attach_cb Native callback that can be used to bind the js object and the native object. - * @param[in] native_object User-provided native instance to pass to thr detach callback and attach callback. - * @param[in] hint Optional hint to pass to the detach callback and attach callback. + * @param env Current running virtual machine context. + * @param js_object The JavaScript value to coerce. + * @param detach_cb Native callback that can be used to detach the js object and the native object. + * @param attach_cb Native callback that can be used to bind the js object and the native object. + * @param native_object User-provided native instance to pass to thr detach callback and attach callback. + * @param hint Optional hint to pass to the detach callback and attach callback. + * * @return Return the function execution status. * @since 11 */ @@ -160,16 +328,50 @@ NAPI_EXTERN napi_status napi_coerce_to_native_binding_object(napi_env env, napi_native_binding_attach_callback attach_cb, void* native_object, void* hint); + +/** + * @brief Adds a 'napi_finalize' callback, which will be called when the ArkTS object is garbage-collected. + * + * @param env Current running virtual machine context. + * @param js_object The ArkTS object value. + * @param native_object Native object to bind with the ArkTS object. + * @param finalize_cb Native callback that can be used to free the native object when the ArkTS object is + garbage-collected. + * @param finalize_hint Optional contextual hint that is passed to the finalize callback. + * @param result Optional reference of the ArkTS object. + * + * @return Return the function execution status. + * @since 11 + */ NAPI_EXTERN napi_status napi_add_finalizer(napi_env env, napi_value js_object, void* native_object, napi_finalize finalize_cb, void* finalize_hint, napi_ref* result); + +/** + * @brief The module is loaded through the NAPI. By default, the default object is exported from the module. + * + * @param env Current running virtual machine context. + * @param path Path name of the module to be loaded, like @ohos.hilog. + * @param module_info Path names of bundle and module, like com.example.application/entry. + * @param result Result of loading a module, which is an exported object of the module. + * + * @return Returns the function execution status. + * @since 12 + */ +NAPI_EXTERN napi_status napi_load_module_with_info(napi_env env, + const char* path, + const char* module_info, + napi_value* result); + /** * @brief Create the ark runtime. * * @param env Indicates the ark runtime environment. + * + * @return Return the function execution status. * @since 12 */ NAPI_EXTERN napi_status napi_create_ark_runtime(napi_env* env); @@ -178,11 +380,13 @@ NAPI_EXTERN napi_status napi_create_ark_runtime(napi_env* env); * @brief Destroy the ark runtime. * * @param env Indicates the ark runtime environment. + * + * @return Return the function execution status. * @since 12 */ NAPI_EXTERN napi_status napi_destroy_ark_runtime(napi_env* env); -/* +/** * @brief Defines a sendable class. * * @param env: The environment that the API is invoked under. @@ -192,9 +396,10 @@ NAPI_EXTERN napi_status napi_destroy_ark_runtime(napi_env* env); * @param data: Optional data to be passed to the constructor callback as the data property of the callback info. * @param property_count: Number of items in the properties array argument. * @param properties: Array of property descriptors describing static and instance data properties, accessors, and - * methods on the class. See napi_property_descriptor. + * methods on the class. See napi_property_descriptor. * @param parent: A napi_value representing the Superclass. * @param result: A napi_value representing the constructor function for the class. + * * @return Return the function execution status. * @since 12 */ @@ -214,116 +419,151 @@ NAPI_EXTERN napi_status napi_define_sendable_class(napi_env env, * @param env The environment that the API is invoked under. * @param value The napi_value to be checked. * @param result Boolean value that is set to true if napi_value is sendable, false otherwise. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_is_sendable(napi_env env, napi_value value, bool* result); +NAPI_EXTERN napi_status napi_is_sendable(napi_env env, + napi_value value, + bool* result); + /** * @brief Defines a sendable object. * * @param env The environment that the API is invoked under. * @param property_count The count of object properties. * @param properties Object properties. + * @param result The created sendable object. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_create_sendable_object_with_properties(napi_env env, size_t property_count, +NAPI_EXTERN napi_status napi_create_sendable_object_with_properties(napi_env env, + size_t property_count, const napi_property_descriptor* properties, napi_value* result); + /** * @brief Wraps a native instance in a ArkTS object. * * @param env The environment that the API is invoked under. * @param js_object The ArkTS object that will be the wrapper for the native object. * @param native_object The native instance that will be wrapped in the ArkTS object. - * @param finalize_lib Optional native callback that can be used to free the native instance when the ArkTS object + * @param finalize_cb Optional native callback that can be used to free the native instance when the ArkTS object * has been garbage-collected. * @param finalize_hint Optional contextual hint that is passed to the finalize callback. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_wrap_sendable(napi_env env, napi_value js_object, void* native_object, - napi_finalize finalize_cb, void* finalize_hint); +NAPI_EXTERN napi_status napi_wrap_sendable(napi_env env, + napi_value js_object, + void* native_object, + napi_finalize finalize_cb, + void* finalize_hint); + /** * @brief Wraps a native instance in a ArkTS object. * * @param env The environment that the API is invoked under. * @param js_object The ArkTS object that will be the wrapper for the native object. * @param native_object The native instance that will be wrapped in the ArkTS object. - * @param finalize_lib Optional native callback that can be used to free the native instance when the ArkTS object - * has been garbage-collected. + * @param finalize_cb Optional native callback that can be used to free the native instance when the ArkTS object + * has been garbage-collected. * @param finalize_hint Optional contextual hint that is passed to the finalize callback. * @param native_binding_size The size of native binding. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_wrap_sendable_with_size(napi_env env, napi_value js_object, void* native_object, - napi_finalize finalize_cb, void* finalize_hint, +NAPI_EXTERN napi_status napi_wrap_sendable_with_size(napi_env env, + napi_value js_object, + void* native_object, + napi_finalize finalize_cb, + void* finalize_hint, size_t native_binding_size); + /** * @brief Retrieves a native instance that was previously wrapped in a ArkTS object. * * @param env The environment that the API is invoked under. * @param js_object The object associated with the native instance. * @param result Pointer to the wrapped native instance. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_unwrap_sendable(napi_env env, napi_value js_object, void** result); +NAPI_EXTERN napi_status napi_unwrap_sendable(napi_env env, + napi_value js_object, + void** result); + /** * @brief Retrieves a native instance that was previously wrapped in a ArkTS object and removes the wrapping. * * @param env The environment that the API is invoked under. * @param js_object The object associated with the native instance. * @param result Pointer to the wrapped native instance. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_remove_wrap_sendable(napi_env env, napi_value js_object, void** result); -/* +NAPI_EXTERN napi_status napi_remove_wrap_sendable(napi_env env, + napi_value js_object, + void** result); + +/** * @brief Create a sendable array. * * @param env: The environment that the API is invoked under. * @param result: A napi_value representing a sendable array. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_create_sendable_array(napi_env env, napi_value* result); +NAPI_EXTERN napi_status napi_create_sendable_array(napi_env env, + napi_value* result); -/* +/** * @brief Create a sendable array with length. * * @param env: The environment that the API is invoked under. * @param length: The initial length of the sendable array. * @param result: A napi_value representing a sendable array. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_create_sendable_array_with_length(napi_env env, size_t length, napi_value* result); +NAPI_EXTERN napi_status napi_create_sendable_array_with_length(napi_env env, + size_t length, + napi_value* result); -/* +/** * @brief Create a sendable arraybuffer. * * @param env: The environment that the API is invoked under. * @param byte_length: The length in bytes of the sendable arraybuffer to create. * @param data: Pointer to the underlying byte buffer of the sendable arraybuffer. * @param result: A napi_value representing a sendable arraybuffer. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_create_sendable_arraybuffer(napi_env env, size_t byte_length, - void** data, napi_value* result); +NAPI_EXTERN napi_status napi_create_sendable_arraybuffer(napi_env env, + size_t byte_length, + void** data, + napi_value* result); -/* +/** * @brief Create a sendable typedarray. * * @param env: The environment that the API is invoked under. * @param type: Scalar datatype of the elements within the sendable typedarray. * @param length: Number of elements in the typedarray. * @param arraybuffer: Sendable arraybuffer underlying the sendable typedarray. - * @param byte_offset: The byte offset within the sendable arraybuffer from - * which to start projecting the sendable typedarray. + * @param byte_offset: The byte offset within the sendable arraybuffer from which to start projecting the + * sendable typedarray. * @param result: A napi_value representing a sendable typedarray. + * * @return Return the function execution status. * @since 12 */ @@ -341,10 +581,12 @@ NAPI_EXTERN napi_status napi_create_sendable_typedarray(napi_env env, * * @param env Current running virtual machine context. * @param mode Indicates the running mode of the native event loop. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_run_event_loop(napi_env env, napi_event_mode mode); +NAPI_EXTERN napi_status napi_run_event_loop(napi_env env, + napi_event_mode mode); /** * @brief Stop the event loop in current thread. @@ -352,6 +594,7 @@ NAPI_EXTERN napi_status napi_run_event_loop(napi_env env, napi_event_mode mode); * Support to stop the running event loop in current native thread. * * @param env Current running virtual machine context. + * * @return Return the function execution status. * @since 12 */ @@ -365,9 +608,10 @@ NAPI_EXTERN napi_status napi_stop_event_loop(napi_env env); * @param transfer_list List of data to transfer in transfer mode. * @param clone_list List of Sendable data to transfer in clone mode. * @param result Serialization result of the JS object. + * * @return Returns the function execution status. * @since 12 -*/ + */ NAPI_EXTERN napi_status napi_serialize(napi_env env, napi_value object, napi_value transfer_list, @@ -380,20 +624,25 @@ NAPI_EXTERN napi_status napi_serialize(napi_env env, * @param env Current running virtual machine context. * @param buffer Data to deserialize. * @param object ArkTS object obtained by deserialization. + * * @return Returns the function execution status. * @since 12 -*/ -NAPI_EXTERN napi_status napi_deserialize(napi_env env, void* buffer, napi_value* object); + */ +NAPI_EXTERN napi_status napi_deserialize(napi_env env, + void* buffer, + napi_value* object); /** * @brief Delete serialization data. * * @param env Current running virtual machine context. * @param buffer Data to delete. + * * @return Returns the function execution status. * @since 12 -*/ -NAPI_EXTERN napi_status napi_delete_serialization_data(napi_env env, void* buffer); + */ +NAPI_EXTERN napi_status napi_delete_serialization_data(napi_env env, + void* buffer); /** * @brief Dispatch a task with specified priority from a native thread to an ArkTS thread, the task will execute @@ -405,6 +654,7 @@ NAPI_EXTERN napi_status napi_delete_serialization_data(napi_env env, void* buffe * @param isTail Indicates the way of the task dispatched into the native event queue. When "isTail" is true, * the task will be dispatched to the tail of the native event queue. Conversely, when "isTail" is false, the * tasks will be dispatched to the head of the native event queue. + * * @return Return the function execution status. * @since 12 */ @@ -412,7 +662,56 @@ NAPI_EXTERN napi_status napi_call_threadsafe_function_with_priority(napi_threads void *data, napi_task_priority priority, bool isTail); + +/** + * @brief Throws UncaughtException to ArkTS. + * @param env Current running virtual machine context. + * @param err Error object which is passed to 'UncaughtException'. + * + * @return Returns the function execution status. + * @since 12 + */ +NAPI_EXTERN napi_status napi_fatal_exception(napi_env env, + napi_value err); + +/** + * @brief Allows a JS function to be called in the asynchronous context. The capabilities related to **async_hook** are not supported currently. + * @param env Current running virtual machine context. + * @param async_context The context environment for the async operation. + * @param recv The 'this' pointer of the function. + * @param func ArkTS function to be called. + * @param argc Size of the argument array which is passed to 'func'. + * @param argv Argument array. + * @param result Result returned by the ArkTS function. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_make_callback(napi_env env, + napi_async_context async_context, + napi_value recv, + napi_value func, + size_t argc, + const napi_value* argv, + napi_value* result); + +/** + * @brief Creates a ArkTS buffer of the specified size. + * @param env Current running virtual machine context. + * @param length The size of the buffer to be created. + * @param data Raw pointer of the ArkTS buffer. + * @param result Result returned by the ArkTS function. + * + * @return Returns the function execution status. + * @since 10 + */ +NAPI_EXTERN napi_status napi_create_buffer(napi_env env, + size_t length, + void** data, + napi_value* result); + #ifdef __cplusplus } #endif -#endif /* FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H */ + +#endif /* FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H */ \ No newline at end of file -- Gitee From 7a85976c707bac8e66259888c88aef9334243627 Mon Sep 17 00:00:00 2001 From: zhouchaobo Date: Fri, 29 Nov 2024 11:09:46 +0800 Subject: [PATCH 478/620] capi JSDOC bug fix Signed-off-by: zhouchaobo Change-Id: I87a262b0ab9dc963d971841e993da5387dc33835 --- arkui/ace_engine/native/native_gesture.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arkui/ace_engine/native/native_gesture.h b/arkui/ace_engine/native/native_gesture.h index 42b37aa9c..4551c782c 100644 --- a/arkui/ace_engine/native/native_gesture.h +++ b/arkui/ace_engine/native/native_gesture.h @@ -649,6 +649,7 @@ int32_t OH_ArkUI_ParallelInnerGestureEvent_GetConflictRecognizers(ArkUI_Parallel * @param userData Indicates the custom data. * @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. +* @since 12 */ int32_t OH_ArkUI_SetArkUIGestureRecognizerDisposeNotify(ArkUI_GestureRecognizer* recognizer, ArkUI_GestureRecognizerDisposeNotifyCallback callback, void* userData); -- Gitee From f4cdcaa9383551619262a869c2a04a608a2ac3a6 Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Fri, 29 Nov 2024 17:25:56 +0800 Subject: [PATCH 479/620] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=20=E4=B8=8A=E4=BC=A0=E5=BA=9F=E5=BC=83?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- multimedia/av_codec/native_avcodec_base.h | 16 ++++++++++++++++ .../av_codec/native_avcodec_videoencoder.h | 17 ++++++++++++++--- multimedia/av_codec/native_avdemuxer.h | 4 ++++ 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index a9dbbaa7d..117d5783b 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -348,6 +348,7 @@ extern const char *OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT; * @brief Key for timeStamp in surface's extraData, value type is int64_t. * * @syscap SystemCapability.Multimedia.Media.CodecBase + * @deprecated since 14 * @since 9 */ extern const char *OH_ED_KEY_TIME_STAMP; @@ -355,6 +356,7 @@ extern const char *OH_ED_KEY_TIME_STAMP; * @brief Key for endOfStream in surface's extraData, value type is bool. * * @syscap SystemCapability.Multimedia.Media.CodecBase + * @deprecated since 14 * @since 9 */ extern const char *OH_ED_KEY_EOS; @@ -662,6 +664,8 @@ extern const char *OH_MD_KEY_SETUP_HEADER; * @brief Key for video scale type, value type is int32_t, see {@link OH_ScalingMode}. * * @syscap SystemCapability.Multimedia.Media.CodecBase + * @deprecated since 14 + * @useinstead OH_NativeWindow_NativeWindowSetScalingModeV2 * @since 10 */ extern const char *OH_MD_KEY_SCALING_MODE; @@ -1021,7 +1025,11 @@ typedef enum OH_HEVCProfile { HEVC_PROFILE_MAIN = 0, HEVC_PROFILE_MAIN_10 = 1, HEVC_PROFILE_MAIN_STILL = 2, + /* @deprecated since 14 + */ HEVC_PROFILE_MAIN_10_HDR10 = 3, + /* @deprecated since 14 + */ HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4, } OH_HEVCProfile; @@ -1071,10 +1079,18 @@ typedef enum OH_AVSeekMode { * @brief Scaling Mode * * @syscap SystemCapability.Multimedia.Media.CodecBase + * @deprecated since 14 + * @useinstead OHScalingModeV2 * @since 10 */ typedef enum OH_ScalingMode { + /* @deprecated since 14 + * @useinstead OH_SCALING_MODE_SCALE_TO_WINDOW_V2 + */ SCALING_MODE_SCALE_TO_WINDOW = 1, + /* @deprecated since 14 + * @useinstead OH_SCALING_MODE_SCALE_CROP_V2 + */ SCALING_MODE_SCALE_CROP = 2, } OH_ScalingMode; diff --git a/multimedia/av_codec/native_avcodec_videoencoder.h b/multimedia/av_codec/native_avcodec_videoencoder.h index e66569f4f..038a2f499 100644 --- a/multimedia/av_codec/native_avcodec_videoencoder.h +++ b/multimedia/av_codec/native_avcodec_videoencoder.h @@ -428,14 +428,25 @@ OH_AVErrCode OH_VideoEncoder_IsValid(OH_AVCodec *codec, bool *isValid); /** * @brief The bitrate mode of video encoder. * @syscap SystemCapability.Multimedia.Media.VideoEncoder + * @deprecated since 14 + * @useinstead OH_BitrateMode * @since 9 */ typedef enum OH_VideoEncodeBitrateMode { - /* constant bit rate mode. */ + /* constant bit rate mode. + * @deprecated since 14 + * @useinstead BITRATE_MODE_CBR + */ CBR = 0, - /* variable bit rate mode. */ + /* variable bit rate mode. + * @deprecated since 14 + * @useinstead BITRATE_MODE_VBR + */ VBR = 1, - /* constant quality mode. */ + /* constant quality mode. + * @deprecated since 14 + * @useinstead BITRATE_MODE_CQ + */ CQ = 2, } OH_VideoEncodeBitrateMode; diff --git a/multimedia/av_codec/native_avdemuxer.h b/multimedia/av_codec/native_avdemuxer.h index 491352815..8375deb8c 100644 --- a/multimedia/av_codec/native_avdemuxer.h +++ b/multimedia/av_codec/native_avdemuxer.h @@ -50,6 +50,8 @@ typedef struct DRM_MediaKeySystemInfo DRM_MediaKeySystemInfo; /** * @brief Callback for getting media key system information from media source. +* @deprecated since 14 +* @useinstead Demuxer_MediaKeySystemInfoCallback * @since 11 * @version 1.0 */ @@ -219,6 +221,8 @@ OH_AVErrCode OH_AVDemuxer_SetDemuxerMediaKeySystemInfoCallback(OH_AVDemuxer *dem * {@link AV_ERR_OPERATE_NOT_PERMIT} 2 - If the demuxer engine is not inited or init failed. * {@link AV_ERR_INVALID_VAL} 3 - If the demuxer instance is nullptr or invalid * or the mediaKeySystemInfo is nullptr. + * @deprecated since 14 + * @useinstead OH_AVDemuxer_SetDemuxerMediaKeySystemInfoCallback * @since 11 */ OH_AVErrCode OH_AVDemuxer_GetMediaKeySystemInfo(OH_AVDemuxer *demuxer, DRM_MediaKeySystemInfo *mediaKeySystemInfo); -- Gitee From 751072f1bdd16c346c06e169cda1baf88c68f5ac Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Fri, 29 Nov 2024 17:34:16 +0800 Subject: [PATCH 480/620] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=20OH=5FBitrateMode=E5=A4=B4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=BD=8D=E7=BD=AE=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- multimedia/av_codec/native_avcapability.h | 15 +--------- multimedia/av_codec/native_avcodec_base.h | 29 ++++++++++++++++--- .../av_codec/native_avcodec_videoencoder.h | 6 ++-- multimedia/av_codec/native_avdemuxer.h | 17 +++++------ 4 files changed, 37 insertions(+), 30 deletions(-) diff --git a/multimedia/av_codec/native_avcapability.h b/multimedia/av_codec/native_avcapability.h index 5f30e6c92..2b6288f4a 100644 --- a/multimedia/av_codec/native_avcapability.h +++ b/multimedia/av_codec/native_avcapability.h @@ -30,6 +30,7 @@ #include #include "native_averrors.h" #include "native_avformat.h" +#include "native_avcodec_base.h" #ifdef __cplusplus extern "C" { @@ -42,20 +43,6 @@ extern "C" { */ typedef struct OH_AVCapability OH_AVCapability; -/** - * @brief The bitrate mode of encoder. - * @syscap SystemCapability.Multimedia.Media.CodecBase - * @since 10 - */ -typedef enum OH_BitrateMode { - /* Constant Bit rate mode. */ - BITRATE_MODE_CBR = 0, - /* Variable Bit rate mode. */ - BITRATE_MODE_VBR = 1, - /* Constant Quality mode. */ - BITRATE_MODE_CQ = 2 -} OH_BitrateMode; - /** * @brief Range contain min and max value * @syscap SystemCapability.Multimedia.Media.CodecBase diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 117d5783b..579849f62 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1025,10 +1025,12 @@ typedef enum OH_HEVCProfile { HEVC_PROFILE_MAIN = 0, HEVC_PROFILE_MAIN_10 = 1, HEVC_PROFILE_MAIN_STILL = 2, - /* @deprecated since 14 + /** + * @deprecated since 14 */ HEVC_PROFILE_MAIN_10_HDR10 = 3, - /* @deprecated since 14 + /** + * @deprecated since 14 */ HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4, } OH_HEVCProfile; @@ -1084,11 +1086,13 @@ typedef enum OH_AVSeekMode { * @since 10 */ typedef enum OH_ScalingMode { - /* @deprecated since 14 + /** + * @deprecated since 14 * @useinstead OH_SCALING_MODE_SCALE_TO_WINDOW_V2 */ SCALING_MODE_SCALE_TO_WINDOW = 1, - /* @deprecated since 14 + /** + * @deprecated since 14 * @useinstead OH_SCALING_MODE_SCALE_CROP_V2 */ SCALING_MODE_SCALE_CROP = 2, @@ -1250,6 +1254,23 @@ typedef enum OH_TemporalGopReferenceMode { UNIFORMLY_SCALED_REFERENCE = 2, } OH_TemporalGopReferenceMode; +/** + * @brief The bitrate mode of encoder. + * + * Change the location of the header file, since 14. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 10 + */ +typedef enum OH_BitrateMode { + /** Constant Bit rate mode. */ + BITRATE_MODE_CBR = 0, + /** Variable Bit rate mode. */ + BITRATE_MODE_VBR = 1, + /** Constant Quality mode. */ + BITRATE_MODE_CQ = 2 +} OH_BitrateMode; + #ifdef __cplusplus } #endif diff --git a/multimedia/av_codec/native_avcodec_videoencoder.h b/multimedia/av_codec/native_avcodec_videoencoder.h index 038a2f499..2781353f0 100644 --- a/multimedia/av_codec/native_avcodec_videoencoder.h +++ b/multimedia/av_codec/native_avcodec_videoencoder.h @@ -433,17 +433,17 @@ OH_AVErrCode OH_VideoEncoder_IsValid(OH_AVCodec *codec, bool *isValid); * @since 9 */ typedef enum OH_VideoEncodeBitrateMode { - /* constant bit rate mode. + /** constant bit rate mode. * @deprecated since 14 * @useinstead BITRATE_MODE_CBR */ CBR = 0, - /* variable bit rate mode. + /** variable bit rate mode. * @deprecated since 14 * @useinstead BITRATE_MODE_VBR */ VBR = 1, - /* constant quality mode. + /** constant quality mode. * @deprecated since 14 * @useinstead BITRATE_MODE_CQ */ diff --git a/multimedia/av_codec/native_avdemuxer.h b/multimedia/av_codec/native_avdemuxer.h index 8375deb8c..738da2ed8 100644 --- a/multimedia/av_codec/native_avdemuxer.h +++ b/multimedia/av_codec/native_avdemuxer.h @@ -49,13 +49,12 @@ typedef struct OH_AVDemuxer OH_AVDemuxer; typedef struct DRM_MediaKeySystemInfo DRM_MediaKeySystemInfo; /** -* @brief Callback for getting media key system information from media source. -* @deprecated since 14 -* @useinstead Demuxer_MediaKeySystemInfoCallback -* @since 11 -* @version 1.0 -*/ -typedef void (*DRM_MediaKeySystemInfoCallback)(DRM_MediaKeySystemInfo* mediaKeySystemInfo); + * @brief Callback for getting media key system information from media source. + * @deprecated since 14 + * @useinstead Demuxer_MediaKeySystemInfoCallback + * @since 11 + */ +typedef void (*DRM_MediaKeySystemInfoCallback)(DRM_MediaKeySystemInfo *mediaKeySystemInfo); /** * @brief Call back will be invoked when updating DRM information. @@ -193,6 +192,8 @@ OH_AVErrCode OH_AVDemuxer_SeekToTime(OH_AVDemuxer *demuxer, int64_t millisecond, * @return {@link AV_ERR_OK} 0 - Success * {@link AV_ERR_OPERATE_NOT_PERMIT} 2 - If the demuxer engine is not inited or init failed. * {@link AV_ERR_INVALID_VAL} 3 - If the demuxer instance is nullptr or invalid. + * @deprecated since 14 + * @useinstead OH_AVDemuxer_SetDemuxerMediaKeySystemInfoCallback * @since 11 */ OH_AVErrCode OH_AVDemuxer_SetMediaKeySystemInfoCallback(OH_AVDemuxer *demuxer, @@ -221,8 +222,6 @@ OH_AVErrCode OH_AVDemuxer_SetDemuxerMediaKeySystemInfoCallback(OH_AVDemuxer *dem * {@link AV_ERR_OPERATE_NOT_PERMIT} 2 - If the demuxer engine is not inited or init failed. * {@link AV_ERR_INVALID_VAL} 3 - If the demuxer instance is nullptr or invalid * or the mediaKeySystemInfo is nullptr. - * @deprecated since 14 - * @useinstead OH_AVDemuxer_SetDemuxerMediaKeySystemInfoCallback * @since 11 */ OH_AVErrCode OH_AVDemuxer_GetMediaKeySystemInfo(OH_AVDemuxer *demuxer, DRM_MediaKeySystemInfo *mediaKeySystemInfo); -- Gitee From fd2199515b47aba85f6574c5784511c3d4e5633f Mon Sep 17 00:00:00 2001 From: = Date: Thu, 28 Nov 2024 16:05:16 +0800 Subject: [PATCH 481/620] =?UTF-8?q?=E6=8F=92=E5=85=A5=E6=96=B0=E5=AE=8F?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: = --- third_party/musl/ndk_script/BUILD.gn | 14 +++- .../musl/ndk_script/updated_version.py | 74 +++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100755 third_party/musl/ndk_script/updated_version.py diff --git a/third_party/musl/ndk_script/BUILD.gn b/third_party/musl/ndk_script/BUILD.gn index a71e33565..0e08fa68f 100644 --- a/third_party/musl/ndk_script/BUILD.gn +++ b/third_party/musl/ndk_script/BUILD.gn @@ -14,6 +14,7 @@ import("//build/config/clang/clang.gni") import("//build/ohos/ndk/ndk.gni") +import("//build/version.gni") import("//third_party/musl/musl_config.gni") import("//third_party/musl/musl_src.gni") import("//third_party/musl/musl_template.gni") @@ -21,6 +22,8 @@ import("//third_party/musl/musl_template.gni") musl_target_out_dir = "${root_out_dir}/obj/third_party/musl" ndk_musl_include = "ndk_musl_include" interface_musl_dir = "//interface/sdk_c/third_party/musl" +target_version_dir = "ndk_musl_include/info" +target_version_file = "application_target_sdk_version.h" if (host_os == "mac") { if (host_cpu == "arm64") { @@ -223,6 +226,15 @@ action("copy_ndk_musl_headers") { deps = [ ":copy_ndk_uapi" ] } +action("updated_version") { + outputs = [ "${musl_target_out_dir}/${target_version_dir}" ] + script = "updated_version.py" + args = [ "-p" ] + [ rebase_path( + "${musl_target_out_dir}/${target_version_dir}/${target_version_file}") ] + args += [ "-v" ] + [ api_version ] + deps = [ ":copy_ndk_musl_headers" ] +} + action("copy_musl_sysroot") { outputs = [ "${ndk_headers_out_dir}" ] script = "copy_musl_sysroot.sh" @@ -230,7 +242,7 @@ action("copy_musl_sysroot") { [ "-i" ] + [ rebase_path("${musl_target_out_dir}/${ndk_musl_include}") ] args += [ "-o" ] + [ rebase_path("${ndk_headers_out_dir}") ] args += [ "-t" ] + [ "${musl_arch}" ] - deps = [ ":copy_ndk_musl_headers" ] + deps = [ ":updated_version" ] } musl_libs_arm32 = [ diff --git a/third_party/musl/ndk_script/updated_version.py b/third_party/musl/ndk_script/updated_version.py new file mode 100755 index 000000000..362384527 --- /dev/null +++ b/third_party/musl/ndk_script/updated_version.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse + + +# 插入新版宏内容 +def updated_version(file_path: str, new_version: int): + version_define = '#define OH_API_VERSION_' + version_current_define = '#define OH_CURRENT_API_VERSION OH_API_VERSION_' + # 需要插入的内容 + new_content = '' + # 插入的标志位置 + insert_after_line = '#define SDK_VERSION_9 9' + # 旧版本 + old_version = 9 + # 更新需插入的内容 + for i in range(new_version - old_version): + new_content += '{}{} {}\n'.format(version_define, old_version + i + 1, old_version + i + 1) + new_content_tag = '{}{}\n'.format(version_current_define, new_version) + new_content += new_content_tag + + with open(file_path, 'r') as fp: + lines = fp.readlines() + + # 查找插入位置的索引 + insert_position = None + for i, line in enumerate(lines): + if insert_after_line in line: + insert_position = i + 1 # 插入在该行之后 + break + + # 如果找到插入位置 + if (insert_position is not None) and (new_content_tag not in lines): + # 插入新内容 + lines.insert(insert_position, new_content) + # 更新修改后的内容 + with open(file_path, 'w') as fp: + fp.writelines(lines) + elif insert_position is None: + raise Exception('未找到插入位置: {},写入失败'.format(insert_after_line)) + + +# 入口 +def process_target_version(): + try: + parser = argparse.ArgumentParser(description='Updated version') + # 定义命令行参数 + parser.add_argument('-p', '--path', type=str, required=True, help='Path to the input file') + parser.add_argument('-v', '--version', type=str, required=True, help='Version of the api') + args = parser.parse_args() + # 获取文件路径和版本 + input_file = args.path + api_version = int(args.version) + # 写入新版宏内容 + updated_version(input_file, api_version) + except Exception as e: + raise e + + +if __name__ == '__main__': + process_target_version() -- Gitee From f6612c09efba780ccab0fad032297dd4101343da Mon Sep 17 00:00:00 2001 From: shilei Date: Sat, 30 Nov 2024 15:42:55 +0800 Subject: [PATCH 482/620] modify napi interface file Signed-off-by: shilei Change-Id: I82376d1940b90a71488a0efe0fbed61ea104a584 --- arkui/napi/common.h | 25 ++++++++++++++++++++++++- arkui/napi/native_api.h | 8 +++++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/arkui/napi/common.h b/arkui/napi/common.h index e5e5c8d5e..b4a5f7b62 100644 --- a/arkui/napi/common.h +++ b/arkui/napi/common.h @@ -13,6 +13,28 @@ * limitations under the License. */ +/** + * @addtogroup ArkTS_Napi_NativeModule + * @{ + * + * + * @brief Provides native api of ArkTS native module. + * + * @since 10 + */ + +/** + * @file common.h + * + * @brief Defines common enum types of ArkTS native module. + * + * @kit ArkTS + * @library libace_napi.z.so + * @syscap SystemCapability.ArkUI.ArkUI.Napi + * @since 10 + * @version 1.0 + */ + #ifndef FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_COMMON_H #define FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_COMMON_H @@ -67,4 +89,5 @@ typedef enum { napi_priority_idle = 3, } napi_task_priority; -#endif /* FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H */ \ No newline at end of file +#endif /* FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H */ +/** @} */ diff --git a/arkui/napi/native_api.h b/arkui/napi/native_api.h index d140aa622..a3d08dd7b 100644 --- a/arkui/napi/native_api.h +++ b/arkui/napi/native_api.h @@ -13,8 +13,6 @@ * limitations under the License. */ -#ifndef FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H -#define FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H /** * @addtogroup ArkTS_Napi_NativeModule * @{ @@ -37,6 +35,9 @@ * @version 1.0 */ +#ifndef FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H +#define FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H + #ifndef NAPI_VERSION #define NAPI_VERSION 8 #endif // NAPI_VERSION @@ -714,4 +715,5 @@ NAPI_EXTERN napi_status napi_create_buffer(napi_env env, } #endif -#endif /* FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H */ \ No newline at end of file +#endif /* FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H */ +/** @} */ -- Gitee From 69462b6fc381c9ec07762bc202dfc54a267ac047 Mon Sep 17 00:00:00 2001 From: shilei Date: Mon, 2 Dec 2024 21:59:17 +0800 Subject: [PATCH 483/620] modify napi interface notation Signed-off-by: shilei Change-Id: Ic4ce6c44c1ee8d9afe097d7d443d360a11281563 --- arkui/napi/common.h | 2 +- arkui/napi/native_api.h | 61 +++++++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/arkui/napi/common.h b/arkui/napi/common.h index b4a5f7b62..6e8ac4aa0 100644 --- a/arkui/napi/common.h +++ b/arkui/napi/common.h @@ -90,4 +90,4 @@ typedef enum { } napi_task_priority; #endif /* FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H */ -/** @} */ +/** @} */ \ No newline at end of file diff --git a/arkui/napi/native_api.h b/arkui/napi/native_api.h index a3d08dd7b..b05497312 100644 --- a/arkui/napi/native_api.h +++ b/arkui/napi/native_api.h @@ -129,7 +129,8 @@ NAPI_EXTERN napi_status napi_load_module(napi_env env, * * @param env Current running virtual machine context. * @param data Data item to bind with the 'env'. - * @param finalize_cb Optional native callback that will be triggered when 'env' is destroyed or this interface repeatedly calls. + * @param finalize_cb Optional native callback that will be triggered when 'env' is destroyed or this interface + * repeatedly calls. * @param finalize_hint Optional contextual hint that is passed to the finalize callback. * * @return Returns the function execution status. @@ -224,7 +225,8 @@ NAPI_EXTERN napi_status napi_async_init(napi_env env, napi_async_context* result); /** - * @brief Destroys the previously created asynchronous context. The capabilities related to 'async_hook' are not supported currently. + * @brief Destroys the previously created asynchronous context. The capabilities related to 'async_hook' are not + * supported currently. * * @param env Current running virtual machine context. * @param async_context The async context to be destroyed. @@ -390,16 +392,16 @@ NAPI_EXTERN napi_status napi_destroy_ark_runtime(napi_env* env); /** * @brief Defines a sendable class. * - * @param env: The environment that the API is invoked under. - * @param utf8name: Name of the ArkTS constructor function. - * @param length: The length of the utf8name in bytes, or NAPI_AUTO_LENGTH if it is null-terminated. - * @param constructor: Callback function that handles constructing instances of the class. - * @param data: Optional data to be passed to the constructor callback as the data property of the callback info. - * @param property_count: Number of items in the properties array argument. - * @param properties: Array of property descriptors describing static and instance data properties, accessors, and + * @param env The environment that the API is invoked under. + * @param utf8name Name of the ArkTS constructor function. + * @param length The length of the utf8name in bytes, or NAPI_AUTO_LENGTH if it is null-terminated. + * @param constructor Callback function that handles constructing instances of the class. + * @param data Optional data to be passed to the constructor callback as the data property of the callback info. + * @param property_count Number of items in the properties array argument. + * @param properties Array of property descriptors describing static and instance data properties, accessors, and * methods on the class. See napi_property_descriptor. - * @param parent: A napi_value representing the Superclass. - * @param result: A napi_value representing the constructor function for the class. + * @param parent A napi_value representing the Superclass. + * @param result A napi_value representing the constructor function for the class. * * @return Return the function execution status. * @since 12 @@ -439,7 +441,7 @@ NAPI_EXTERN napi_status napi_is_sendable(napi_env env, * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_create_sendable_object_with_properties(napi_env env, +NAPI_EXTERN napi_status napi_create_sendable_object_with_properties(napi_env env, size_t property_count, const napi_property_descriptor* properties, napi_value* result); @@ -515,8 +517,8 @@ NAPI_EXTERN napi_status napi_remove_wrap_sendable(napi_env env, /** * @brief Create a sendable array. * - * @param env: The environment that the API is invoked under. - * @param result: A napi_value representing a sendable array. + * @param env The environment that the API is invoked under. + * @param result A napi_value representing a sendable array. * * @return Return the function execution status. * @since 12 @@ -527,9 +529,9 @@ NAPI_EXTERN napi_status napi_create_sendable_array(napi_env env, /** * @brief Create a sendable array with length. * - * @param env: The environment that the API is invoked under. - * @param length: The initial length of the sendable array. - * @param result: A napi_value representing a sendable array. + * @param env The environment that the API is invoked under. + * @param length The initial length of the sendable array. + * @param result A napi_value representing a sendable array. * * @return Return the function execution status. * @since 12 @@ -541,10 +543,10 @@ NAPI_EXTERN napi_status napi_create_sendable_array_with_length(napi_env env, /** * @brief Create a sendable arraybuffer. * - * @param env: The environment that the API is invoked under. - * @param byte_length: The length in bytes of the sendable arraybuffer to create. - * @param data: Pointer to the underlying byte buffer of the sendable arraybuffer. - * @param result: A napi_value representing a sendable arraybuffer. + * @param env The environment that the API is invoked under. + * @param byte_length The length in bytes of the sendable arraybuffer to create. + * @param data Pointer to the underlying byte buffer of the sendable arraybuffer. + * @param result A napi_value representing a sendable arraybuffer. * * @return Return the function execution status. * @since 12 @@ -557,13 +559,13 @@ NAPI_EXTERN napi_status napi_create_sendable_arraybuffer(napi_env env, /** * @brief Create a sendable typedarray. * - * @param env: The environment that the API is invoked under. - * @param type: Scalar datatype of the elements within the sendable typedarray. - * @param length: Number of elements in the typedarray. - * @param arraybuffer: Sendable arraybuffer underlying the sendable typedarray. - * @param byte_offset: The byte offset within the sendable arraybuffer from which to start projecting the + * @param env The environment that the API is invoked under. + * @param type Scalar datatype of the elements within the sendable typedarray. + * @param length Number of elements in the typedarray. + * @param arraybuffer Sendable arraybuffer underlying the sendable typedarray. + * @param byte_offset The byte offset within the sendable arraybuffer from which to start projecting the * sendable typedarray. - * @param result: A napi_value representing a sendable typedarray. + * @param result A napi_value representing a sendable typedarray. * * @return Return the function execution status. * @since 12 @@ -676,7 +678,8 @@ NAPI_EXTERN napi_status napi_fatal_exception(napi_env env, napi_value err); /** - * @brief Allows a JS function to be called in the asynchronous context. The capabilities related to **async_hook** are not supported currently. + * @brief Allows a JS function to be called in the asynchronous context. The capabilities related to 'async_hook' are + * not supported currently. * @param env Current running virtual machine context. * @param async_context The context environment for the async operation. * @param recv The 'this' pointer of the function. @@ -716,4 +719,4 @@ NAPI_EXTERN napi_status napi_create_buffer(napi_env env, #endif #endif /* FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H */ -/** @} */ +/** @} */ \ No newline at end of file -- Gitee From 0f33a75ff0fd9a791685a11e2799f16569223f14 Mon Sep 17 00:00:00 2001 From: yuhaoqiang Date: Tue, 3 Dec 2024 09:53:50 +0800 Subject: [PATCH 484/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=98=BE=E5=AD=98=E7=9A=84=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=88=9D=E6=AC=A1=E5=BC=95=E5=85=A5=E4=B8=BAapi14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuhaoqiang --- hiviewdfx/hidebug/libhidebug.ndk.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hiviewdfx/hidebug/libhidebug.ndk.json b/hiviewdfx/hidebug/libhidebug.ndk.json index 45be9500b..02d50bda9 100644 --- a/hiviewdfx/hidebug/libhidebug.ndk.json +++ b/hiviewdfx/hidebug/libhidebug.ndk.json @@ -36,7 +36,7 @@ "name": "OH_HiDebug_StopAppTraceCapture" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_HiDebug_GetGraphicsMemory" } ] \ No newline at end of file -- Gitee From b00e0f9d117805c76a523bb710849fc87104271e Mon Sep 17 00:00:00 2001 From: z30053720 Date: Tue, 3 Dec 2024 14:17:17 +0800 Subject: [PATCH 485/620] add tag Signed-off-by: z30053720 --- arkui/ace_engine/native/native_dialog.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arkui/ace_engine/native/native_dialog.h b/arkui/ace_engine/native/native_dialog.h index 95b1a6cbe..c399920d7 100644 --- a/arkui/ace_engine/native/native_dialog.h +++ b/arkui/ace_engine/native/native_dialog.h @@ -325,3 +325,4 @@ int32_t OH_ArkUI_DialogDismissEvent_GetDismissReason(ArkUI_DialogDismissEvent* e #endif #endif // ARKUI_NATIVE_DIALOG_H +/** @} */ -- Gitee From c50e4cf69cddbe7ac45c93469c26ed02642919a0 Mon Sep 17 00:00:00 2001 From: GuoLi Date: Wed, 4 Dec 2024 15:57:13 +0800 Subject: [PATCH 486/620] =?UTF-8?q?API=20Lint=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: GuoLi --- network/netmanager/include/net_connection.h | 6 +++--- .../netmanager/include/net_connection_type.h | 6 +++--- network/netssl/include/net_ssl_c.h | 7 ++++--- network/netssl/include/net_ssl_c_type.h | 7 ++++--- network/netstack/net_websocket/net_websocket.h | 17 +++++++++-------- .../netstack/net_websocket/net_websocket_type.h | 7 ++++--- 6 files changed, 27 insertions(+), 23 deletions(-) diff --git a/network/netmanager/include/net_connection.h b/network/netmanager/include/net_connection.h index 6c5c4c2f2..13294313d 100644 --- a/network/netmanager/include/net_connection.h +++ b/network/netmanager/include/net_connection.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NATIVE_NET_CONN_API_H -#define NATIVE_NET_CONN_API_H - /** * @addtogroup NetConnection * @{ @@ -38,6 +35,9 @@ * @version 1.0 */ +#ifndef NATIVE_NET_CONN_API_H +#define NATIVE_NET_CONN_API_H + #include #include "net_connection_type.h" diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index 40e80760b..663f39a7d 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NATIVE_NET_CONN_TYPE_H -#define NATIVE_NET_CONN_TYPE_H - /** * @addtogroup NetConnection * @{ @@ -38,6 +35,9 @@ * */ +#ifndef NATIVE_NET_CONN_TYPE_H +#define NATIVE_NET_CONN_TYPE_H + #include #include #include diff --git a/network/netssl/include/net_ssl_c.h b/network/netssl/include/net_ssl_c.h index 779ccab79..136ab3ca3 100644 --- a/network/netssl/include/net_ssl_c.h +++ b/network/netssl/include/net_ssl_c.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NET_SSL_C_H -#define NET_SSL_C_H - /** * @addtogroup netstack * @{ @@ -38,6 +35,9 @@ * @version 1.0 */ +#ifndef NET_SSL_C_H +#define NET_SSL_C_H + #include "net_ssl_c_type.h" #ifdef __cplusplus @@ -113,4 +113,5 @@ void OH_Netstack_DestroyCertificatesContent(NetStack_Certificates *certs); } #endif +/** @} */ #endif // NET_SSL_C_H diff --git a/network/netssl/include/net_ssl_c_type.h b/network/netssl/include/net_ssl_c_type.h index d0bbea496..cea7eba7e 100644 --- a/network/netssl/include/net_ssl_c_type.h +++ b/network/netssl/include/net_ssl_c_type.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NET_SSL_C_TYPE_H -#define NET_SSL_C_TYPE_H - /** * @addtogroup netstack * @{ @@ -37,6 +34,9 @@ * @version 1.0 */ +#ifndef NET_SSL_C_TYPE_H +#define NET_SSL_C_TYPE_H + #include #ifdef __cplusplus #include @@ -134,4 +134,5 @@ typedef struct NetStack_Certificates { } #endif +/** @} */ #endif // NET_SSL_C_TYPE_H diff --git a/network/netstack/net_websocket/net_websocket.h b/network/netstack/net_websocket/net_websocket.h index 6506ba5fa..5381cb8ac 100755 --- a/network/netstack/net_websocket/net_websocket.h +++ b/network/netstack/net_websocket/net_websocket.h @@ -13,13 +13,6 @@ * limitations under the License. */ -#ifndef NET_WEBSOCKET_H -#define NET_WEBSOCKET_H - -#include -#include -#include - /** * @addtogroup netstack * @{ @@ -42,6 +35,13 @@ * @version 1.0 */ +#ifndef NET_WEBSOCKET_H +#define NET_WEBSOCKET_H + +#include +#include +#include + #include "net_websocket_type.h" #ifdef __cplusplus @@ -54,7 +54,7 @@ extern "C" { * @param onOpen Callback function invoked when a connection setup message is received. * @param onMessage Callback function invoked when a message is received. * @param onError Callback function invoked when a connection error message is received. - * @param onClose Callback function invoked when a connection closing message is closed. + * @param onclose Callback function invoked when a connection closing message is closed. * * @return Pointer to the websocket client if success; NULL otherwise. * @syscap SystemCapability.Communication.NetStack @@ -133,4 +133,5 @@ int OH_WebSocketClient_Destroy(struct WebSocket *client); } #endif +/** @} */ #endif // NET_WEBSOCKET_H diff --git a/network/netstack/net_websocket/net_websocket_type.h b/network/netstack/net_websocket/net_websocket_type.h index c22e5ce13..c5f6f7b05 100755 --- a/network/netstack/net_websocket/net_websocket_type.h +++ b/network/netstack/net_websocket/net_websocket_type.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NET_WEBSOCKET_TYPE_H -#define NET_WEBSOCKET_TYPE_H - /** * @addtogroup netstack * @{ @@ -37,6 +34,9 @@ * @version 1.0 */ +#ifndef NET_WEBSOCKET_TYPE_H +#define NET_WEBSOCKET_TYPE_H + #ifdef __cplusplus extern "C" { #endif @@ -280,4 +280,5 @@ typedef enum WebSocket_ErrCode { } #endif +/** @} */ #endif // NET_WEBSOCKET_TYPE_H \ No newline at end of file -- Gitee From ecd3d57ab4c51b0bb98d6c40351ea660f04e476f Mon Sep 17 00:00:00 2001 From: zoulinken Date: Wed, 4 Dec 2024 17:30:17 +0800 Subject: [PATCH 487/620] =?UTF-8?q?ActiveChild=E6=8E=A5=E5=8F=A3=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zoulinken --- arkui/ace_engine/native/native_node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index f20102e7c..fd1db5f20 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -7819,7 +7819,7 @@ int32_t OH_ArkUI_NodeUtils_GetCustomProperty(ArkUI_NodeHandle node, const char* ArkUI_NodeHandle OH_ArkUI_NodeUtils_GetParentInPageTree(ArkUI_NodeHandle node); /** - * @brief Retrieve all active child nodes of a node. + * @brief Retrieve all active child nodes of a node. Span and ImageSpan will not be counted in the children. * * @param head Pass in the node that needs to be obtained. * @param handle The structure corresponding to the sub node information of the head node. -- Gitee From 1c202d84b6fbfa6e69bb8ba836d298268dc59812 Mon Sep 17 00:00:00 2001 From: shenshiyi2 Date: Wed, 4 Dec 2024 20:36:02 +0800 Subject: [PATCH 488/620] =?UTF-8?q?=E5=A2=9E=E5=8A=A0CreateScaledPixelmap?= =?UTF-8?q?=E7=9A=84NDK=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenshiyi2 --- .../include/image/pixelmap_native.h | 36 +++++++++++++++++++ .../image_framework/libpixelmap.ndk.json | 8 +++++ 2 files changed, 44 insertions(+) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index c7ea3eb57..6d2f8eafa 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -738,6 +738,42 @@ Image_ErrorCode OH_PixelmapNative_Scale(OH_PixelmapNative *pixelmap, float scale Image_ErrorCode OH_PixelmapNative_ScaleWithAntiAliasing(OH_PixelmapNative *pixelmap, float scaleX, float scaleY, OH_PixelmapNative_AntiAliasingLevel level); +/** + * @brief Create a scaled pixelmap based on the source pixelmap and the input width and height. + * + * @param srcpixelmap The source native pixelmap. + * @param dstpixelmap The destination native pixelmap for create. + * @param scaleX Scaling ratio of the width. + * @param scaleY Scaling ratio of the height. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the execution is successful. + * {@link IMAGE_BAD_PARAMETER} If the param is nullptr or invalid. + * @see OH_PixelmapNative + * @since 16 + */ +Image_ErrorCode OH_PixelmapNative_CreateScaledPixelmap(OH_PixelmapNative *srcpixelmap, OH_PixelmapNative **dstpixelmap, + float scaleX, float scaleY); + +/** + * @brief Create a scaled pixelmap based on the source pixelmap and the input width and height with anti-aliasing. + * + * @param srcpixelmap The source native pixelmap. + * @param dstpixelmap The destination native pixelmap for create. + * @param scaleX Scaling ratio of the width. + * @param scaleY Scaling ratio of the height. + * @param level The anti-aliasing algorithm to be used. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the execution is successful. + * {@link IMAGE_BAD_PARAMETER} If the param is nullptr or invalid. + * {@link IMAGE_TOO_LARGE} If image is too large. + * {@link IMAGE_ALLOC_FAILED} If device has no memory. + * {@link IMAGE_UNKNOWN_ERROR} Inner unknown error, maybe source pixelmap is released. + * @see OH_PixelmapNative + * @since 16 + */ +Image_ErrorCode OH_PixelmapNative_CreateScaledPixelmapWithAntiAliasing(OH_PixelmapNative *srcpixelmap, + OH_PixelmapNative **dstpixelmap, float scaleX, float scaleY, OH_PixelmapNative_AntiAliasingLevel level); + /** * @brief Translates this image based on the input coordinates. * diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index 4c103c8ae..ee5f2aee6 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -123,6 +123,14 @@ "first_introduced": "12", "name": "OH_PixelmapNative_ScaleWithAntiAliasing" }, + { + "first_introduced": "16", + "name": "OH_PixelmapNative_CreateScaledPixelmap" + }, + { + "first_introduced": "16", + "name": "OH_PixelmapNative_CreateScaledPixelmapWithAntiAliasing" + }, { "first_introduced": "12", "name": "OH_PixelmapNative_Translate" -- Gitee From cdbb6e85d403d580e568478eed5b0569883570d0 Mon Sep 17 00:00:00 2001 From: shenshiyi2 Date: Wed, 4 Dec 2024 20:42:58 +0800 Subject: [PATCH 489/620] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96=20?= =?UTF-8?q?PixelMap=20=E5=A4=A7=E5=B0=8F=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenshiyi2 --- .../include/image/pixelmap_native.h | 26 +++++++++++++++++++ .../image_framework/libpixelmap.ndk.json | 8 ++++++ 2 files changed, 34 insertions(+) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 6d2f8eafa..858043a65 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -937,6 +937,32 @@ Image_ErrorCode OH_PixelmapNative_SetColorSpaceNative(OH_PixelmapNative *pixelma */ Image_ErrorCode OH_PixelmapNative_SetMemoryName(OH_PixelmapNative *pixelmap, char *name, size_t *size); +/** + * @brief Get the total number of bytes occupied by all pixels in the Pixelmap, without any padding. + * + * @param pixelmap The Pixelmap pointer to be operated. + * @param byteCount The total number of bytes to be retrieved. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the operation is successful. + * {@link IMAGE_BAD_PARAMETER} If invalid parameter, pixelmap or byteCount are invalid. + * @see OH_PixelmapNative + * @since 16 + */ +Image_ErrorCode OH_PixelmapNative_GetByteCount(OH_PixelmapNative *pixelmap, uint32_t *byteCount); + +/** + * @brief Get the capacity of the Pixelmap, which is the number of bytes allocated by the Pixelmap. + * + * @param pixelmap The Pixelmap pointer to be operated. + * @param capacity The capacity to be retrieved. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the operation is successful. + * {@link IMAGE_BAD_PARAMETER} If invalid parameter, pixelmap or byteCount are invalid. + * @see OH_PixelmapNative + * @since 16 + */ +Image_ErrorCode OH_PixelmapNative_GetCapacity(OH_PixelmapNative *pixelmap, uint32_t *capacity); + #ifdef __cplusplus }; #endif diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index ee5f2aee6..8eed2ffed 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -190,5 +190,13 @@ { "first_introduced": "13", "name": "OH_PixelmapNative_SetMemoryName" + }, + { + "first_introduced": "16", + "name": "OH_PixelmapNative_GetByteCount" + }, + { + "first_introduced": "16", + "name": "OH_PixelmapNative_GetCapacity" } ] \ No newline at end of file -- Gitee From 129e2c2c25877dc0802d1cd3534bd4a6c4729b03 Mon Sep 17 00:00:00 2001 From: Hu_zq Date: Tue, 3 Dec 2024 14:57:15 +0800 Subject: [PATCH 490/620] Swiper: add capi PageFlipMode Signed-off-by: Hu_zq Change-Id: Icaf32e5775580fa20737835a044b18b68eef0bc0 --- arkui/ace_engine/native/native_node.h | 13 +++++++++++++ arkui/ace_engine/native/native_type.h | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index f20102e7c..54b9efd3b 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -4954,6 +4954,19 @@ typedef enum { */ NODE_SWIPER_INDICATOR_INTERACTIVE, + /** + * @brief Sets the page flipping mode using the mouse wheel. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: page flipping mode using the mouse wheel. The parameter type is {@link ArkUI_PageFlipMode}. \n + * \n + * Format of the return value {@link ArkUI_PageFlipMode}:\n + * .value[0].i32: page flipping mode using the mouse wheel. \n + * + * @since 14 + */ + NODE_SWIPER_PAGE_FLIP_MODE, + /** * @brief: Set the delineation component of the ListItem, supporting property settings, property resets, and * property acquisition interfaces. diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index ca825e62b..f5c62284c 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -773,6 +773,19 @@ typedef enum { ARKUI_SWIPER_NESTED_SRCOLL_SELF_FIRST, } ArkUI_SwiperNestedScrollMode; +/** + * @brief Enumerates the page flipping modes using the mouse wheel for the Swiper component. + * + * @since 14 + */ +typedef enum { + /** When the mouse wheel is scrolled continuously, multiple pages are flipped, which is determined by the number of + * times that mouse events are reported. */ + ARKUI_PAGE_FLIP_MODE_CONTINUOUS = 0, + /** The system does not respond to other mouse wheel events until the page flipping animation ends. */ + ARKUI_PAGE_FLIP_MODE_SINGLE, +} ArkUI_PageFlipMode; + /** * @brief Enumerates the accessibility modes. * -- Gitee From 8623f6f60c313720a316ddf2a8e7213e4d825984 Mon Sep 17 00:00:00 2001 From: lilanqing Date: Thu, 5 Dec 2024 20:15:06 +0800 Subject: [PATCH 491/620] sync Signed-off-by: lilanqing --- .../native/native_interface_xcomponent.h | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/arkui/ace_engine/native/native_interface_xcomponent.h b/arkui/ace_engine/native/native_interface_xcomponent.h index 301d2a6b9..c06d6cec6 100644 --- a/arkui/ace_engine/native/native_interface_xcomponent.h +++ b/arkui/ace_engine/native/native_interface_xcomponent.h @@ -724,6 +724,30 @@ int32_t OH_NativeXComponent_AttachNativeRootNode(OH_NativeXComponent* component, */ int32_t OH_NativeXComponent_DetachNativeRootNode(OH_NativeXComponent* component, ArkUI_NodeHandle root); +/** + * @brief Registers a callback for this OH_NativeXComponent instance. + * + * @param component Indicates the pointer to this OH_NativeXComponent instance. + * @param callback Indicates the pointer to a surface show event callback. + * @return Returns the status code of the execution. + * @since 12 + * @version 1.0 + */ +int32_t OH_NativeXComponent_RegisterSurfaceShowCallback( + OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window)); + +/** + * @brief Registers a callback for this OH_NativeXComponent instance. + * + * @param component Indicates the pointer to this OH_NativeXComponent instance. + * @param callback Indicates the pointer to a surface hide event callback. + * @return Returns the status code of the execution. + * @since 12 + * @version 1.0 + */ +int32_t OH_NativeXComponent_RegisterSurfaceHideCallback( + OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window)); + /** * @brief Registers a UI input event callback for this OH_NativeXComponent instance and enables the callback to * be invoked when a UI input event is received. @@ -753,30 +777,6 @@ int32_t OH_NativeXComponent_RegisterUIInputEventCallback( */ int32_t OH_NativeXComponent_SetNeedSoftKeyboard(OH_NativeXComponent* component, bool needSoftKeyboard); -/** - * @brief Registers a callback for this OH_NativeXComponent instance. - * - * @param component Indicates the pointer to this OH_NativeXComponent instance. - * @param callback Indicates the pointer to a surface show event callback. - * @return Returns the status code of the execution. - * @since 12 - * @version 1.0 - */ -int32_t OH_NativeXComponent_RegisterSurfaceShowCallback( - OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window)); - -/** - * @brief Registers a callback for this OH_NativeXComponent instance. - * - * @param component Indicates the pointer to this OH_NativeXComponent instance. - * @param callback Indicates the pointer to a surface hide event callback. - * @return Returns the status code of the execution. - * @since 12 - * @version 1.0 - */ -int32_t OH_NativeXComponent_RegisterSurfaceHideCallback( - OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window)); - /** * @brief Registers a custom event intercept callback for this OH_NativeXComponent and enables the callback * during the hit test. -- Gitee From 2a9912d9d922e78bcc97dae3400344c3e213567b Mon Sep 17 00:00:00 2001 From: "DESKTOP-H8KLN8I\\lisitao" Date: Thu, 5 Dec 2024 22:22:29 +0800 Subject: [PATCH 492/620] =?UTF-8?q?[L]=20=E4=BF=AE=E6=94=B9c-api=20node=5F?= =?UTF-8?q?z=5Findex=20Signed-off-by:lisitaolisitao3@huawei.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: DESKTOP-H8KLN8I\lisitao --- arkui/ace_engine/native/native_node.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index f20102e7c..5fd1c293c 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -475,10 +475,10 @@ typedef enum { * This attribute can be set, reset, and obtained as required through APIs. * * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n - * .value[0].f32: z-index value. \n + * .value[0].i32: z-index value. \n * \n * Format of the return value {@link ArkUI_AttributeItem}:\n - * .value[0].f32: z-index value. \n + * .value[0].i32: z-index value. \n * */ NODE_Z_INDEX, -- Gitee From c62c7103575bde59076f2600d3a7d6f436cecf7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E5=86=AC=E5=86=AC=E5=86=AC?= Date: Tue, 26 Nov 2024 10:40:15 +0800 Subject: [PATCH 493/620] Message:fixCodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 郑冬冬冬 --- .../hicollie/include/hicollie/hicollie.h | 86 +++++++++++++++++++ hiviewdfx/hicollie/libhicollie.ndk.json | 8 ++ 2 files changed, 94 insertions(+) diff --git a/hiviewdfx/hicollie/include/hicollie/hicollie.h b/hiviewdfx/hicollie/include/hicollie/hicollie.h index 8ad4bddcf..ddf579d30 100644 --- a/hiviewdfx/hicollie/include/hicollie/hicollie.h +++ b/hiviewdfx/hicollie/include/hicollie/hicollie.h @@ -62,6 +62,26 @@ typedef enum HiCollie_ErrorCode { HICOLLIE_WRONG_THREAD_CONTEXT = 29800001, /** Remote call failed */ HICOLLIE_REMOTE_FAILED = 29800002, + /** + * Invalid timer name + * @since 16 + */ + HICOLLIE_INVALID_TIMER_NAME = 29800003, + /** + * Invalid timeout value + * @since 16 + */ + HICOLLIE_INVALID_TIMEOUT_VALUE = 29800004, + /** + * Wrong process context + * @since 16 + */ + HICOLLIE_WRONG_PROCESS_CONTEXT = 29800005, + /** + * The pointer used to save returned timer id should not be NULL + * @since 16 + */ + HICOLLIE_WRONG_TIMER_ID_OUTPUT_PARAM = 29800006, } HiCollie_ErrorCode; /** @@ -154,6 +174,72 @@ HiCollie_ErrorCode OH_HiCollie_Init_JankDetection(OH_HiCollie_BeginFunc* beginFu */ HiCollie_ErrorCode OH_HiCollie_Report(bool* isSixSecond); +/** + * @brief When user call {@link OH_HiCollie_SetTimer} and do not call {@link OH_HiCollie_CancelTimer} + * in specific time, the callback function will be executed. + * + * @since 16 + */ +typedef void (*OH_HiCollie_Callback)(void*); + +/** + * @brief Defines the actions that will be executed when timeout happens. + * + * @since 16 + */ +typedef enum HiCollie_Flag { + /** Default action is generate log file and do recovery */ + HICOLLIE_FLAG_DEFAULT = (~0), + /* Do nothing except call the callback function */ + HICOLLIE_FLAG_NOOP = (0), + /* Generate log file */ + HICOLLIE_FLAG_LOG = (1 << 0), + /* Do recovery by call the exit syscall */ + HICOLLIE_FLAG_RECOVERY = (1 << 1) +} HiCollie_Flag; + +/** +* @brief Defines the input parameter for {@link OH_HiCollie_SetTimer} +* +* @since 16 +*/ +typedef struct HiCollie_SetTimerParam { + /** The timer name */ + const char *name; + /** The timeout threshold in seconds */ + unsigned int timeout; + /** The callback function which is excuted when timeout happen */ + OH_HiCollie_Callback func; + /** The callback function's parameter */ + void *arg; + /** The action when timeout happens. Please refer to {@link HiCollie_Flag} */ + HiCollie_Flag flag; +} HiCollie_SetTimerParam; + +/** + * @brief This function should be used before calling a time-consuming function + * + * @param param Define the input parameter. + * @param id The pointer used to save returned timer id, it should not be NULL. + * @return {@link HICOLLIE_SUCCESS} 0 - Success. + * {@link HICOLLIE_INVALID_TIMER_NAME} 29800003 - Invalid timer name, it should not be NULL or empty string. + * {@link HICOLLIE_INVALID_TIMEOUT_VALUE} 29800004 - Invalid timeout value. + * {@link HICOLLIE_WRONG_PROCESS_CONTEXT} 29800005 - Invalid process context, you should not call it + * from appspawn and native process. + * {@link HICOLLIE_WRONG_TIMER_ID_OUTPUT_PARAM} 29800006 - The pointer used to save returned timer id + * should not be NULL. + * @since 16 + */ +HiCollie_ErrorCode OH_HiCollie_SetTimer(HiCollie_SetTimerParam param, int *id); + +/** + * @brief Cancel the timer right after calling the time-consuming function. + * + * @param id The timer id that is return from {@link OH_HiCollie_SetTimer}. + * @since 16 + */ +void OH_HiCollie_CancelTimer(int id); + #ifdef __cplusplus } #endif diff --git a/hiviewdfx/hicollie/libhicollie.ndk.json b/hiviewdfx/hicollie/libhicollie.ndk.json index 4684c9899..bec806ac1 100644 --- a/hiviewdfx/hicollie/libhicollie.ndk.json +++ b/hiviewdfx/hicollie/libhicollie.ndk.json @@ -10,5 +10,13 @@ { "first_introduced": "12", "name": "OH_HiCollie_Report" + }, + { + "first_introduced": "16", + "name": "OH_HiCollie_SetTimer" + }, + { + "first_introduced": "16", + "name": "OH_HiCollie_CancelTimer" } ] -- Gitee From 58c84e185e270db910af4fd89a06383dccb78225 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Fri, 6 Dec 2024 15:27:35 +0800 Subject: [PATCH 494/620] add drawing_error_code.h Signed-off-by: changleipeng Change-Id: I6083b006cdd57cc05f681c8db094972e22bfbb84 --- graphic/graphic_2d/native_drawing/drawing_rect.h | 1 + 1 file changed, 1 insertion(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_rect.h b/graphic/graphic_2d/native_drawing/drawing_rect.h index 8e6f1ab10..ce02692a2 100644 --- a/graphic/graphic_2d/native_drawing/drawing_rect.h +++ b/graphic/graphic_2d/native_drawing/drawing_rect.h @@ -40,6 +40,7 @@ #ifndef C_INCLUDE_DRAWING_RECT_H #define C_INCLUDE_DRAWING_RECT_H +#include "drawing_error_code.h" #include "drawing_types.h" #ifdef __cplusplus -- Gitee From 3f67a8fcd81bab73933c2792c636c42b7dc3e811 Mon Sep 17 00:00:00 2001 From: duanhan Date: Fri, 6 Dec 2024 15:50:42 +0800 Subject: [PATCH 495/620] 1206 gif api fix Signed-off-by: duanhan --- .../include/image/image_packer_native.h | 28 +++++++++---------- .../image_framework/libimage_packer.ndk.json | 24 ++++++++-------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/multimedia/image_framework/include/image/image_packer_native.h b/multimedia/image_framework/include/image/image_packer_native.h index b80688711..4078a60da 100644 --- a/multimedia/image_framework/include/image/image_packer_native.h +++ b/multimedia/image_framework/include/image/image_packer_native.h @@ -62,14 +62,14 @@ typedef struct OH_PackingOptions OH_PackingOptions; /** * @brief Defines the image sequence packing options. * - * @since 13 + * @since 14 */ struct OH_PackingOptionsForSequence; /** * @brief Defines the image sequence packing options. * - * @since 13 + * @since 14 */ typedef struct OH_PackingOptionsForSequence OH_PackingOptionsForSequence; @@ -203,7 +203,7 @@ Image_ErrorCode OH_PackingOptions_Release(OH_PackingOptions *options); * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options is nullptr. - * @since 13 + * @since 14 */ Image_ErrorCode OH_PackingOptionsForSequence_Create(OH_PackingOptionsForSequence **options); @@ -215,7 +215,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_Create(OH_PackingOptionsForSequence * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options is nullptr. - * @since 13 + * @since 14 */ Image_ErrorCode OH_PackingOptionsForSequence_SetFrameCount(OH_PackingOptionsForSequence *options, uint32_t frameCount); @@ -228,7 +228,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_SetFrameCount(OH_PackingOptionsForS * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options or frameCount is nullptr. - * @since 13 + * @since 14 */ Image_ErrorCode OH_PackingOptionsForSequence_GetFrameCount(OH_PackingOptionsForSequence *options, uint32_t *frameCount); @@ -242,7 +242,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_GetFrameCount(OH_PackingOptionsForS * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options or delayTimeList is nullptr. - * @since 13 + * @since 14 */ Image_ErrorCode OH_PackingOptionsForSequence_SetDelayTimeList(OH_PackingOptionsForSequence *options, int32_t *delayTimeList, size_t delayTimeListLength); @@ -256,7 +256,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_SetDelayTimeList(OH_PackingOptionsF * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options or delayTimeList is nullptr. - * @since 13 + * @since 14 */ Image_ErrorCode OH_PackingOptionsForSequence_GetDelayTimeList(OH_PackingOptionsForSequence *options, int32_t *delayTimeList, size_t delayTimeListLength); @@ -270,7 +270,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_GetDelayTimeList(OH_PackingOptionsF * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options or disposalTypes is nullptr. - * @since 13 + * @since 14 */ Image_ErrorCode OH_PackingOptionsForSequence_SetDisposalTypes(OH_PackingOptionsForSequence *options, uint32_t *disposalTypes, size_t disposalTypesLength); @@ -284,7 +284,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_SetDisposalTypes(OH_PackingOptionsF * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options or disposalTypes is nullptr. - * @since 13 + * @since 14 */ Image_ErrorCode OH_PackingOptionsForSequence_GetDisposalTypes(OH_PackingOptionsForSequence *options, uint32_t *disposalTypes, size_t disposalTypesLength); @@ -297,7 +297,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_GetDisposalTypes(OH_PackingOptionsF * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options is nullptr. - * @since 13 + * @since 14 */ Image_ErrorCode OH_PackingOptionsForSequence_SetLoopCount(OH_PackingOptionsForSequence *options, uint32_t loopCount); @@ -309,7 +309,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_SetLoopCount(OH_PackingOptionsForSe * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options or loopCount is nullptr. - * @since 13 + * @since 14 */ Image_ErrorCode OH_PackingOptionsForSequence_GetLoopCount(OH_PackingOptionsForSequence *options, uint32_t *loopCount); @@ -320,7 +320,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_GetLoopCount(OH_PackingOptionsForSe * @return Image functions result code. * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} options is nullptr. - * @since 13 + * @since 14 */ Image_ErrorCode OH_PackingOptionsForSequence_Release(OH_PackingOptionsForSequence *options); @@ -392,7 +392,7 @@ Image_ErrorCode OH_ImagePackerNative_PackToDataFromPicture(OH_ImagePackerNative * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} one of the pointer type parameters is nullptr, or size/length is invalid * {@link IMAGE_ENCODE_FAILED} encode failed. - * @since 13 + * @since 14 */ Image_ErrorCode OH_ImagePackerNative_PackToDataFromPixelmapSequence(OH_ImagePackerNative *imagePacker, OH_PackingOptionsForSequence *options, OH_PixelmapNative **pixelmapSequence, @@ -452,7 +452,7 @@ Image_ErrorCode OH_ImagePackerNative_PackToFileFromPicture(OH_ImagePackerNative * {@link IMAGE_SUCCESS} if the execution is successful. * {@link IMAGE_BAD_PARAMETER} one of the pointer type parameters is nullptr, or length is invalid * {@link IMAGE_ENCODE_FAILED} encode failed. - * @since 13 + * @since 14 */ Image_ErrorCode OH_ImagePackerNative_PackToFileFromPixelmapSequence(OH_ImagePackerNative *imagePacker, OH_PackingOptionsForSequence *options, OH_PixelmapNative **pixelmapSequence, size_t sequenceLength, int32_t fd); diff --git a/multimedia/image_framework/libimage_packer.ndk.json b/multimedia/image_framework/libimage_packer.ndk.json index c6f243504..913c46360 100644 --- a/multimedia/image_framework/libimage_packer.ndk.json +++ b/multimedia/image_framework/libimage_packer.ndk.json @@ -40,43 +40,43 @@ "name": "OH_PackingOptions_Release" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_PackingOptionsForSequence_Create" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_PackingOptionsForSequence_SetFrameCount" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_PackingOptionsForSequence_GetFrameCount" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_PackingOptionsForSequence_SetDelayTimeList" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_PackingOptionsForSequence_GetDelayTimeList" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_PackingOptionsForSequence_SetDisposalTypes" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_PackingOptionsForSequence_GetDisposalTypes" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_PackingOptionsForSequence_SetLoopCount" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_PackingOptionsForSequence_GetLoopCount" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_PackingOptionsForSequence_Release" }, { @@ -96,7 +96,7 @@ "name": "OH_ImagePackerNative_PackToDataFromPicture" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_ImagePackerNative_PackToDataFromPixelmapSequence" }, { @@ -112,7 +112,7 @@ "name": "OH_ImagePackerNative_PackToFileFromPicture" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_ImagePackerNative_PackToFileFromPixelmapSequence" }, { -- Gitee From e1ea95db51287f49d97ab3ad136ff94ddb8ea0cd Mon Sep 17 00:00:00 2001 From: shenshiyi2 Date: Fri, 6 Dec 2024 16:05:25 +0800 Subject: [PATCH 496/620] =?UTF-8?q?OH=5FPixelmapNative=5FCreateScaledPixel?= =?UTF-8?q?map=E6=8E=A5=E5=8F=A3=E9=87=8D=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenshiyi2 --- multimedia/image_framework/include/image/pixelmap_native.h | 4 ++-- multimedia/image_framework/libpixelmap.ndk.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 858043a65..48cfbdc1e 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -751,7 +751,7 @@ Image_ErrorCode OH_PixelmapNative_ScaleWithAntiAliasing(OH_PixelmapNative *pixel * @see OH_PixelmapNative * @since 16 */ -Image_ErrorCode OH_PixelmapNative_CreateScaledPixelmap(OH_PixelmapNative *srcpixelmap, OH_PixelmapNative **dstpixelmap, +Image_ErrorCode OH_PixelmapNative_CreateScaledPixelMap(OH_PixelmapNative *srcpixelmap, OH_PixelmapNative **dstpixelmap, float scaleX, float scaleY); /** @@ -771,7 +771,7 @@ Image_ErrorCode OH_PixelmapNative_CreateScaledPixelmap(OH_PixelmapNative *srcpix * @see OH_PixelmapNative * @since 16 */ -Image_ErrorCode OH_PixelmapNative_CreateScaledPixelmapWithAntiAliasing(OH_PixelmapNative *srcpixelmap, +Image_ErrorCode OH_PixelmapNative_CreateScaledPixelMapWithAntiAliasing(OH_PixelmapNative *srcpixelmap, OH_PixelmapNative **dstpixelmap, float scaleX, float scaleY, OH_PixelmapNative_AntiAliasingLevel level); /** diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index 8eed2ffed..eb97d0670 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -125,11 +125,11 @@ }, { "first_introduced": "16", - "name": "OH_PixelmapNative_CreateScaledPixelmap" + "name": "OH_PixelmapNative_CreateScaledPixelMap" }, { "first_introduced": "16", - "name": "OH_PixelmapNative_CreateScaledPixelmapWithAntiAliasing" + "name": "OH_PixelmapNative_CreateScaledPixelMapWithAntiAliasing" }, { "first_introduced": "12", -- Gitee From 4ea18519f0190949e92c1bbad4f7a1ae1fd5c159 Mon Sep 17 00:00:00 2001 From: Cai Xincheng Date: Tue, 26 Nov 2024 10:47:30 +0800 Subject: [PATCH 497/620] add group tag Signed-off-by: Cai Xincheng Change-Id: Ifc08e6aad6954e8a8e1c9993afd9a5712929071d --- security/asset/inc/asset_type.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/security/asset/inc/asset_type.h b/security/asset/inc/asset_type.h index 516ba43e2..fc92c4b9b 100755 --- a/security/asset/inc/asset_type.h +++ b/security/asset/inc/asset_type.h @@ -211,6 +211,12 @@ typedef enum { * @since 14 */ ASSET_TAG_REQUIRE_ATTR_ENCRYPTED = ASSET_TYPE_BOOL | 0x47, + /** + * A tag whose value is a byte array indicating the group id an asset belongs to. + * + * @since 16 + */ + ASSET_TAG_GROUP_ID = ASSET_TYPE_BYTES | 0x48, } Asset_Tag; /** -- Gitee From e21d6e17895dfa32900480932459d603670a17b0 Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Sat, 7 Dec 2024 04:04:25 +0000 Subject: [PATCH 498/620] update multimedia/drm_framework/native_mediakeysession.h. Signed-off-by: baoxy92 --- .../drm_framework/native_mediakeysession.h | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/multimedia/drm_framework/native_mediakeysession.h b/multimedia/drm_framework/native_mediakeysession.h index 1eec1dfc3..288dc6a89 100644 --- a/multimedia/drm_framework/native_mediakeysession.h +++ b/multimedia/drm_framework/native_mediakeysession.h @@ -89,7 +89,7 @@ typedef struct MediaKeySession_Callback { /** * @brief Call back will be invoked when event triggers. - * @param mediaKeySessoin MediaKeySession instance. + * @param mediaKeySession MediaKeySession instance. * @param eventType Event type. * @param info Event info gotten from media key session. * @param infoLen Event info len. @@ -98,19 +98,19 @@ typedef struct MediaKeySession_Callback { * @since 12 * @version 1.0 */ -typedef Drm_ErrCode (*OH_MediaKeySession_EventCallback)(MediaKeySession *mediaKeySessoin, DRM_EventType eventType, +typedef Drm_ErrCode (*OH_MediaKeySession_EventCallback)(MediaKeySession *mediaKeySession, DRM_EventType eventType, uint8_t *info, int32_t infoLen, char *extra); /** * @brief Call back will be invoked when key changes. - * @param mediaKeySessoin MediaKeySession instance. + * @param mediaKeySession MediaKeySession instance. * @param keysInfo Key info gotten from media key system. * @param newKeysAvailable Whether new keys available. * @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully. * @since 12 * @version 1.0 */ -typedef Drm_ErrCode (*OH_MediaKeySession_KeyChangeCallback)(MediaKeySession *mediaKeySessoin, DRM_KeysInfo *keysInfo, +typedef Drm_ErrCode (*OH_MediaKeySession_KeyChangeCallback)(MediaKeySession *mediaKeySession, DRM_KeysInfo *keysInfo, bool newKeysAvailable); /** @@ -172,7 +172,7 @@ Drm_ErrCode OH_MediaKeySession_ProcessMediaKeyResponse(MediaKeySession *mediaKey * @since 11 * @version 1.0 */ -Drm_ErrCode OH_MediaKeySession_CheckMediaKeyStatus(MediaKeySession *mediaKeySessoin, +Drm_ErrCode OH_MediaKeySession_CheckMediaKeyStatus(MediaKeySession *mediaKeySession, DRM_MediaKeyStatus *mediaKeyStatus); /** @@ -184,7 +184,7 @@ Drm_ErrCode OH_MediaKeySession_CheckMediaKeyStatus(MediaKeySession *mediaKeySess * @since 11 * @version 1.0 */ -Drm_ErrCode OH_MediaKeySession_ClearMediaKeys(MediaKeySession *mediaKeySessoin); +Drm_ErrCode OH_MediaKeySession_ClearMediaKeys(MediaKeySession *mediaKeySession); /** * @brief Generate offline media key release request. @@ -200,7 +200,7 @@ Drm_ErrCode OH_MediaKeySession_ClearMediaKeys(MediaKeySession *mediaKeySessoin); * @since 11 * @version 1.0 */ -Drm_ErrCode OH_MediaKeySession_GenerateOfflineReleaseRequest(MediaKeySession *mediaKeySessoin, +Drm_ErrCode OH_MediaKeySession_GenerateOfflineReleaseRequest(MediaKeySession *mediaKeySession, uint8_t *offlineMediaKeyId, int32_t offlineMediaKeyIdLen, uint8_t *releaseRequest, int32_t *releaseRequestLen); @@ -217,7 +217,7 @@ Drm_ErrCode OH_MediaKeySession_GenerateOfflineReleaseRequest(MediaKeySession *me * @since 11 * @version 1.0 */ -Drm_ErrCode OH_MediaKeySession_ProcessOfflineReleaseResponse(MediaKeySession *mediaKeySessoin, +Drm_ErrCode OH_MediaKeySession_ProcessOfflineReleaseResponse(MediaKeySession *mediaKeySession, uint8_t *offlineMediaKeyId, int32_t offlineMediaKeyIdLen, uint8_t *releaseReponse, int32_t releaseReponseLen); @@ -232,7 +232,7 @@ Drm_ErrCode OH_MediaKeySession_ProcessOfflineReleaseResponse(MediaKeySession *me * @since 11 * @version 1.0 */ -Drm_ErrCode OH_MediaKeySession_RestoreOfflineMediaKeys(MediaKeySession *mediaKeySessoin, +Drm_ErrCode OH_MediaKeySession_RestoreOfflineMediaKeys(MediaKeySession *mediaKeySession, uint8_t *offlineMediaKeyId, int32_t offlineMediaKeyIdLen); /** @@ -245,7 +245,7 @@ Drm_ErrCode OH_MediaKeySession_RestoreOfflineMediaKeys(MediaKeySession *mediaKey * @since 11 * @version 1.0 */ -Drm_ErrCode OH_MediaKeySession_GetContentProtectionLevel(MediaKeySession *mediaKeySessoin, +Drm_ErrCode OH_MediaKeySession_GetContentProtectionLevel(MediaKeySession *mediaKeySession, DRM_ContentProtectionLevel *contentProtectionLevel); /** @@ -259,7 +259,7 @@ Drm_ErrCode OH_MediaKeySession_GetContentProtectionLevel(MediaKeySession *mediaK * @since 11 * @version 1.0 */ -Drm_ErrCode OH_MediaKeySession_RequireSecureDecoderModule(MediaKeySession *mediaKeySessoin, +Drm_ErrCode OH_MediaKeySession_RequireSecureDecoderModule(MediaKeySession *mediaKeySession, const char *mimeType, bool *status); /** @@ -271,7 +271,7 @@ Drm_ErrCode OH_MediaKeySession_RequireSecureDecoderModule(MediaKeySession *media * @since 11 * @version 1.0 */ -Drm_ErrCode OH_MediaKeySession_SetMediaKeySessionCallback(MediaKeySession *mediaKeySessoin, +Drm_ErrCode OH_MediaKeySession_SetMediaKeySessionCallback(MediaKeySession *mediaKeySession, MediaKeySession_Callback *callback); /** @@ -283,7 +283,7 @@ Drm_ErrCode OH_MediaKeySession_SetMediaKeySessionCallback(MediaKeySession *media * @since 12 * @version 1.0 */ -Drm_ErrCode OH_MediaKeySession_SetCallback(MediaKeySession *mediaKeySessoin, +Drm_ErrCode OH_MediaKeySession_SetCallback(MediaKeySession *mediaKeySession, OH_MediaKeySession_Callback *callback); /** @@ -295,7 +295,7 @@ Drm_ErrCode OH_MediaKeySession_SetCallback(MediaKeySession *mediaKeySessoin, * @since 11 * @version 1.0 */ -Drm_ErrCode OH_MediaKeySession_Destroy(MediaKeySession *mediaKeySessoin); +Drm_ErrCode OH_MediaKeySession_Destroy(MediaKeySession *mediaKeySession); #ifdef __cplusplus } -- Gitee From e37e1e3986a0a6c51fa05b920c53c4952e957a61 Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Sat, 7 Dec 2024 04:04:42 +0000 Subject: [PATCH 499/620] update multimedia/drm_framework/native_mediakeysession.h. Signed-off-by: baoxy92 --- multimedia/drm_framework/native_mediakeysession.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multimedia/drm_framework/native_mediakeysession.h b/multimedia/drm_framework/native_mediakeysession.h index 288dc6a89..97fbb493b 100644 --- a/multimedia/drm_framework/native_mediakeysession.h +++ b/multimedia/drm_framework/native_mediakeysession.h @@ -21,6 +21,8 @@ * @kit DrmKit. * @since 11 * @version 1.0 + * + * @} */ /** -- Gitee From 3928e4ed4a8913bfae1d81d48feaab0d34835b9b Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Sat, 7 Dec 2024 04:05:00 +0000 Subject: [PATCH 500/620] update multimedia/drm_framework/native_mediakeysystem.h. Signed-off-by: baoxy92 --- multimedia/drm_framework/native_mediakeysystem.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multimedia/drm_framework/native_mediakeysystem.h b/multimedia/drm_framework/native_mediakeysystem.h index 966948a64..bac9ac605 100644 --- a/multimedia/drm_framework/native_mediakeysystem.h +++ b/multimedia/drm_framework/native_mediakeysystem.h @@ -21,6 +21,8 @@ * @kit DrmKit. * @since 11 * @version 1.0 + * + * @} */ /** -- Gitee From 4f76443b0476d12018d5877888c1019f56791e86 Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Sat, 7 Dec 2024 04:05:16 +0000 Subject: [PATCH 501/620] update multimedia/drm_framework/common/native_drm_common.h. Signed-off-by: baoxy92 --- multimedia/drm_framework/common/native_drm_common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multimedia/drm_framework/common/native_drm_common.h b/multimedia/drm_framework/common/native_drm_common.h index 410a27f20..9fd6dc7b0 100644 --- a/multimedia/drm_framework/common/native_drm_common.h +++ b/multimedia/drm_framework/common/native_drm_common.h @@ -21,6 +21,8 @@ * @kit DrmKit. * @since 11 * @version 1.0 + * + * @} */ /** -- Gitee From 2cbbd7b31f863a324130c0572826f234567c5c38 Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Sat, 7 Dec 2024 04:05:37 +0000 Subject: [PATCH 502/620] update multimedia/drm_framework/common/native_drm_err.h. Signed-off-by: baoxy92 --- multimedia/drm_framework/common/native_drm_err.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multimedia/drm_framework/common/native_drm_err.h b/multimedia/drm_framework/common/native_drm_err.h index cb946274e..843151fe4 100644 --- a/multimedia/drm_framework/common/native_drm_err.h +++ b/multimedia/drm_framework/common/native_drm_err.h @@ -21,6 +21,8 @@ * @kit DrmKit. * @since 11 * @version 1.0 + * + * @} */ /** -- Gitee From 4eedd2fdf9339748ca33c0676daa2bbd68a34acc Mon Sep 17 00:00:00 2001 From: sun-xinyan Date: Sat, 7 Dec 2024 22:06:09 +0800 Subject: [PATCH 503/620] =?UTF-8?q?c=20api=20lint=20=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sun-xinyan Change-Id: I87ba7183c578949e04d449c084704b19f7439a12 --- arkui/ace_engine/native/native_animate.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/arkui/ace_engine/native/native_animate.h b/arkui/ace_engine/native/native_animate.h index bd5c9303e..1538ee9c5 100644 --- a/arkui/ace_engine/native/native_animate.h +++ b/arkui/ace_engine/native/native_animate.h @@ -936,6 +936,7 @@ int32_t OH_ArkUI_Animator_Reverse(ArkUI_AnimatorHandle animatorHandle); * @param curve Indicates the curve type. * @return Returns the pointer to the interpolation object of the curve. * Returns NULL if a parameter error occurs. + * @since 12 */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCurveByType(ArkUI_AnimationCurve curve); @@ -947,6 +948,7 @@ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCurveByType(ArkUI_AnimationCurve curve); * true: Jumping occurs when the interpolation ends. false: Jumping occurs when the interpolation starts. * @return Returns the pointer to the interpolation object of the curve. * Returns NULL if a parameter error occurs. + * @since 12 */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateStepsCurve(int32_t count, bool end); @@ -962,6 +964,7 @@ ArkUI_CurveHandle OH_ArkUI_Curve_CreateStepsCurve(int32_t count, bool end); * @param y2 Indicates the Y coordinate of the second point on the Bezier curve. * @return Returns the pointer to the interpolation object of the curve. * Returns NULL if a parameter error occurs. + * @since 12 */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCubicBezierCurve(float x1, float y1, float x2, float y2); @@ -983,6 +986,7 @@ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCubicBezierCurve(float x1, float y1, floa * the oscillation amplitude. * @return Returns the pointer to the interpolation object of the curve. * Returns NULL if a parameter error occurs. + * @since 12 */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringCurve(float velocity, float mass, float stiffness, float damping); @@ -1002,6 +1006,7 @@ ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringCurve(float velocity, float mass, f * transit smoothly over this duration if they are different. * @return Returns the pointer to the interpolation object of the curve. * Returns NULL if a parameter error occurs. + * @since 12 */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringMotion(float response, float dampingFraction, float overlapDuration); @@ -1021,6 +1026,7 @@ ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringMotion(float response, float dampin * transit smoothly over this duration if they are different. * @return Returns the pointer to the interpolation object of the curve. * Returns NULL if a parameter error occurs. + * @since 12 */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateResponsiveSpringMotion( float response, float dampingFraction, float overlapDuration); @@ -1047,6 +1053,7 @@ ArkUI_CurveHandle OH_ArkUI_Curve_CreateResponsiveSpringMotion( * the oscillation amplitude. * @return Returns the pointer to the interpolation object of the curve. * Returns NULL if a parameter error occurs. + * @since 12 */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateInterpolatingSpring(float velocity, float mass, float stiffness, float damping); @@ -1064,6 +1071,7 @@ ArkUI_CurveHandle OH_ArkUI_Curve_CreateInterpolatingSpring(float velocity, float * which will result in an effect of transition from that end value to the value of the state variable. * @return Returns the pointer to the interpolation object of the curve. * Returns NULL if a parameter error occurs. + * @since 12 */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCustomCurve( void* userData, float (*interpolate)(float fraction, void* userdata)); @@ -1071,7 +1079,8 @@ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCustomCurve( /** * @brief Disposes of a custom curve. * - * @param curve Indicates the pointer to the interpolation object of the curve. + * @param curveHandle Indicates the pointer to the interpolation object of the curve. + * @since 12 */ void OH_ArkUI_Curve_DisposeCurve(ArkUI_CurveHandle curveHandle); @@ -1179,4 +1188,5 @@ int32_t OH_ArkUI_TransitionEffect_SetAnimation( }; #endif -#endif // ARKUI_NATIVE_ANIMATE_H \ No newline at end of file +#endif // ARKUI_NATIVE_ANIMATE_H +/** @}*/ \ No newline at end of file -- Gitee From ee67e8ff7ef7d92178c01fa363495a85a7ddca59 Mon Sep 17 00:00:00 2001 From: shenshiyi2 Date: Sun, 8 Dec 2024 09:10:32 +0000 Subject: [PATCH 504/620] update multimedia/image_framework/include/image/pixelmap_native.h. Signed-off-by: shenshiyi2 --- .../image_framework/include/image/pixelmap_native.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 48cfbdc1e..6e46e7e58 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -951,17 +951,17 @@ Image_ErrorCode OH_PixelmapNative_SetMemoryName(OH_PixelmapNative *pixelmap, cha Image_ErrorCode OH_PixelmapNative_GetByteCount(OH_PixelmapNative *pixelmap, uint32_t *byteCount); /** - * @brief Get the capacity of the Pixelmap, which is the number of bytes allocated by the Pixelmap. + * @brief Get the size of the allocated memory used to store this pixelmap's pixels. * * @param pixelmap The Pixelmap pointer to be operated. - * @param capacity The capacity to be retrieved. + * @param allocationByteCount The size of the allocated memory. * @return Function result code: * {@link IMAGE_SUCCESS} If the operation is successful. - * {@link IMAGE_BAD_PARAMETER} If invalid parameter, pixelmap or byteCount are invalid. + * {@link IMAGE_BAD_PARAMETER} If invalid parameter, pixelmap or allocationByteCount are invalid. * @see OH_PixelmapNative * @since 16 */ -Image_ErrorCode OH_PixelmapNative_GetCapacity(OH_PixelmapNative *pixelmap, uint32_t *capacity); +Image_ErrorCode OH_PixelmapNative_GetAllocationByteCount(OH_PixelmapNative *pixelmap, uint32_t *allocationByteCount); #ifdef __cplusplus }; -- Gitee From 6d6a1202e6ad08089fa8bd34107b77489ba91d97 Mon Sep 17 00:00:00 2001 From: shenshiyi2 Date: Sun, 8 Dec 2024 09:10:53 +0000 Subject: [PATCH 505/620] update multimedia/image_framework/libpixelmap.ndk.json. Signed-off-by: shenshiyi2 --- multimedia/image_framework/libpixelmap.ndk.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index eb97d0670..d6f723b63 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -197,6 +197,6 @@ }, { "first_introduced": "16", - "name": "OH_PixelmapNative_GetCapacity" + "name": "OH_PixelmapNative_GetAllocationByteCount" } ] \ No newline at end of file -- Gitee From e163a45881bf4423bb785ed7948763f74bc76dc3 Mon Sep 17 00:00:00 2001 From: shenshiyi2 Date: Mon, 9 Dec 2024 09:19:39 +0800 Subject: [PATCH 506/620] =?UTF-8?q?CreateScaledPixelMap=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=94=B9=E4=B8=BA=E9=A9=BC=E5=B3=B0=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenshiyi2 --- .../include/image/pixelmap_native.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 6e46e7e58..5f1a289f5 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -741,8 +741,8 @@ Image_ErrorCode OH_PixelmapNative_ScaleWithAntiAliasing(OH_PixelmapNative *pixel /** * @brief Create a scaled pixelmap based on the source pixelmap and the input width and height. * - * @param srcpixelmap The source native pixelmap. - * @param dstpixelmap The destination native pixelmap for create. + * @param srcPixelmap The source native pixelmap. + * @param dstPixelmap The destination native pixelmap for create. * @param scaleX Scaling ratio of the width. * @param scaleY Scaling ratio of the height. * @return Function result code: @@ -751,14 +751,14 @@ Image_ErrorCode OH_PixelmapNative_ScaleWithAntiAliasing(OH_PixelmapNative *pixel * @see OH_PixelmapNative * @since 16 */ -Image_ErrorCode OH_PixelmapNative_CreateScaledPixelMap(OH_PixelmapNative *srcpixelmap, OH_PixelmapNative **dstpixelmap, +Image_ErrorCode OH_PixelmapNative_CreateScaledPixelMap(OH_PixelmapNative *srcPixelmap, OH_PixelmapNative **dstPixelmap, float scaleX, float scaleY); /** * @brief Create a scaled pixelmap based on the source pixelmap and the input width and height with anti-aliasing. * - * @param srcpixelmap The source native pixelmap. - * @param dstpixelmap The destination native pixelmap for create. + * @param srcPixelmap The source native pixelmap. + * @param dstPixelmap The destination native pixelmap for create. * @param scaleX Scaling ratio of the width. * @param scaleY Scaling ratio of the height. * @param level The anti-aliasing algorithm to be used. @@ -771,8 +771,8 @@ Image_ErrorCode OH_PixelmapNative_CreateScaledPixelMap(OH_PixelmapNative *srcpix * @see OH_PixelmapNative * @since 16 */ -Image_ErrorCode OH_PixelmapNative_CreateScaledPixelMapWithAntiAliasing(OH_PixelmapNative *srcpixelmap, - OH_PixelmapNative **dstpixelmap, float scaleX, float scaleY, OH_PixelmapNative_AntiAliasingLevel level); +Image_ErrorCode OH_PixelmapNative_CreateScaledPixelMapWithAntiAliasing(OH_PixelmapNative *srcPixelmap, + OH_PixelmapNative **dstPixelmap, float scaleX, float scaleY, OH_PixelmapNative_AntiAliasingLevel level); /** * @brief Translates this image based on the input coordinates. -- Gitee From 5fc00e76e43f3c46944d9e572f86eba068015931 Mon Sep 17 00:00:00 2001 From: liyang Date: Mon, 9 Dec 2024 10:57:33 +0800 Subject: [PATCH 507/620] =?UTF-8?q?screencapture=E6=8E=A5=E5=8F=A3=20doc?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=92=8C=E5=8F=82=E6=95=B0=E5=90=8D=E4=B8=8D?= =?UTF-8?q?=E7=AC=A6=20api=20init=E5=91=8A=E8=AD=A6=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liyang --- multimedia/player_framework/native_avscreen_capture.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index 48af8569d..a58f46164 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -374,8 +374,8 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ExcludeContent(struct OH_AVScreen * @brief Add Window content to the screen capture content filter * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param filter Pointer to an OH_AVScreenCapture_ContentFilter instance - * @param Pointer to windowIDs to be added - * @param windowCount to be added + * @param windowIDs Pointer to windowIDs to be added + * @param windowCount length of windowID list * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 12 @@ -404,8 +404,8 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ResizeCanvas(struct OH_AVScreenCa * @brief skip some windows' privacy mode of current app during the screen recording * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance - * @param Pointer of windowID list - * @param length of windowID list + * @param windowIDs Pointer of windowID list + * @param windowCount length of windowID list * @return Function result code. * {@link AV_SCREEN_CAPTURE_ERR_OK} if the execution is successful. * {@link AV_SCREEN_CAPTURE_ERR_INVALID_VAL} input capture is nullptr or input windowIDs are not belong current @@ -421,7 +421,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SkipPrivacyMode(struct OH_AVScree * @brief set up the max number of video frame per second * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance - * @param max frame rate of video + * @param frameRate max frame rate of video * @return Function result code. * {@link AV_SCREEN_CAPTURE_ERR_OK} if the execution is successful. * {@link AV_SCREEN_CAPTURE_ERR_INVALID_VAL} input capture is nullptr or frameRate is not support. -- Gitee From 5da51ac33b1058527e65babfcc5b9c65e6c51852 Mon Sep 17 00:00:00 2001 From: liuweili Date: Thu, 28 Nov 2024 19:58:14 +0800 Subject: [PATCH 508/620] Add JSVM_API to Private and External String Signed-off-by: yanghaiming --- ark_runtime/jsvm/jsvm.h | 162 ++++++++++++++++++++++++++++++ ark_runtime/jsvm/jsvm_types.h | 7 ++ ark_runtime/jsvm/libjsvm.ndk.json | 32 ++++++ 3 files changed, 201 insertions(+) diff --git a/ark_runtime/jsvm/jsvm.h b/ark_runtime/jsvm/jsvm.h index b5771f107..830971a20 100644 --- a/ark_runtime/jsvm/jsvm.h +++ b/ark_runtime/jsvm/jsvm.h @@ -3045,6 +3045,168 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateWasmCache(JSVM_Env env, JSVM_EXTERN JSVM_Status OH_JSVM_ReleaseCache(JSVM_Env env, const uint8_t* cacheData, JSVM_CacheType cacheType); + +/** + * @brief This API creates an external JavaScript string value from an ISO-8859-1-encoded C + * string. The native string is copied when failed to create external string. + * + * @param env The environment that the API is invoked under. + * @param str Character buffer representing an ISO-8859-1-encoded string. + * @param length The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated. + * @param finalizeCallback Optional callback to call when the external value is being collected. + * JSVM_Finalize provides more details. + * @param finalizeHint Optional hint to pass to the finalize callback during collection. + * @param result A JSVM_Value representing a JavaScript external string. + * @param copied flag indicate whether the external string is successfully created, + * true for faild to create external ones and fall back to non-external strings, false for success. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if one of env, str and copied is NULL.\n + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_CreateExternalStringLatin1(JSVM_Env env, + char* str, + size_t length, + JSVM_Finalize finalizeCallback, + void* finalizeHint, + JSVM_Value* result, + bool* copied); + +/** + * @brief This API creates an external JavaScript string value from an UTF16-LE-encoded C + * string. The native string is copied when failed to create external string. + * + * @param env The environment that the API is invoked under. + * @param str Character buffer representing an UTF16-LE-encoded string. + * @param length The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated. + * @param finalizeCallback Optional callback to call when the external value is being collected. + * JSVM_Finalize provides more details. + * @param finalizeHint Optional hint to pass to the finalize callback during collection. + * @param result A JSVM_Value representing a JavaScript external string. + * @param copied flag indicate whether the external string is successfully created, + * true for faild to create external ones and fall back to non-external strings, false for success. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if one of env, str and copied is NULL.\n + * @since 16 + */ + +JSVM_EXTERN JSVM_Status OH_JSVM_CreateExternalStringUtf16(JSVM_Env env, + char16_t* str, + size_t length, + JSVM_Finalize finalizeCallback, + void* finalizeHint, + JSVM_Value* result, + bool* copied); + +/** + * @brief This API creates a JavaScript private key. + * + * @param env The environment that the API is invoked under. + * @param description Optional JSVM_Value which refers to a JavaScript string to be set as the description + * for the private key. + * @param result A JSVM_Data representing a JavaScript private key. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if env or result is NULL.\n + * {@link JSVM_STRING_EXPECTED } if the description is not a string.\n + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_CreatePrivate(JSVM_Env env, + JSVM_Value description, + JSVM_Data* result); + +/** + * @brief This API set a private property on the Object passed in. + * + * @param env The environment that the API is invoked under. + * @param object The object on which to set the private property. + * @param key The private key of the property. + * @param value The private property value. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the arguments is NULL or the key is not a private key.\n + * {@link JSVM_OBJECT_EXPECTED } object passed in is not a real object.\n + * {@link JSVM_GENERIC_FAILURE } if failed to set the private key but no exception is pending.\n + * {@link JSVM_PENDING_EXCPTION } if an exception occurs.\n + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_SetPrivate(JSVM_Env env, + JSVM_Value object, + JSVM_Data key, + JSVM_Value value); + +/** + * @brief This API gets the requested private property from the Object passed in. + * + * @param env The environment that the API is invoked under. + * @param object The object from which to retrieve the private property. + * @param key The private key of the property. + * @param result The value of the private property. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the arguments is NULL or the key is not a private key.\n + * {@link JSVM_OBJECT_EXPECTED } object passed in is not a real object.\n + * {@link JSVM_GENERIC_FAILURE } if failed to get the private key but no exception is pending.\n + * {@link JSVM_PENDING_EXCPTION } if an exception occurs.\n + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_GetPrivate(JSVM_Env env, + JSVM_Value object, + JSVM_Data key, + JSVM_Value *result); + +/** + * @brief This API attempts to delete the property of the private key from object. + * + * @param env The environment that the API is invoked under. + * @param object The object to query. + * @param key The private key of the property to delete. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the arguments is NULL or the key is not a private key.\n + * {@link JSVM_OBJECT_EXPECTED } object passed in is not a real object.\n + * {@link JSVM_GENERIC_FAILURE } if failed to delete the private key but no exception is pending.\n + * {@link JSVM_PENDING_EXCPTION } if an exception occurs.\n + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_DeletePrivate(JSVM_Env env, + JSVM_Value object, + JSVM_Data key); + +/** + * @brief This API creates a new reference with the specified reference count to the data passed in. + * + * @param env The environment that the API is invoked under. + * @param data The JSVM_Data for which a reference is being created. + * @param initialRefcount Initial reference count for the new reference. + * @param result JSVM_Ref pointing to the new reference. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any parameter is null or the value of initialRefcount is 0.\n + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_CreateDataReference(JSVM_Env env, + JSVM_Data data, + uint32_t initialRefcount, + JSVM_Ref* result); + +/** + * @brief If still valid, this API returns the JSVM_Data representing the + * JavaScript data associated with the JSVM_Ref. Otherwise, result will be NULL. + * + * @param env The environment that the API is invoked under. + * @param ref The JSVM_Ref for which the corresponding value is being requested. + * @param result The JSVM_Data referenced by the JSVM_Ref. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any parameter is null or the ref is not a reference to JSVM_Data.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_GetReferenceData(JSVM_Env env, + JSVM_Ref ref, + JSVM_Data* result); EXTERN_C_END /** @} */ #endif /* ARK_RUNTIME_JSVM_JSVM_H */ diff --git a/ark_runtime/jsvm/jsvm_types.h b/ark_runtime/jsvm/jsvm_types.h index 4ee1793b3..9c834bc11 100644 --- a/ark_runtime/jsvm/jsvm_types.h +++ b/ark_runtime/jsvm/jsvm_types.h @@ -770,6 +770,13 @@ typedef enum { /** WebAssembly cache, generated by OH_JSVM_CreateWasmCache */ JSVM_CACHE_TYPE_WASM, } JSVM_CacheType; + +/** + * @brief To represent a JavaScript Data type. + * + * @since 16 + */ +typedef struct JSVM_Data__* JSVM_Data; /** @} */ #endif /* ARK_RUNTIME_JSVM_JSVM_TYPE_H */ diff --git a/ark_runtime/jsvm/libjsvm.ndk.json b/ark_runtime/jsvm/libjsvm.ndk.json index e0157b772..ea0cb6092 100644 --- a/ark_runtime/jsvm/libjsvm.ndk.json +++ b/ark_runtime/jsvm/libjsvm.ndk.json @@ -734,5 +734,37 @@ { "first_introduced": "12", "name": "OH_JSVM_ReleaseCache" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_CreateExternalStringLatin1" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_CreateExternalStringUtf16" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_CreatePrivate" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_SetPrivate" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_GetPrivate" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_DeletePrivate" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_CreateDataReference" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_GetReferenceData" } ] -- Gitee From 41fb36411c193712455ce5c62a711de5df5c3723 Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Mon, 9 Dec 2024 07:08:46 +0000 Subject: [PATCH 509/620] update multimedia/drm_framework/common/native_drm_common.h. Signed-off-by: baoxy92 --- multimedia/drm_framework/common/native_drm_common.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/multimedia/drm_framework/common/native_drm_common.h b/multimedia/drm_framework/common/native_drm_common.h index 9fd6dc7b0..956498448 100644 --- a/multimedia/drm_framework/common/native_drm_common.h +++ b/multimedia/drm_framework/common/native_drm_common.h @@ -21,8 +21,6 @@ * @kit DrmKit. * @since 11 * @version 1.0 - * - * @} */ /** @@ -538,4 +536,5 @@ typedef struct DRM_MediaKeySystemDescription { } #endif -#endif // NATIVE_DRM_COMMON_H \ No newline at end of file +#endif // NATIVE_DRM_COMMON_H +/** @} */ \ No newline at end of file -- Gitee From ea4725a273bec30ebfb45508e6bcda075cc236c5 Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Mon, 9 Dec 2024 07:09:10 +0000 Subject: [PATCH 510/620] update multimedia/drm_framework/common/native_drm_err.h. Signed-off-by: baoxy92 --- multimedia/drm_framework/common/native_drm_err.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/multimedia/drm_framework/common/native_drm_err.h b/multimedia/drm_framework/common/native_drm_err.h index 843151fe4..882cf41be 100644 --- a/multimedia/drm_framework/common/native_drm_err.h +++ b/multimedia/drm_framework/common/native_drm_err.h @@ -21,8 +21,6 @@ * @kit DrmKit. * @since 11 * @version 1.0 - * - * @} */ /** @@ -114,3 +112,4 @@ typedef enum Drm_ErrCode { #endif #endif // NATIVE_DRM_ERR_H +/** @} */ \ No newline at end of file -- Gitee From bcbd3a909fa7c71993236484f85f137a23f1d055 Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Mon, 9 Dec 2024 07:09:30 +0000 Subject: [PATCH 511/620] update multimedia/drm_framework/native_mediakeysession.h. Signed-off-by: baoxy92 --- multimedia/drm_framework/native_mediakeysession.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/multimedia/drm_framework/native_mediakeysession.h b/multimedia/drm_framework/native_mediakeysession.h index 97fbb493b..2d5b72dd7 100644 --- a/multimedia/drm_framework/native_mediakeysession.h +++ b/multimedia/drm_framework/native_mediakeysession.h @@ -21,8 +21,6 @@ * @kit DrmKit. * @since 11 * @version 1.0 - * - * @} */ /** @@ -304,3 +302,4 @@ Drm_ErrCode OH_MediaKeySession_Destroy(MediaKeySession *mediaKeySession); #endif #endif // OHOS_DRM_NATIVE_MEDIA_KEY_SYSTEM_H +/** @} */ \ No newline at end of file -- Gitee From b645efc923fe846df10c6dbc2061eeaee24956a6 Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Mon, 9 Dec 2024 07:10:02 +0000 Subject: [PATCH 512/620] update multimedia/drm_framework/native_mediakeysystem.h. Signed-off-by: baoxy92 --- multimedia/drm_framework/native_mediakeysystem.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/multimedia/drm_framework/native_mediakeysystem.h b/multimedia/drm_framework/native_mediakeysystem.h index bac9ac605..d2f35fc90 100644 --- a/multimedia/drm_framework/native_mediakeysystem.h +++ b/multimedia/drm_framework/native_mediakeysystem.h @@ -21,8 +21,6 @@ * @kit DrmKit. * @since 11 * @version 1.0 - * - * @} */ /** @@ -364,3 +362,4 @@ Drm_ErrCode OH_MediaKeySystem_Destroy(MediaKeySystem *mediaKeySystem); #endif #endif // OHOS_DRM_NATIVE_MEDIA_KEY_SYSTEM_H +/** @} */ \ No newline at end of file -- Gitee From 199b0ca0aa797eaf03d569a26af0018a1201ebed Mon Sep 17 00:00:00 2001 From: wanglingyi Date: Mon, 9 Dec 2024 15:44:03 +0800 Subject: [PATCH 513/620] 1209 Signed-off-by: wanglingyi --- multimedia/player_framework/avplayer.h | 3 ++- multimedia/player_framework/avplayer_base.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h index ce355909a..8cdba3b86 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -19,7 +19,7 @@ * * @brief Provides APIs of Playback capability for Media Source. * - * @Syscap SystemCapability.Multimedia.Media.AVPlayer + * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since 11 * @version 1.0 */ @@ -596,3 +596,4 @@ OH_AVErrCode OH_AVPlayer_SetOnErrorCallback(OH_AVPlayer *player, OH_AVPlayerOnEr #endif #endif // MULTIMEDIA_PLAYER_FRAMEWORK_NATIVE_AVPLAYER_H +/** @} */ \ No newline at end of file diff --git a/multimedia/player_framework/avplayer_base.h b/multimedia/player_framework/avplayer_base.h index 8a3b311fc..f3306fa35 100644 --- a/multimedia/player_framework/avplayer_base.h +++ b/multimedia/player_framework/avplayer_base.h @@ -19,7 +19,7 @@ * * @brief Provides APIs of Playback capability for Media Source. * - * @Syscap SystemCapability.Multimedia.Media.AVPlayer + * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since 11 * @version 1.0 */ @@ -426,3 +426,4 @@ typedef struct AVPlayerCallback { } #endif #endif // MULTIMEDIA_PLAYER_FRAMEWORK_NATIVE_AVPLAYER_BASH_H +/** @} */ \ No newline at end of file -- Gitee From 56f2f6d66358d52784c2e40bdfc5360bdbb10e88 Mon Sep 17 00:00:00 2001 From: shenshiyi2 Date: Mon, 9 Dec 2024 15:47:26 +0800 Subject: [PATCH 514/620] =?UTF-8?q?OH=5FPixelmapNative=5FCreateScaledPixel?= =?UTF-8?q?MapWithAntiAliasing=E6=8E=A5=E5=8F=A3=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenshiyi2 --- multimedia/image_framework/include/image/pixelmap_native.h | 1 - 1 file changed, 1 deletion(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 5f1a289f5..8430d4673 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -767,7 +767,6 @@ Image_ErrorCode OH_PixelmapNative_CreateScaledPixelMap(OH_PixelmapNative *srcPix * {@link IMAGE_BAD_PARAMETER} If the param is nullptr or invalid. * {@link IMAGE_TOO_LARGE} If image is too large. * {@link IMAGE_ALLOC_FAILED} If device has no memory. - * {@link IMAGE_UNKNOWN_ERROR} Inner unknown error, maybe source pixelmap is released. * @see OH_PixelmapNative * @since 16 */ -- Gitee From 922d4dc8fd6031f75fbae0ce77fbfbecca073b94 Mon Sep 17 00:00:00 2001 From: zhenghongda <13135671+zhenghongda@user.noreply.gitee.com> Date: Mon, 9 Dec 2024 07:58:49 +0000 Subject: [PATCH 515/620] The cenc module api link problem has been solved Signed-off-by: zhenghongda --- multimedia/av_codec/native_cencinfo.h | 1 + 1 file changed, 1 insertion(+) diff --git a/multimedia/av_codec/native_cencinfo.h b/multimedia/av_codec/native_cencinfo.h index f0a5a8e8c..14e84db52 100644 --- a/multimedia/av_codec/native_cencinfo.h +++ b/multimedia/av_codec/native_cencinfo.h @@ -246,3 +246,4 @@ OH_AVErrCode OH_AVCencInfo_SetAVBuffer(OH_AVCencInfo *cencInfo, OH_AVBuffer *buf #endif #endif // NATIVE_AVCENCINFO_H +/** @} */ \ No newline at end of file -- Gitee From d026542975150a3b64b1485f64467a5d7ce385e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E5=BE=AE?= Date: Mon, 9 Dec 2024 16:42:27 +0800 Subject: [PATCH 516/620] [localSDKc2] add addtogroup title in sdk_c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王子微 --- multimedia/av_codec/native_avcapability.h | 13 ++++++++++++- multimedia/av_codec/native_avcodec_base.h | 12 ++++++++++++ multimedia/av_codec/native_avcodec_videodecoder.h | 14 +++++++++++++- multimedia/av_codec/native_avcodec_videoencoder.h | 13 ++++++++++++- multimedia/av_codec/native_avdemuxer.h | 11 +++++++++++ multimedia/av_codec/native_avsource.h | 13 ++++++++++++- multimedia/media_foundation/native_avbuffer.h | 12 ++++++++++++ multimedia/media_foundation/native_avbuffer_info.h | 12 ++++++++++++ multimedia/media_foundation/native_averrors.h | 12 ++++++++++++ multimedia/media_foundation/native_avformat.h | 14 +++++++++++++- multimedia/media_foundation/native_avmemory.h | 12 ++++++++++++ 11 files changed, 133 insertions(+), 5 deletions(-) diff --git a/multimedia/av_codec/native_avcapability.h b/multimedia/av_codec/native_avcapability.h index 5f30e6c92..8d01314d2 100644 --- a/multimedia/av_codec/native_avcapability.h +++ b/multimedia/av_codec/native_avcapability.h @@ -13,6 +13,16 @@ * limitations under the License. */ +/** + * @addtogroup AVCapability + * @{ + * + * @brief The AVCapability module provide functions for querying encoding and decoding capabilities. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 10 + */ + /** * @file native_avcapability.h * @@ -437,4 +447,5 @@ OH_AVFormat *OH_AVCapability_GetFeatureProperties(OH_AVCapability *capability, O #ifdef __cplusplus } #endif -#endif // NATIVE_AVCAPABILITY_H \ No newline at end of file +#endif // NATIVE_AVCAPABILITY_H +/** @} */ \ No newline at end of file diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 147a7268e..f1189f430 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -13,6 +13,17 @@ * limitations under the License. */ +/** + * @addtogroup CodecBase + * @{ + * + * @brief The CodecBase module provide variables, properties, and functions + * for audio and video muxer, demuxer, and basic encoding and decoding functions. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 9 + */ + /** * @file native_avcodec_base.h * @@ -1229,3 +1240,4 @@ typedef enum OH_TemporalGopReferenceMode { #endif #endif // NATIVE_AVCODEC_BASE_H +/** @} */ \ No newline at end of file diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index f4b58bcbc..03419364f 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -13,6 +13,17 @@ * limitations under the License. */ +/** + * @addtogroup VideoDecoder + * @{ + * + * @brief The VideoDecoder module provide interfaces for video decoding + * + * @syscap SystemCapability.Multimedia.Media.VideoDecoder + * @since 9 + * @version 1.0 + */ + /** * @file native_avcodec_videodecoder.h * @@ -460,4 +471,5 @@ OH_AVErrCode OH_VideoDecoder_SetDecryptionConfig(OH_AVCodec *codec, MediaKeySess } #endif -#endif // NATIVE_AVCODEC_VIDEODECODER_H \ No newline at end of file +#endif // NATIVE_AVCODEC_VIDEODECODER_H +/** @} */ \ No newline at end of file diff --git a/multimedia/av_codec/native_avcodec_videoencoder.h b/multimedia/av_codec/native_avcodec_videoencoder.h index e66569f4f..5f12a3c05 100644 --- a/multimedia/av_codec/native_avcodec_videoencoder.h +++ b/multimedia/av_codec/native_avcodec_videoencoder.h @@ -13,6 +13,16 @@ * limitations under the License. */ +/** + * @addtogroup VideoEncoder + * @{ + * + * @brief The VideoEncoder module provide interfaces for video encoding + * + * @syscap SystemCapability.Multimedia.VideoEncoder + * @since 9 + */ + /** * @file native_avcodec_videoencoder.h * @@ -443,4 +453,5 @@ typedef enum OH_VideoEncodeBitrateMode { } #endif -#endif // NATIVE_AVCODEC_VIDEOENCODER_H \ No newline at end of file +#endif // NATIVE_AVCODEC_VIDEOENCODER_H +/** @} */ \ No newline at end of file diff --git a/multimedia/av_codec/native_avdemuxer.h b/multimedia/av_codec/native_avdemuxer.h index 491352815..841f60eca 100644 --- a/multimedia/av_codec/native_avdemuxer.h +++ b/multimedia/av_codec/native_avdemuxer.h @@ -13,6 +13,16 @@ * limitations under the License. */ +/** + * @addtogroup AVDemuxer + * @{ + * + * @brief The AVDemuxer module provide an interface for extracting samples from media file streams. + * + * @syscap SystemCapability.Multimedia.Media.Spliter + * @since 10 + */ + /** * @file native_avdemuxer.h * @@ -228,3 +238,4 @@ OH_AVErrCode OH_AVDemuxer_GetMediaKeySystemInfo(OH_AVDemuxer *demuxer, DRM_Media #endif #endif // NATIVE_AVDEMUXER_H +/** @} */ diff --git a/multimedia/av_codec/native_avsource.h b/multimedia/av_codec/native_avsource.h index acda07885..7120f8806 100644 --- a/multimedia/av_codec/native_avsource.h +++ b/multimedia/av_codec/native_avsource.h @@ -13,6 +13,16 @@ * limitations under the License. */ +/** + * @addtogroup AVSource + * @{ + * + * @brief The AVSource module provide functions for constructing media resource object functionality. + * + * @syscap SystemCapability.Multimedia.Media.Spliter + * @since 10 + */ + /** * @file native_avsource.h * @@ -127,4 +137,5 @@ OH_AVFormat *OH_AVSource_GetTrackFormat(OH_AVSource *source, uint32_t trackIndex } #endif -#endif // NATIVE_AVSOURCE_H \ No newline at end of file +#endif // NATIVE_AVSOURCE_H +/** @} */ \ No newline at end of file diff --git a/multimedia/media_foundation/native_avbuffer.h b/multimedia/media_foundation/native_avbuffer.h index 726f06c4f..7db2d5397 100644 --- a/multimedia/media_foundation/native_avbuffer.h +++ b/multimedia/media_foundation/native_avbuffer.h @@ -13,6 +13,17 @@ * limitations under the License. */ +/** + * @addtogroup Core + * @{ + * + * @brief The Core module provides basic backbone capabilities for media frameworks, + * including functions such as memory, error codes, and media data structures. + * + * @syscap SystemCapability.Multimedia.Media.Core + * @since 9 + */ + /** * @file native_avbuffer.h * @@ -166,3 +177,4 @@ OH_NativeBuffer *OH_AVBuffer_GetNativeBuffer(OH_AVBuffer *buffer); #endif #endif // NATIVE_AVBUFFER_H +/** @} */ \ No newline at end of file diff --git a/multimedia/media_foundation/native_avbuffer_info.h b/multimedia/media_foundation/native_avbuffer_info.h index afd1ce3bd..14d3a95a4 100644 --- a/multimedia/media_foundation/native_avbuffer_info.h +++ b/multimedia/media_foundation/native_avbuffer_info.h @@ -13,6 +13,17 @@ * limitations under the License. */ +/** + * @addtogroup Core + * @{ + * + * @brief The Core module provides basic backbone capabilities for media frameworks, + * including functions such as memory, error codes, and media data structures. + * + * @syscap SystemCapability.Multimedia.Media.Core + * @since 9 + */ + /** * @file native_avbuffer_info.h * @@ -81,3 +92,4 @@ typedef struct OH_AVCodecBufferAttr { #endif #endif // NATIVE_AVBUFFER_INFO_H +/** @} */ diff --git a/multimedia/media_foundation/native_averrors.h b/multimedia/media_foundation/native_averrors.h index edecfa2a8..3651622a6 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -13,6 +13,17 @@ * limitations under the License. */ +/** + * @addtogroup Core + * @{ + * + * @brief The Core module provides basic backbone capabilities for media frameworks, + * including functions such as memory, error codes, and media data structures. + * + * @syscap SystemCapability.Multimedia.Media.Core + * @since 9 + */ + /** * @file native_averrors.h * @@ -114,3 +125,4 @@ typedef enum OH_AVErrCode { #endif #endif // NATIVE_AVERRORS_H +/** @} */ \ No newline at end of file diff --git a/multimedia/media_foundation/native_avformat.h b/multimedia/media_foundation/native_avformat.h index d07ee0c6d..52ff2bc86 100644 --- a/multimedia/media_foundation/native_avformat.h +++ b/multimedia/media_foundation/native_avformat.h @@ -13,6 +13,17 @@ * limitations under the License. */ +/** + * @addtogroup Core + * @{ + * + * @brief The Core module provides basic backbone capabilities for media frameworks, + * including functions such as memory, error codes, and media data structures. + * + * @syscap SystemCapability.Multimedia.Media.Core + * @since 9 + */ + /** * @file native_avformat.h * @@ -315,4 +326,5 @@ const char *OH_AVFormat_DumpInfo(struct OH_AVFormat *format); } #endif -#endif // NATIVE_AVFORMAT_H \ No newline at end of file +#endif // NATIVE_AVFORMAT_H +/** @} */ \ No newline at end of file diff --git a/multimedia/media_foundation/native_avmemory.h b/multimedia/media_foundation/native_avmemory.h index b00f2b45b..4534a7d7b 100644 --- a/multimedia/media_foundation/native_avmemory.h +++ b/multimedia/media_foundation/native_avmemory.h @@ -13,6 +13,17 @@ * limitations under the License. */ +/** + * @addtogroup Core + * @{ + * + * @brief The Core module provides basic backbone capabilities for media frameworks, + * including functions such as memory, error codes, and media data structures. + * + * @syscap SystemCapability.Multimedia.Media.Core + * @since 9 + */ + /** * @file native_avmemory.h * @@ -99,3 +110,4 @@ OH_AVErrCode OH_AVMemory_Destroy(struct OH_AVMemory *mem); #endif #endif // NATIVE_AVMEMORY_H +/** @} */ -- Gitee From a2f4daf9dad72971a53e101f20ad4a497c0adc79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E5=BE=AE?= Date: Mon, 9 Dec 2024 17:28:43 +0800 Subject: [PATCH 517/620] [localSDKc2] fix compliation error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王子微 --- multimedia/av_codec/native_avcapability.h | 2 +- multimedia/av_codec/native_avcodec_base.h | 2 +- multimedia/av_codec/native_avcodec_videodecoder.h | 4 ++-- multimedia/av_codec/native_avcodec_videoencoder.h | 4 ++-- multimedia/av_codec/native_avdemuxer.h | 2 +- multimedia/av_codec/native_avsource.h | 2 +- multimedia/media_foundation/native_avbuffer.h | 2 +- multimedia/media_foundation/native_avbuffer_info.h | 2 +- multimedia/media_foundation/native_averrors.h | 2 +- multimedia/media_foundation/native_avformat.h | 2 +- multimedia/media_foundation/native_avmemory.h | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/multimedia/av_codec/native_avcapability.h b/multimedia/av_codec/native_avcapability.h index 8d01314d2..89cec8d1c 100644 --- a/multimedia/av_codec/native_avcapability.h +++ b/multimedia/av_codec/native_avcapability.h @@ -18,7 +18,7 @@ * @{ * * @brief The AVCapability module provide functions for querying encoding and decoding capabilities. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index f1189f430..ccad9646c 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -19,7 +19,7 @@ * * @brief The CodecBase module provide variables, properties, and functions * for audio and video muxer, demuxer, and basic encoding and decoding functions. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 9 */ diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 03419364f..9dc145dc4 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -16,9 +16,9 @@ /** * @addtogroup VideoDecoder * @{ - * + * * @brief The VideoDecoder module provide interfaces for video decoding - * + * * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @since 9 * @version 1.0 diff --git a/multimedia/av_codec/native_avcodec_videoencoder.h b/multimedia/av_codec/native_avcodec_videoencoder.h index 5f12a3c05..de8b767f1 100644 --- a/multimedia/av_codec/native_avcodec_videoencoder.h +++ b/multimedia/av_codec/native_avcodec_videoencoder.h @@ -16,9 +16,9 @@ /** * @addtogroup VideoEncoder * @{ - * + * * @brief The VideoEncoder module provide interfaces for video encoding - * + * * @syscap SystemCapability.Multimedia.VideoEncoder * @since 9 */ diff --git a/multimedia/av_codec/native_avdemuxer.h b/multimedia/av_codec/native_avdemuxer.h index 841f60eca..3348005db 100644 --- a/multimedia/av_codec/native_avdemuxer.h +++ b/multimedia/av_codec/native_avdemuxer.h @@ -18,7 +18,7 @@ * @{ * * @brief The AVDemuxer module provide an interface for extracting samples from media file streams. - * + * * @syscap SystemCapability.Multimedia.Media.Spliter * @since 10 */ diff --git a/multimedia/av_codec/native_avsource.h b/multimedia/av_codec/native_avsource.h index 7120f8806..7941f549c 100644 --- a/multimedia/av_codec/native_avsource.h +++ b/multimedia/av_codec/native_avsource.h @@ -18,7 +18,7 @@ * @{ * * @brief The AVSource module provide functions for constructing media resource object functionality. - * + * * @syscap SystemCapability.Multimedia.Media.Spliter * @since 10 */ diff --git a/multimedia/media_foundation/native_avbuffer.h b/multimedia/media_foundation/native_avbuffer.h index 7db2d5397..4d80dba03 100644 --- a/multimedia/media_foundation/native_avbuffer.h +++ b/multimedia/media_foundation/native_avbuffer.h @@ -19,7 +19,7 @@ * * @brief The Core module provides basic backbone capabilities for media frameworks, * including functions such as memory, error codes, and media data structures. - * + * * @syscap SystemCapability.Multimedia.Media.Core * @since 9 */ diff --git a/multimedia/media_foundation/native_avbuffer_info.h b/multimedia/media_foundation/native_avbuffer_info.h index 14d3a95a4..f5f3d8c36 100644 --- a/multimedia/media_foundation/native_avbuffer_info.h +++ b/multimedia/media_foundation/native_avbuffer_info.h @@ -19,7 +19,7 @@ * * @brief The Core module provides basic backbone capabilities for media frameworks, * including functions such as memory, error codes, and media data structures. - * + * * @syscap SystemCapability.Multimedia.Media.Core * @since 9 */ diff --git a/multimedia/media_foundation/native_averrors.h b/multimedia/media_foundation/native_averrors.h index 3651622a6..f03ddfd4a 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -19,7 +19,7 @@ * * @brief The Core module provides basic backbone capabilities for media frameworks, * including functions such as memory, error codes, and media data structures. - * + * * @syscap SystemCapability.Multimedia.Media.Core * @since 9 */ diff --git a/multimedia/media_foundation/native_avformat.h b/multimedia/media_foundation/native_avformat.h index 52ff2bc86..4d607854e 100644 --- a/multimedia/media_foundation/native_avformat.h +++ b/multimedia/media_foundation/native_avformat.h @@ -19,7 +19,7 @@ * * @brief The Core module provides basic backbone capabilities for media frameworks, * including functions such as memory, error codes, and media data structures. - * + * * @syscap SystemCapability.Multimedia.Media.Core * @since 9 */ diff --git a/multimedia/media_foundation/native_avmemory.h b/multimedia/media_foundation/native_avmemory.h index 4534a7d7b..620f00862 100644 --- a/multimedia/media_foundation/native_avmemory.h +++ b/multimedia/media_foundation/native_avmemory.h @@ -19,7 +19,7 @@ * * @brief The Core module provides basic backbone capabilities for media frameworks, * including functions such as memory, error codes, and media data structures. - * + * * @syscap SystemCapability.Multimedia.Media.Core * @since 9 */ -- Gitee From 94b99611ad1fb363b5b29e6e066d69e37e429b51 Mon Sep 17 00:00:00 2001 From: shihongjie Date: Mon, 9 Dec 2024 19:57:22 +0800 Subject: [PATCH 518/620] =?UTF-8?q?list=20sdk=5Fc=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shihongjie Change-Id: I5b1d8b2f4e849fdca16c0c8b432fa37cf5e09410 --- arkui/ace_engine/native/native_type.h | 30 +++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index ca825e62b..0ac2b3e48 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -3190,7 +3190,7 @@ ArkUI_ListItemSwipeActionItem* OH_ArkUI_ListItemSwipeActionItem_Create(); /** * @brief Destroy the ListitemSwipeActionItem instance. * -* @param option List Item SwipeActionItem instance to be destroyed. +* @param item List Item SwipeActionItem instance to be destroyed. * @since 12 */ void OH_ArkUI_ListItemSwipeActionItem_Dispose(ArkUI_ListItemSwipeActionItem* item); @@ -3198,8 +3198,8 @@ void OH_ArkUI_ListItemSwipeActionItem_Dispose(ArkUI_ListItemSwipeActionItem* ite /** * @brief Set the layout content of ListItem SwipeActionItem. * -* @param option List Item SwipeActionItem instance. -* @param builder Layout information. +* @param item List Item SwipeActionItem instance. +* @param node Layout information. * @since 12 */ void OH_ArkUI_ListItemSwipeActionItem_SetContent(ArkUI_ListItemSwipeActionItem* item, ArkUI_NodeHandle node); @@ -3207,7 +3207,7 @@ void OH_ArkUI_ListItemSwipeActionItem_SetContent(ArkUI_ListItemSwipeActionItem* /** * @brief Set the threshold for long-distance sliding deletion distance of components. * -* @param option List Item SwipeActionItem instance. +* @param item List Item SwipeActionItem instance. * @param distance Component long-distance sliding deletion distance threshold. * @since 12 */ @@ -3216,7 +3216,7 @@ void OH_ArkUI_ListItemSwipeActionItem_SetActionAreaDistance(ArkUI_ListItemSwipeA /** * @brief Obtain the threshold for long-distance sliding deletion distance of components. * -* @param option List Item SwipeActionItem instance. +* @param item List Item SwipeActionItem instance. * @return Component long-distance sliding deletion distance threshold. If -1.0f is returned, the return fails. * The possible cause of the failure is that the item parameter is abnormal, such as a null pointer. * @since 12 @@ -3226,7 +3226,7 @@ float OH_ArkUI_ListItemSwipeActionItem_GetActionAreaDistance(ArkUI_ListItemSwipe /** * @brief Set the event to be called when a sliding entry enters the deletion area. * -* @param option List Item SwipeActionItem instance. +* @param item List Item SwipeActionItem instance. * @param callback Callback Events. * @since 12 */ @@ -3235,7 +3235,7 @@ void OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionArea(ArkUI_ListItemSwipeAc /** * @brief Set the event triggered when a sliding entry enters the deletion area. * - * @param option List Item SwipeActionItem instance. + * @param item List Item SwipeActionItem instance. * @param userData User defined data. * @param callback Callback Events. * @since 12 @@ -3246,7 +3246,7 @@ void OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionAreaWithUserData(ArkUI_Lis /** * @brief Set the event to be called when a component enters the long-range deletion area and deletes a ListItem. * -* @param option List Item SwipeActionItem instance. +* @param item List Item SwipeActionItem instance. * @param callback Callback Events. * @since 12 */ @@ -3255,7 +3255,7 @@ void OH_ArkUI_ListItemSwipeActionItem_SetOnAction(ArkUI_ListItemSwipeActionItem* /** * @brief Set the event triggered when a component enters the long-range deletion area and deletes a ListItem. * - * @param option List Item SwipeActionItem instance. + * @param item List Item SwipeActionItem instance. * @param userData User defined data. * @param callback Callback Events. * @since 12 @@ -3266,7 +3266,7 @@ void OH_ArkUI_ListItemSwipeActionItem_SetOnActionWithUserData(ArkUI_ListItemSwip /** * @brief Set the event to be called when a sliding entry exits the deletion area. * -* @param option List Item SwipeActionItem instance. +* @param item List Item SwipeActionItem instance. * @param callback Callback Events. * @since 12 */ @@ -3275,7 +3275,7 @@ void OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionArea(ArkUI_ListItemSwipeAct /** * @brief Set the event triggered when a sliding entry exits the deletion area. * - * @param option List Item SwipeActionItem instance. + * @param item List Item SwipeActionItem instance. * @param userData User defined data. * @param callback Callback Events. * @since 12 @@ -3286,7 +3286,7 @@ void OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionAreaWithUserData(ArkUI_List /** * @brief Set the event triggered when the sliding state of a list item changes. * -* @param option List Item SwipeActionItem instance. +* @param item List Item SwipeActionItem instance. * @param callback Callback Events. * swipeActionState The changed state. * @since 12 @@ -3297,7 +3297,7 @@ void OH_ArkUI_ListItemSwipeActionItem_SetOnStateChange(ArkUI_ListItemSwipeAction /** * @brief Set the event triggered when the sliding state of a list item changes. * - * @param option List Item SwipeActionItem instance. + * @param item List Item SwipeActionItem instance. * @param userData User defined data. * @param callback Callback Events. * swipeActionState The changed state. @@ -3328,7 +3328,7 @@ void OH_ArkUI_ListItemSwipeActionOption_Dispose(ArkUI_ListItemSwipeActionOption* * of the ListItem SwipeActionItem. * * @param option List Item SwipeActionItem instance. -* @param builder Layout information. +* @param item Layout information. * @since 12 */ void OH_ArkUI_ListItemSwipeActionOption_SetStart(ArkUI_ListItemSwipeActionOption* option, @@ -3339,7 +3339,7 @@ void OH_ArkUI_ListItemSwipeActionOption_SetStart(ArkUI_ListItemSwipeActionOption * of the ListItem SwipeActionItem. * * @param option List Item SwipeActionItem instance. -* @param builder Layout information. +* @param item Layout information. * @since 12 */ void OH_ArkUI_ListItemSwipeActionOption_SetEnd(ArkUI_ListItemSwipeActionOption* option, -- Gitee From 4a1244de3ecedf2fdf1212475559c44818ba3ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E5=BE=AE?= Date: Mon, 9 Dec 2024 20:15:39 +0800 Subject: [PATCH 519/620] [localSDKc2] fix file descriptiom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王子微 --- multimedia/av_codec/native_avcapability.h | 2 +- multimedia/av_codec/native_avcodec_base.h | 4 ++-- multimedia/av_codec/native_avcodec_videodecoder.h | 2 +- multimedia/av_codec/native_avcodec_videoencoder.h | 2 +- multimedia/av_codec/native_avdemuxer.h | 2 +- multimedia/av_codec/native_avsource.h | 2 +- multimedia/media_foundation/native_avbuffer.h | 2 +- multimedia/media_foundation/native_avbuffer_info.h | 2 +- multimedia/media_foundation/native_averrors.h | 2 +- multimedia/media_foundation/native_avformat.h | 2 +- multimedia/media_foundation/native_avmemory.h | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/multimedia/av_codec/native_avcapability.h b/multimedia/av_codec/native_avcapability.h index 89cec8d1c..eb00d42fd 100644 --- a/multimedia/av_codec/native_avcapability.h +++ b/multimedia/av_codec/native_avcapability.h @@ -26,7 +26,7 @@ /** * @file native_avcapability.h * - * @brief Provides audio and video capability queries. + * @brief Declare the Native API used for querying encoding and decoding capabilities. * * @kit AVCodecKit * @library libnative_media_codecbase.so diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index ccad9646c..e249d047b 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -27,8 +27,8 @@ /** * @file native_avcodec_base.h * - * @brief Provides audio and video codec base. - * + * @brief Declare the Native API used for audio and video muxer, + * demuxer and basic encoding and decoding functions. * @kit AVCodecKit * @library libnative_media_codecbase.so * @syscap SystemCapability.Multimedia.Media.CodecBase diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 9dc145dc4..01fa3245a 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -27,7 +27,7 @@ /** * @file native_avcodec_videodecoder.h * - * @brief Provides video decoder capabilities. + * @brief Declare the Native API used for video decoding. * * @kit AVCodecKit * @library libnative_media_vdec.so diff --git a/multimedia/av_codec/native_avcodec_videoencoder.h b/multimedia/av_codec/native_avcodec_videoencoder.h index de8b767f1..6dc7f4bfc 100644 --- a/multimedia/av_codec/native_avcodec_videoencoder.h +++ b/multimedia/av_codec/native_avcodec_videoencoder.h @@ -26,7 +26,7 @@ /** * @file native_avcodec_videoencoder.h * - * @brief Provides video encoder capabilities. + * @brief Declare the interface used for video encoding. * * @kit AVCodecKit * @library libnative_media_venc.so diff --git a/multimedia/av_codec/native_avdemuxer.h b/multimedia/av_codec/native_avdemuxer.h index 3348005db..11fd627f6 100644 --- a/multimedia/av_codec/native_avdemuxer.h +++ b/multimedia/av_codec/native_avdemuxer.h @@ -26,7 +26,7 @@ /** * @file native_avdemuxer.h * - * @brief Provides audio and video demuxer capabilities. + * @brief Declare the interface for parsing audio and video media data. * * @kit AVCodecKit * @library libnative_media_avdemuxer.so diff --git a/multimedia/av_codec/native_avsource.h b/multimedia/av_codec/native_avsource.h index 7941f549c..3496ac2cc 100644 --- a/multimedia/av_codec/native_avsource.h +++ b/multimedia/av_codec/native_avsource.h @@ -26,7 +26,7 @@ /** * @file native_avsource.h * - * @brief Provides audio and video suorce capabilities. + * @brief Declare the interface for parsing audio and video media data. * * @kit AVCodecKit * @library libnative_media_avsource.so diff --git a/multimedia/media_foundation/native_avbuffer.h b/multimedia/media_foundation/native_avbuffer.h index 4d80dba03..29ff41d31 100644 --- a/multimedia/media_foundation/native_avbuffer.h +++ b/multimedia/media_foundation/native_avbuffer.h @@ -27,7 +27,7 @@ /** * @file native_avbuffer.h * - * @brief Provides audio and video buffer. + * @brief Declared the function interface of media data structure AVBuffer. * * @kit AVCodecKit * @library libnative_media_core.so diff --git a/multimedia/media_foundation/native_avbuffer_info.h b/multimedia/media_foundation/native_avbuffer_info.h index f5f3d8c36..490891710 100644 --- a/multimedia/media_foundation/native_avbuffer_info.h +++ b/multimedia/media_foundation/native_avbuffer_info.h @@ -27,7 +27,7 @@ /** * @file native_avbuffer_info.h * - * @brief Provides audio and video buffer info. + * @brief Declared the definition of the AVBuffer property for media data structures. * * @kit AVCodecKit * @library libnative_media_core.so diff --git a/multimedia/media_foundation/native_averrors.h b/multimedia/media_foundation/native_averrors.h index f03ddfd4a..98c6beb7e 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -27,7 +27,7 @@ /** * @file native_averrors.h * - * @brief Provides audio and video error description. + * @brief Media framework error code. * * @kit AVCodecKit * @library libnative_media_core.so diff --git a/multimedia/media_foundation/native_avformat.h b/multimedia/media_foundation/native_avformat.h index 4d607854e..ac30d2d47 100644 --- a/multimedia/media_foundation/native_avformat.h +++ b/multimedia/media_foundation/native_avformat.h @@ -27,7 +27,7 @@ /** * @file native_avformat.h * - * @brief Provides audio and video format. + * @brief Declared functions and enumerations related to OH_AVFormat. * * @kit AVCodecKit * @library libnative_media_core.so diff --git a/multimedia/media_foundation/native_avmemory.h b/multimedia/media_foundation/native_avmemory.h index 620f00862..224f34004 100644 --- a/multimedia/media_foundation/native_avmemory.h +++ b/multimedia/media_foundation/native_avmemory.h @@ -27,7 +27,7 @@ /** * @file native_avmemory.h * - * @brief Provides audio and video memory. + * @brief Declared the definition of media data structure AVMemory. * * @kit AVCodecKit * @library libnative_media_core.so -- Gitee From 0f83bcaa8d65aa88c2fd1ef47ba65177b258898b Mon Sep 17 00:00:00 2001 From: zhangkai Date: Sat, 7 Dec 2024 16:33:27 +0800 Subject: [PATCH 520/620] =?UTF-8?q?api=20lint=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangkai --- .../audio_framework/audio_capturer/native_audiocapturer.h | 2 ++ .../audio_framework/audio_manager/native_audio_manager.h | 6 ++++-- .../audio_manager/native_audio_routing_manager.h | 3 ++- .../audio_manager/native_audio_session_manager.h | 5 +++-- .../audio_framework/audio_renderer/native_audiorenderer.h | 2 ++ multimedia/audio_framework/common/native_audio_common.h | 3 ++- .../audio_framework/common/native_audio_device_base.h | 3 ++- multimedia/audio_framework/common/native_audiostream_base.h | 1 + .../audio_framework/common/native_audiostreambuilder.h | 3 ++- 9 files changed, 20 insertions(+), 8 deletions(-) diff --git a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h index 6daac56a3..c2c3216f6 100644 --- a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h +++ b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h @@ -288,4 +288,6 @@ OH_AudioStream_Result OH_AudioCapturer_GetOverflowCount(OH_AudioCapturer* captur #ifdef __cplusplus } #endif + #endif // NATIVE_AUDIOCAPTURER_H +/** @} */ diff --git a/multimedia/audio_framework/audio_manager/native_audio_manager.h b/multimedia/audio_framework/audio_manager/native_audio_manager.h index 24c37f94b..0c5232d6c 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_manager.h @@ -66,6 +66,7 @@ OH_AudioCommon_Result OH_GetAudioManager(OH_AudioManager **audioManager); /** * @brief Get audio scene. + * * @param audioManager the {@link OH_AudioManager} handle received from {@link OH_GetAudioManager}. * @param scene the {@link OH_AudioScene} pointer to receive the result. * @return Function result code: @@ -80,5 +81,6 @@ OH_AudioCommon_Result OH_GetAudioScene(OH_AudioManager* manager, OH_AudioScene * #ifdef __cplusplus } #endif -/** @} */ -#endif // NATIVE_AUDIO_ROUTING_MANAGER_H \ No newline at end of file + +#endif // NATIVE_AUDIO_ROUTING_MANAGER_H +/** @} */ \ No newline at end of file diff --git a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h index b5f363ac7..b0f360a95 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h @@ -295,5 +295,6 @@ OH_AudioCommon_Result OH_AudioRoutingManager_SetMicBlockStatusCallback( #ifdef __cplusplus } #endif -/** @} */ + #endif // NATIVE_AUDIO_ROUTING_MANAGER_H +/** @} */ diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 08ae35748..01df4fea3 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -218,5 +218,6 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterSessionDeactivatedCallbac #ifdef __cplusplus } #endif -/** @} */ -#endif // NATIVE_AUDIO_ROUTING_MANAGER_H \ No newline at end of file + +#endif // NATIVE_AUDIO_ROUTING_MANAGER_H +/** @} */ \ No newline at end of file diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index 90255a7fd..6bfcb82ae 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -507,4 +507,6 @@ OH_AudioStream_Result OH_AudioRenderer_SetDefaultOutputDevice( #ifdef __cplusplus } #endif + #endif // NATIVE_AUDIORENDERER_H +/** @} */ \ No newline at end of file diff --git a/multimedia/audio_framework/common/native_audio_common.h b/multimedia/audio_framework/common/native_audio_common.h index 6a50df302..2dfd609df 100644 --- a/multimedia/audio_framework/common/native_audio_common.h +++ b/multimedia/audio_framework/common/native_audio_common.h @@ -133,5 +133,6 @@ typedef enum { #ifdef __cplusplus } #endif -/** @} */ + #endif // NATIVE_AUDIO_COMMON_H +/** @} */ diff --git a/multimedia/audio_framework/common/native_audio_device_base.h b/multimedia/audio_framework/common/native_audio_device_base.h index 573e07fed..bb8f3f9f8 100644 --- a/multimedia/audio_framework/common/native_audio_device_base.h +++ b/multimedia/audio_framework/common/native_audio_device_base.h @@ -404,5 +404,6 @@ OH_AudioCommon_Result OH_AudioDeviceDescriptor_GetDeviceEncodingTypes(OH_AudioDe #ifdef __cplusplus } #endif -/** @} */ + #endif // NATIVE_AUDIO_DEVICE_BASE_H +/** @} */ diff --git a/multimedia/audio_framework/common/native_audiostream_base.h b/multimedia/audio_framework/common/native_audiostream_base.h index 44dacf0d0..718976920 100644 --- a/multimedia/audio_framework/common/native_audiostream_base.h +++ b/multimedia/audio_framework/common/native_audiostream_base.h @@ -718,3 +718,4 @@ typedef OH_AudioData_Callback_Result (*OH_AudioRenderer_OnWriteDataCallback)(OH_ #endif #endif // NATIVE_AUDIOSTREAM_BASE_H +/** @} */ \ No newline at end of file diff --git a/multimedia/audio_framework/common/native_audiostreambuilder.h b/multimedia/audio_framework/common/native_audiostreambuilder.h index 4989046d3..de4451adf 100644 --- a/multimedia/audio_framework/common/native_audiostreambuilder.h +++ b/multimedia/audio_framework/common/native_audiostreambuilder.h @@ -289,7 +289,7 @@ OH_AudioStream_Result OH_AudioStreamBuilder_GenerateRenderer(OH_AudioStreamBuild * {@link AUDIOSTREAM_ERROR_INVALID_PARAM}: * 1.The param of builder is nullptr; * 2.StreamType invalid; - * 3.Create OHAudioRenderer failed. + * 3.Create OHAudioCapturer failed. */ OH_AudioStream_Result OH_AudioStreamBuilder_GenerateCapturer(OH_AudioStreamBuilder* builder, OH_AudioCapturer** audioCapturer); @@ -366,3 +366,4 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererWriteDataCallback(OH_Audi #endif #endif // NATIVE_AUDIOSTREAM_BUILDER_H +/** @} */ \ No newline at end of file -- Gitee From 7e29445d0a502077a7866c62903d97bba822ccad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E5=BE=AE?= Date: Tue, 10 Dec 2024 11:48:06 +0800 Subject: [PATCH 521/620] [localSDKc2] fix comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王子微 --- multimedia/av_codec/native_avcapability.h | 2 +- multimedia/av_codec/native_avcodec_base.h | 2 +- multimedia/av_codec/native_avcodec_videodecoder.h | 2 +- multimedia/av_codec/native_avcodec_videoencoder.h | 2 +- multimedia/av_codec/native_avdemuxer.h | 2 +- multimedia/av_codec/native_avsource.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/multimedia/av_codec/native_avcapability.h b/multimedia/av_codec/native_avcapability.h index eb00d42fd..ec43e7c69 100644 --- a/multimedia/av_codec/native_avcapability.h +++ b/multimedia/av_codec/native_avcapability.h @@ -17,7 +17,7 @@ * @addtogroup AVCapability * @{ * - * @brief The AVCapability module provide functions for querying encoding and decoding capabilities. + * @brief The AVCapability module provides functions for querying encoding and decoding capabilities. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index e249d047b..45b7b085d 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -17,7 +17,7 @@ * @addtogroup CodecBase * @{ * - * @brief The CodecBase module provide variables, properties, and functions + * @brief The CodecBase module provides variables, properties, and functions * for audio and video muxer, demuxer, and basic encoding and decoding functions. * * @syscap SystemCapability.Multimedia.Media.CodecBase diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 01fa3245a..6b1c85fb9 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -17,7 +17,7 @@ * @addtogroup VideoDecoder * @{ * - * @brief The VideoDecoder module provide interfaces for video decoding + * @brief The VideoDecoder module provides interfaces for video decoding * * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @since 9 diff --git a/multimedia/av_codec/native_avcodec_videoencoder.h b/multimedia/av_codec/native_avcodec_videoencoder.h index 6dc7f4bfc..6b6003138 100644 --- a/multimedia/av_codec/native_avcodec_videoencoder.h +++ b/multimedia/av_codec/native_avcodec_videoencoder.h @@ -17,7 +17,7 @@ * @addtogroup VideoEncoder * @{ * - * @brief The VideoEncoder module provide interfaces for video encoding + * @brief The VideoEncoder module provides interfaces for video encoding * * @syscap SystemCapability.Multimedia.VideoEncoder * @since 9 diff --git a/multimedia/av_codec/native_avdemuxer.h b/multimedia/av_codec/native_avdemuxer.h index 11fd627f6..b0ec5e015 100644 --- a/multimedia/av_codec/native_avdemuxer.h +++ b/multimedia/av_codec/native_avdemuxer.h @@ -17,7 +17,7 @@ * @addtogroup AVDemuxer * @{ * - * @brief The AVDemuxer module provide an interface for extracting samples from media file streams. + * @brief The AVDemuxer module provides an interface for extracting samples from media file streams. * * @syscap SystemCapability.Multimedia.Media.Spliter * @since 10 diff --git a/multimedia/av_codec/native_avsource.h b/multimedia/av_codec/native_avsource.h index 3496ac2cc..4c44206d0 100644 --- a/multimedia/av_codec/native_avsource.h +++ b/multimedia/av_codec/native_avsource.h @@ -17,7 +17,7 @@ * @addtogroup AVSource * @{ * - * @brief The AVSource module provide functions for constructing media resource object functionality. + * @brief The AVSource module provides functions for constructing media resource object functionality. * * @syscap SystemCapability.Multimedia.Media.Spliter * @since 10 -- Gitee From a4f6a578cc069a3b2d67a6c86a023aaaf8d65225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E5=BE=AE?= Date: Tue, 10 Dec 2024 14:39:56 +0800 Subject: [PATCH 522/620] [localSDKc2] fix comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王子微 --- multimedia/av_codec/native_avcodec_videodecoder.h | 2 +- multimedia/av_codec/native_avcodec_videoencoder.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 6b1c85fb9..462d5011d 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -17,7 +17,7 @@ * @addtogroup VideoDecoder * @{ * - * @brief The VideoDecoder module provides interfaces for video decoding + * @brief The VideoDecoder module provides interfaces for video decoding. * * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @since 9 diff --git a/multimedia/av_codec/native_avcodec_videoencoder.h b/multimedia/av_codec/native_avcodec_videoencoder.h index 6b6003138..334fd53d2 100644 --- a/multimedia/av_codec/native_avcodec_videoencoder.h +++ b/multimedia/av_codec/native_avcodec_videoencoder.h @@ -17,7 +17,7 @@ * @addtogroup VideoEncoder * @{ * - * @brief The VideoEncoder module provides interfaces for video encoding + * @brief The VideoEncoder module provides interfaces for video encoding. * * @syscap SystemCapability.Multimedia.VideoEncoder * @since 9 -- Gitee From 41f1b4ac3643a01a94b878586c1bc9ef689988cb Mon Sep 17 00:00:00 2001 From: wangsh88 Date: Tue, 10 Dec 2024 20:32:03 +0800 Subject: [PATCH 523/620] API lint fix Signed-off-by: wangsh88 Change-Id: I5c84f528cd8337eb59d476d8ec068a924eef8930 --- arkui/ace_engine/native/native_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index ca825e62b..5ce6029e0 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -2729,7 +2729,7 @@ uint32_t OH_ArkUI_SwiperIndicator_GetColor(ArkUI_SwiperIndicator* indicator); * @brief Sets the color of the selected dot for the navigation indicator. * * @param indicator Indicates the pointer to the indicator. - * @param color the color of the selected dot, in 0xARGB format. + * @param selectedColor the color of the selected dot, in 0xARGB format. * @since 12 */ void OH_ArkUI_SwiperIndicator_SetSelectedColor(ArkUI_SwiperIndicator* indicator, uint32_t selectedColor); -- Gitee From d72c5e976bc251caebba03f200b15656dca60557 Mon Sep 17 00:00:00 2001 From: zhouchaobo Date: Wed, 20 Nov 2024 14:18:56 +0800 Subject: [PATCH 524/620] cursorless axis event capi Signed-off-by: zhouchaobo Change-Id: Ic34394256f1d709d97ed21e9ee6bfa7af0a7172d --- arkui/ace_engine/native/libace.ndk.json | 8 ++++ arkui/ace_engine/native/native_key_event.h | 6 +++ arkui/ace_engine/native/native_node.h | 10 +++++ arkui/ace_engine/native/ui_input_event.h | 46 ++++++++++++++++++++++ 4 files changed, 70 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 1d822febf..5d2f41050 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2470,5 +2470,13 @@ { "first_introduced": "14", "name": "OH_ArkUI_KeyEvent_SetConsumed" + }, + { + "first_introduced": "15", + "name": "OH_ArkUI_FocusAxisEvent_GetAxisValue" + }, + { + "first_introduced": "15", + "name": "OH_ArkUI_FocusAxisEvent_SetStopPropagation" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_key_event.h b/arkui/ace_engine/native/native_key_event.h index 70958a813..c9c2c4fb1 100644 --- a/arkui/ace_engine/native/native_key_event.h +++ b/arkui/ace_engine/native/native_key_event.h @@ -349,6 +349,12 @@ typedef enum { ARKUI_KEY_SOURCE_TYPE_MOUSE = 1, /** Keyboard **/ ARKUI_KEY_SOURCE_TYPE_KEYBOARD = 4, + /** + * @brief Joystick. + * + * @since 15 + */ + ARKUI_KEY_SOURCE_TYPE_JOYSTICK = 5, } ArkUI_KeySourceType; /** diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index f83f1a181..eaeb57736 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -5713,6 +5713,16 @@ typedef enum { * @since 14 */ NODE_ON_KEY_PRE_IME = 22, + /** + * @brief Defines the event triggered when the bound component receives a focus axis event after gaining focus. + * + * The event callback is triggered by interactions with a joystick and a focused component. \n + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_UIInputEvent}. \n + * + * @since 15 + */ + NODE_ON_FOCUS_AXIS = 23, /** * @brief Triggers onDetectResultUpdate callback diff --git a/arkui/ace_engine/native/ui_input_event.h b/arkui/ace_engine/native/ui_input_event.h index 9b5aa63fb..51cccdef8 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -196,6 +196,30 @@ typedef enum { ARKUI_MODIFIER_KEY_FN = 1 << 3, } ArkUI_ModifierKeyName; +/** + * @brief Defines an enum for the axis types for focus axis events. + * + * @since 15 + */ +enum { + /** ABS_X. */ + UI_FOCUS_AXIS_EVENT_ABS_X = 0, + /** ABS_Y. */ + UI_FOCUS_AXIS_EVENT_ABS_Y = 1, + /** ABS_Z. */ + UI_FOCUS_AXIS_EVENT_ABS_Z = 2, + /** ABS_RZ. */ + UI_FOCUS_AXIS_EVENT_ABS_RZ = 3, + /** ABS_GAS. */ + UI_FOCUS_AXIS_EVENT_ABS_GAS = 4, + /** ABS_BRAKE. */ + UI_FOCUS_AXIS_EVENT_ABS_BRAKE = 5, + /** ABS_HAT0X. */ + UI_FOCUS_AXIS_EVENT_ABS_HAT0X = 6, + /** ABS_HAT0Y. */ + UI_FOCUS_AXIS_EVENT_ABS_HAT0Y = 7, +}; + /** * @brief Obtains the type of this UI input event. * @@ -740,6 +764,28 @@ int32_t OH_ArkUI_UIInputEvent_GetDeviceId(const ArkUI_UIInputEvent* event); */ int32_t OH_ArkUI_UIInputEvent_GetPressedKeys(const ArkUI_UIInputEvent* event, int32_t* pressedKeyCodes, int32_t length); +/** + * @brief Obtains the axis value of a focus axis event. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @param axis Axis type of the focus axis event. + * @return Returns the axis value of the focus axis event; returns 0.0 if any parameter error occurs. + * @since 15 + */ +double OH_ArkUI_FocusAxisEvent_GetAxisValue(const ArkUI_UIInputEvent* event, int32_t axis); + +/** + * @brief Sets whether to prevent a focus axis event from bubbling up. + * + * @param event Indicates the pointer to the current UI input event. + * @param stopPropagation Indicates whether to stop event propagation. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 15 + */ +int32_t OH_ArkUI_FocusAxisEvent_SetStopPropagation(const ArkUI_UIInputEvent* event, bool stopPropagation); + #ifdef __cplusplus }; #endif -- Gitee From 0f5de555c7d58be715e7eb2b498029ff8d28c502 Mon Sep 17 00:00:00 2001 From: zzm Date: Wed, 11 Dec 2024 03:11:41 +0000 Subject: [PATCH 525/620] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=EF=BC=9Aadd=20@addtogroup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zzm --- .../av_codec/avcodec_audio_channel_layout.h | 25 ++++++++++++++++++- .../av_codec/native_avcodec_audiocodec.h | 15 +++++++++-- .../av_codec/native_avcodec_audiodecoder.h | 15 +++++++++-- .../av_codec/native_avcodec_audioencoder.h | 15 +++++++++-- multimedia/av_codec/native_avmuxer.h | 15 +++++++++-- 5 files changed, 76 insertions(+), 9 deletions(-) diff --git a/multimedia/av_codec/avcodec_audio_channel_layout.h b/multimedia/av_codec/avcodec_audio_channel_layout.h index 4cc2a5eee..5afc6f04c 100644 --- a/multimedia/av_codec/avcodec_audio_channel_layout.h +++ b/multimedia/av_codec/avcodec_audio_channel_layout.h @@ -13,6 +13,28 @@ * limitations under the License. */ +/** + * @addtogroup CodecBase + * @{ + * + * @brief The CodecBase module provides variables, properties, and functions + * for audio and video muxer, demuxer, and basic encoding and decoding functions. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 9 + */ + +/** + * @file avcodec_audio_channel_layout.h + * + * @brief Declare the enumeration used for audio encoding and decoding. + * + * @kit AVCodecKit + * @library libnative_media_codecbase.so + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 9 + */ + #ifndef AVCODEC_AUDIO_CHANNEL_LAYOUT_H #define AVCODEC_AUDIO_CHANNEL_LAYOUT_H #include @@ -175,4 +197,5 @@ enum AudioChannelLayout : uint64_t { #ifdef __cplusplus } #endif -#endif \ No newline at end of file +#endif // AVCODEC_AUDIO_CHANNEL_LAYOUT_H +/** @} */ \ No newline at end of file diff --git a/multimedia/av_codec/native_avcodec_audiocodec.h b/multimedia/av_codec/native_avcodec_audiocodec.h index 8ae03c4bb..5495a534b 100644 --- a/multimedia/av_codec/native_avcodec_audiocodec.h +++ b/multimedia/av_codec/native_avcodec_audiocodec.h @@ -13,10 +13,20 @@ * limitations under the License. */ +/** + * @addtogroup AudioCodec + * @{ + * + * @brief The AudioCodec module provides functions for audio encoding and decoding. + * + * @syscap SystemCapability.Multimedia.Media.AudioCodec + * @since 11 + */ + /** * @file native_avcodec_audiocodec.h * - * @brief Provides audio encoder and decoder capabilities. + * @brief Declare the Native API used for audio encoding and decoding. * * @kit AVCodecKit * @library libnative_media_acodec.so @@ -288,4 +298,5 @@ OH_AVErrCode OH_AudioCodec_SetDecryptionConfig(OH_AVCodec *codec, MediaKeySessio #ifdef __cplusplus } #endif -#endif // NATIVE_AVCODEC_AUDIOCODEC_H \ No newline at end of file +#endif // NATIVE_AVCODEC_AUDIOCODEC_H +/** @} */ \ No newline at end of file diff --git a/multimedia/av_codec/native_avcodec_audiodecoder.h b/multimedia/av_codec/native_avcodec_audiodecoder.h index f2269e3e8..979eda38a 100644 --- a/multimedia/av_codec/native_avcodec_audiodecoder.h +++ b/multimedia/av_codec/native_avcodec_audiodecoder.h @@ -13,10 +13,20 @@ * limitations under the License. */ +/** + * @addtogroup AudioDecoder + * @{ + * + * @brief The AudioDecoder module provides functions for audio decoding. + * + * @syscap SystemCapability.Multimedia.Media.AudioDecoder + * @since 9 + */ + /** * @file native_avcodec_audiodecoder.h * - * @brief Provides audio decoder capabilities. + * @brief Declare the Native API used for audio decoding. * * @kit AVCodecKit * @library libnative_media_adec.so @@ -244,4 +254,5 @@ OH_AVErrCode OH_AudioDecoder_IsValid(OH_AVCodec *codec, bool *isValid); #ifdef __cplusplus } #endif -#endif // NATIVE_AVCODEC_AUDIODECODER_H \ No newline at end of file +#endif // NATIVE_AVCODEC_AUDIODECODER_H +/** @} */ \ No newline at end of file diff --git a/multimedia/av_codec/native_avcodec_audioencoder.h b/multimedia/av_codec/native_avcodec_audioencoder.h index a01215f8f..611ac03fd 100644 --- a/multimedia/av_codec/native_avcodec_audioencoder.h +++ b/multimedia/av_codec/native_avcodec_audioencoder.h @@ -13,10 +13,20 @@ * limitations under the License. */ +/** + * @addtogroup AudioEncoder + * @{ + * + * @brief The AudioEncoder module provides functions for audio encoding. + * + * @syscap SystemCapability.Multimedia.Media.AudioEncoder + * @since 9 + */ + /** * @file native_avcodec_audioencoder.h * - * @brief Provides audio encoder capabilities. + * @brief Declare the Native API used for audio encoding. * * @kit AVCodecKit * @library libnative_media_aenc.so @@ -254,4 +264,5 @@ OH_AVErrCode OH_AudioEncoder_IsValid(OH_AVCodec *codec, bool *isValid); #ifdef __cplusplus } #endif -#endif // NATIVE_AVCODEC_AUDIOENCODER_H \ No newline at end of file +#endif // NATIVE_AVCODEC_AUDIOENCODER_H +/** @} */ \ No newline at end of file diff --git a/multimedia/av_codec/native_avmuxer.h b/multimedia/av_codec/native_avmuxer.h index af3c44b12..e50b31cee 100644 --- a/multimedia/av_codec/native_avmuxer.h +++ b/multimedia/av_codec/native_avmuxer.h @@ -13,10 +13,20 @@ * limitations under the License. */ +/** + * @addtogroup AVMuxer + * @{ + * + * @brief The AVMuxer module provides functions for audio and video muxer. + * + * @syscap SystemCapability.Multimedia.Media.Muxer + * @since 10 + */ + /** * @file native_avmuxer.h * - * @brief Provides audio and video muxer capabilities. + * @brief Declare the Native API used for audio and video muxer. * * @kit AVCodecKit * @library libnative_media_avmuxer.so @@ -171,4 +181,5 @@ OH_AVErrCode OH_AVMuxer_Destroy(OH_AVMuxer *muxer); } #endif -#endif // NATIVE_AVMUXER_H \ No newline at end of file +#endif // NATIVE_AVMUXER_H +/** @} */ \ No newline at end of file -- Gitee From b51941b65154aaa430b93b5c87c3d893772caabc Mon Sep 17 00:00:00 2001 From: liumingxiang1 Date: Wed, 11 Dec 2024 20:45:28 +0800 Subject: [PATCH 526/620] =?UTF-8?q?word=20break=E6=96=B0=E5=A2=9E=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=EF=BC=9AWORD=5FBREAK=5FTYPE=5FHYPHEN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liumingxiang1 --- graphic/graphic_2d/native_drawing/drawing_text_typography.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 275f0af37..998932c6a 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -279,6 +279,8 @@ typedef enum { WORD_BREAK_TYPE_BREAK_ALL = 1, /** Break Word type */ WORD_BREAK_TYPE_BREAK_WORD = 2, + /** Attempt break word with hyphens */ + WORD_BREAK_TYPE_HYPHEN = 3, } OH_Drawing_WordBreakType; /** -- Gitee From f3b09f59b8d45ec7ec411909fb911240d2cbd44b Mon Sep 17 00:00:00 2001 From: liumingxiang Date: Wed, 11 Dec 2024 21:31:57 +0800 Subject: [PATCH 527/620] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=AD=97=E4=BD=93=E6=9E=9A=E4=B8=BE=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liumingxiang --- .../graphic_2d/native_drawing/drawing_text_font_descriptor.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h index 2ae193b58..4ba3ee2e6 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h @@ -60,6 +60,8 @@ typedef enum { STYLISH = 1 << 2, /** Installed font types */ INSTALLED = 1 << 3, + /** Customized font types */ + CUSTOMIZED = 1 << 4; } OH_Drawing_SystemFontType; /** -- Gitee From 974be7e7dd2503ddfa093624265a7c07b7c8d4d4 Mon Sep 17 00:00:00 2001 From: liumingxiang Date: Wed, 11 Dec 2024 21:44:03 +0800 Subject: [PATCH 528/620] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=AD=97=E4=BD=93=E6=9E=9A=E4=B8=BE=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liumingxiang --- .../graphic_2d/native_drawing/drawing_text_font_descriptor.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h index 2ae193b58..4ba3ee2e6 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h @@ -60,6 +60,8 @@ typedef enum { STYLISH = 1 << 2, /** Installed font types */ INSTALLED = 1 << 3, + /** Customized font types */ + CUSTOMIZED = 1 << 4; } OH_Drawing_SystemFontType; /** -- Gitee From f1ce79855a2a94e0f232588cec85b6369f058224 Mon Sep 17 00:00:00 2001 From: liumingxiang Date: Wed, 11 Dec 2024 23:09:40 +0800 Subject: [PATCH 529/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liumingxiang --- .../graphic_2d/native_drawing/drawing_text_font_descriptor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h index 4ba3ee2e6..adf1c2cde 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h @@ -61,7 +61,7 @@ typedef enum { /** Installed font types */ INSTALLED = 1 << 3, /** Customized font types */ - CUSTOMIZED = 1 << 4; + CUSTOMIZED = 1 << 4, } OH_Drawing_SystemFontType; /** -- Gitee From 63ca93d3f6f8bb856c4aaf158422daae50ddee2f Mon Sep 17 00:00:00 2001 From: cjj Date: Thu, 12 Dec 2024 09:28:11 +0800 Subject: [PATCH 530/620] fix_code Signed-off-by: cjj --- multimedia/camera_framework/camera_manager.h | 2 +- multimedia/camera_framework/capture_session.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/camera_framework/camera_manager.h b/multimedia/camera_framework/camera_manager.h index 3c7f2fee0..71a8f4616 100644 --- a/multimedia/camera_framework/camera_manager.h +++ b/multimedia/camera_framework/camera_manager.h @@ -197,7 +197,7 @@ Camera_ErrorCode OH_CameraManager_DeleteSupportedCameras(Camera_Manager* cameraM * @brief Gets the supported output capability for the specific camera and specific mode. * * @param cameraManager the {@link Camera_Manager} instance. - * @param cameras the {@link Camera_Device} to be queryed. + * @param camera the {@link Camera_Device} to be queryed. * @param cameraOutputCapability the supported {@link Camera_OutputCapability} will be filled * if the method call succeeds. * @return {@link #CAMERA_OK} if the method call succeeds. diff --git a/multimedia/camera_framework/capture_session.h b/multimedia/camera_framework/capture_session.h index 54786c5d9..0e8e03546 100644 --- a/multimedia/camera_framework/capture_session.h +++ b/multimedia/camera_framework/capture_session.h @@ -550,7 +550,7 @@ Camera_ErrorCode OH_CaptureSession_IsFocusModeSupported(Camera_CaptureSession* s * @brief Get current focus mode. * * @param session the {@link Camera_CaptureSession} instance. - * @param exposureBias the current {@link Camera_FocusMode}. + * @param focusMode the current {@link Camera_FocusMode}. * @return {@link #CAMERA_OK} if the method call succeeds. * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. -- Gitee From 61c5d97e11169d4d852c927ce4f54a865856f66f Mon Sep 17 00:00:00 2001 From: wanglingyi Date: Thu, 12 Dec 2024 08:14:04 +0000 Subject: [PATCH 531/620] 12121 Signed-off-by: wanglingyi --- multimedia/player_framework/avplayer.h | 1 + multimedia/player_framework/avplayer_base.h | 1 + 2 files changed, 2 insertions(+) diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h index 8cdba3b86..474b2885a 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -32,6 +32,7 @@ * * @kit MediaKit * @library libavplayer.so + * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since 11 * @version 1.0 */ diff --git a/multimedia/player_framework/avplayer_base.h b/multimedia/player_framework/avplayer_base.h index f3306fa35..b351f5cdd 100644 --- a/multimedia/player_framework/avplayer_base.h +++ b/multimedia/player_framework/avplayer_base.h @@ -31,6 +31,7 @@ * * @kit MediaKit * @library libavplayer.so + * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since 11 * @version 1.0 */ -- Gitee From 5294d0982d97df53097cfc484c78aabd4e839a7d Mon Sep 17 00:00:00 2001 From: sunjiakun Date: Wed, 13 Nov 2024 14:34:07 +0800 Subject: [PATCH 532/620] Add ndk interface Signed-off-by: sunjiakun --- .../ability_runtime/application_context.h | 136 ++++++++++++++++++ .../libability_runtime.ndk.json | 32 +++++ 2 files changed, 168 insertions(+) diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index 1ba53503d..6a1266d94 100644 --- a/AbilityKit/ability_runtime/application_context.h +++ b/AbilityKit/ability_runtime/application_context.h @@ -92,6 +92,142 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetAreaMode(Ability AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetBundleName( char* buffer, int32_t bufferSize, int32_t* writeLength); +/** + * @brief Obtain the temp directory of the application. + * + * @param buffer A pointer to a buffer that receives the temp directory of the application. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 16 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetTempDir( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief Obtain the resource directory of the application. + * + * @param buffer A pointer to a buffer that receives the resource directory of the application. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 16 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetResourceDir( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief Obtain the files directory of the application. + * + * @param buffer A pointer to a buffer that receives the files directory of the application. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 16 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetFilesDir( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief Obtain the database directory of the application. + * + * @param buffer A pointer to a buffer that receives the database directory of the application. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 16 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetDatabaseDir( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief Obtain the preferences directory of the application. + * + * @param buffer A pointer to a buffer that receives the preferences directory of the application. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 16 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetPreferencesDir( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief Obtain the bundle code directory of the application. + * + * @param buffer A pointer to a buffer that receives the bundle code directory of the application. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 16 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetBundleCodeDir( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief Obtain the distributed files directory of the application. + * + * @param buffer A pointer to a buffer that receives the distributed files directory of the application. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 16 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetDistributedFilesDir( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief Obtain the cloud file directory of the application. + * + * @param buffer A pointer to a buffer that receives the cloud file directory of the application. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 16 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetCloudFileDir( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + #ifdef __cplusplus } // extern "C" #endif diff --git a/AbilityKit/ability_runtime/libability_runtime.ndk.json b/AbilityKit/ability_runtime/libability_runtime.ndk.json index 239f84f61..f761059ab 100644 --- a/AbilityKit/ability_runtime/libability_runtime.ndk.json +++ b/AbilityKit/ability_runtime/libability_runtime.ndk.json @@ -10,5 +10,37 @@ { "first_introduced": "13", "name": "OH_AbilityRuntime_ApplicationContextGetBundleName" + }, + { + "first_introduced": "16", + "name": "OH_AbilityRuntime_ApplicationContextGetTempDir" + }, + { + "first_introduced": "16", + "name": "OH_AbilityRuntime_ApplicationContextGetResourceDir" + }, + { + "first_introduced": "16", + "name": "OH_AbilityRuntime_ApplicationContextGetFilesDir" + }, + { + "first_introduced": "16", + "name": "OH_AbilityRuntime_ApplicationContextGetDatabaseDir" + }, + { + "first_introduced": "16", + "name": "OH_AbilityRuntime_ApplicationContextGetPreferencesDir" + }, + { + "first_introduced": "16", + "name": "OH_AbilityRuntime_ApplicationContextGetBundleCodeDir" + }, + { + "first_introduced": "16", + "name": "OH_AbilityRuntime_ApplicationContextGetDistributedFilesDir" + }, + { + "first_introduced": "16", + "name": "OH_AbilityRuntime_ApplicationContextGetCloudFileDir" } ] \ No newline at end of file -- Gitee From b8684728d10bc915484b6744a3360aca1cc08dc4 Mon Sep 17 00:00:00 2001 From: sunjiakun Date: Fri, 22 Nov 2024 14:57:04 +0800 Subject: [PATCH 533/620] back GetResourceDir Signed-off-by: sunjiakun --- .../ability_runtime/application_context.h | 17 ----------------- .../ability_runtime/libability_runtime.ndk.json | 4 ---- 2 files changed, 21 deletions(-) diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index 6a1266d94..4ac78aa5a 100644 --- a/AbilityKit/ability_runtime/application_context.h +++ b/AbilityKit/ability_runtime/application_context.h @@ -109,23 +109,6 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetBundleName( AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetTempDir( char* buffer, const int32_t bufferSize, int32_t* writeLength); -/** - * @brief Obtain the resource directory of the application. - * - * @param buffer A pointer to a buffer that receives the resource directory of the application. - * @param bufferSize The length of the buffer. - * @param writeLength The string length actually written to the buffer, - * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. - * @return The error code. - * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. - * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, - * or the buffer size is less than the minimum buffer size. - * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. - * @since 16 - */ -AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetResourceDir( - char* buffer, const int32_t bufferSize, int32_t* writeLength); - /** * @brief Obtain the files directory of the application. * diff --git a/AbilityKit/ability_runtime/libability_runtime.ndk.json b/AbilityKit/ability_runtime/libability_runtime.ndk.json index f761059ab..fcde96f6c 100644 --- a/AbilityKit/ability_runtime/libability_runtime.ndk.json +++ b/AbilityKit/ability_runtime/libability_runtime.ndk.json @@ -15,10 +15,6 @@ "first_introduced": "16", "name": "OH_AbilityRuntime_ApplicationContextGetTempDir" }, - { - "first_introduced": "16", - "name": "OH_AbilityRuntime_ApplicationContextGetResourceDir" - }, { "first_introduced": "16", "name": "OH_AbilityRuntime_ApplicationContextGetFilesDir" -- Gitee From 4733f048bb09e1507695dbcb63efcc19c8601257 Mon Sep 17 00:00:00 2001 From: ajajaaj1024 Date: Thu, 12 Dec 2024 17:23:04 +0800 Subject: [PATCH 534/620] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=BE=E7=BD=AEAcc?= =?UTF-8?q?essibilityValue=E5=B1=9E=E6=80=A7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ajajaaj1024 Change-Id: I33c5b1b08216087a3bd841cbe9b9e0edb30c8922 --- arkui/ace_engine/native/libace.ndk.json | 80 ++++++++++++++++--------- arkui/ace_engine/native/native_type.h | 57 ++++++++++++++++++ 2 files changed, 109 insertions(+), 28 deletions(-) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 5d2f41050..d4a39a67f 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -510,75 +510,75 @@ { "first_introduced": "12", "name": "OH_ArkUI_PointerEvent_GetHistoryPointerId" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_PointerEvent_GetHistoryX" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_PointerEvent_GetHistoryY" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_PointerEvent_GetHistoryWindowX" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_PointerEvent_GetHistoryWindowY" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_PointerEvent_GetHistoryDisplayX" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_PointerEvent_GetHistoryDisplayY" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_PointerEvent_GetHistoryPressure" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_PointerEvent_GetHistoryTiltX" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_PointerEvent_GetHistoryTiltY" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_PointerEvent_GetHistoryTouchAreaWidth" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_PointerEvent_GetHistoryTouchAreaHeight" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_NodeEvent_GetEventType" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_NodeEvent_GetTargetId" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_NodeEvent_GetNodeHandle" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_NodeEvent_GetInputEvent" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_NodeEvent_GetNodeComponentEvent" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_NodeEvent_GetStringAsyncEvent" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_NodeEvent_GetUserData" @@ -592,7 +592,7 @@ "name": "OH_ArkUI_GetModuleInterface" }, { - "first_introduced": "12", + "first_introduced": "12", "name": "OH_ArkUI_NodeAdapter_Create" }, { @@ -678,11 +678,11 @@ { "first_introduced": "12", "name": "OH_ArkUI_WaterFlowSectionOption_SetSize" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_WaterFlowSectionOption_SetItemCount" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_WaterFlowSectionOption_SetCrossCount" @@ -706,7 +706,7 @@ { "first_introduced": "12", "name": "OH_ArkUI_WaterFlowSectionOption_GetItemCount" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_WaterFlowSectionOption_GetCrossCount" @@ -810,15 +810,15 @@ { "first_introduced": "12", "name": "OH_ArkUI_NodeContent_InsertNode" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_NodeContent_RemoveNode" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_NodeContent_RegisterCallback" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_NodeContentEvent_GetEventType" @@ -852,7 +852,7 @@ "name": "OH_ArkUI_MouseEvent_GetMouseAction" }, { - "first_introduced": "12", + "first_introduced": "12", "name": "OH_ArkUI_GuidelineOption_Create" }, { @@ -1022,7 +1022,7 @@ { "first_introduced": "12", "name": "OH_ArkUI_AlignmentRuleOption_GetBiasVertical" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_SwiperIndicator_Create" @@ -1519,6 +1519,30 @@ "first_introduced": "12", "name": "OH_ArkUI_AccessibilityValue_GetCurrent" }, + { + "first_introduced": "16", + "name": "OH_ArkUI_AccessibilityValue_SetRangeMin" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_AccessibilityValue_GetRangeMin" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_AccessibilityValue_SetRangeMax" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_AccessibilityValue_GetRangeMax" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_AccessibilityValue_SetRangeCurrent" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_AccessibilityValue_GetRangeCurrent" + }, { "first_introduced": "12", "name": "OH_ArkUI_AccessibilityValue_SetText" @@ -2432,7 +2456,7 @@ "name": "OH_NativeXComponent_RegisterKeyEventCallbackWithResult" }, { - "first_introduced": "14", + "first_introduced": "14", "name": "OH_ArkUI_KeyEvent_GetType" }, { diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index f5c62284c..8ebb2055e 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -3887,6 +3887,63 @@ void OH_ArkUI_AccessibilityValue_SetCurrent(ArkUI_AccessibilityValue* value, int */ int32_t OH_ArkUI_AccessibilityValue_GetCurrent(ArkUI_AccessibilityValue* value); +/** + * @brief Set accessibility minimum value. + * + * @param value accessibility value object. + * @param rangeMin minimum value based on range components, The default value is -1. + * @since 16 +*/ +void OH_ArkUI_AccessibilityValue_SetRangeMin(ArkUI_AccessibilityValue* value, int32_t rangeMin); + +/** + * @brief Get accessibility minimum value. + * + * @param value accessibility value object. + * @return minimum value based on range components, The default value is -1. + * If the function parameter is abnormal, return -1. + * @since 16 +*/ +int32_t OH_ArkUI_AccessibilityValue_GetRangeMin(ArkUI_AccessibilityValue* value); + +/** + * @brief Set accessibility maximum value. + * + * @param value accessibility value object. + * @param rangeMax maximum value based on range components, The default value is -1. + * @since 16 +*/ +void OH_ArkUI_AccessibilityValue_SetRangeMax(ArkUI_AccessibilityValue* value, int32_t rangeMax); + +/** + * @brief Get accessibility maximum value. + * + * @param value accessibility value object. + * @return maximum value based on range components, The default value is -1. + * If the function parameter is abnormal, return -1. + * @since 16 +*/ +int32_t OH_ArkUI_AccessibilityValue_GetRangeMax(ArkUI_AccessibilityValue* value); + +/** + * @brief Set accessibility current value. + * + * @param value accessibility value object. + * @param rangeCurrent value based on range components, The default value is -1. + * @since 16 +*/ +void OH_ArkUI_AccessibilityValue_SetRangeCurrent(ArkUI_AccessibilityValue* value, int32_t rangeCurrent); + +/** + * @brief Get accessibility current value. + * + * @param value accessibility value object. + * @return current value based on range components, The default value is -1. + * If the function parameter is abnormal, return -1. + * @since 16 +*/ +int32_t OH_ArkUI_AccessibilityValue_GetRangeCurrent(ArkUI_AccessibilityValue* value); + /** * @brief Set accessibility text value. * -- Gitee From b49d2a5da67d17bfb7c3e24bed34ad0a730b1888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Fri, 13 Dec 2024 18:31:24 +0800 Subject: [PATCH 535/620] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=86=85=E5=AD=98=E5=83=8F=E7=B4=A0=E5=9C=B0=E5=9D=80=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../include/image/pixelmap_native.h | 26 +++++++++++++++++++ .../image_framework/libpixelmap.ndk.json | 8 ++++++ 2 files changed, 34 insertions(+) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index c7ea3eb57..6d33db8d4 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -901,6 +901,32 @@ Image_ErrorCode OH_PixelmapNative_SetColorSpaceNative(OH_PixelmapNative *pixelma */ Image_ErrorCode OH_PixelmapNative_SetMemoryName(OH_PixelmapNative *pixelmap, char *name, size_t *size); +/** + * @brief Obtains the memory address of a PixelMap and locks the memory. + * + * @param pixelmap The PixelMap pointer to be operated. + * @param addr The double pointer to the memory address of the PixelMap. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the operation is successful. + * {@link IMAGE_BAD_PARAMETER} If invalid parameter, pixelmap or addr are invalid. + * @see OH_PixelmapNative + * @since 16 + */ +Image_ErrorCode OH_PixelmapNative_AccessPixels(OH_PixelmapNative *pixelmap, void **addr); + +/** + * @brief Unlocks the memory of the PixelMap data. + * This function is used with {@link OH_PixelmapNative_AccessPixels} in pairs. + * + * @param pixelmap The PixelMap pointer to be operated. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the operation is successful. + * {@link IMAGE_BAD_PARAMETER} If invalid parameter, pixelmap is invalid. + * @see OH_PixelmapNative + * @since 16 + */ +Image_ErrorCode OH_PixelmapNative_UnaccessPixels(OH_PixelmapNative *pixelmap); + #ifdef __cplusplus }; #endif diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index 4c103c8ae..c276ec615 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -182,5 +182,13 @@ { "first_introduced": "13", "name": "OH_PixelmapNative_SetMemoryName" + }, + { + "first_introduced": "16", + "name": "OH_PixelmapNative_AccessPixels" + }, + { + "first_introduced": "16", + "name": "OH_PixelmapNative_UnaccessPixels" } ] \ No newline at end of file -- Gitee From 8765ac390b524c02e58265f7697e602e93d5af9e Mon Sep 17 00:00:00 2001 From: wujinhui Date: Mon, 16 Dec 2024 11:07:32 +0800 Subject: [PATCH 536/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=8F=82=E6=95=B0=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wujinhui --- arkui/ace_engine/native/native_interface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_interface.h b/arkui/ace_engine/native/native_interface.h index 2c138912c..64cae7e06 100644 --- a/arkui/ace_engine/native/native_interface.h +++ b/arkui/ace_engine/native/native_interface.h @@ -64,7 +64,7 @@ typedef enum { * * @param type Indicates the type of the native API set provided by ArkUI, for example, ARKUI_NATIVE_NODE * and ARKUI_NATIVE_GESTURE. - * @param sturctName Indicates the name of a native struct defined in the corresponding header file, for example, + * @param structName Indicates the name of a native struct defined in the corresponding header file, for example, * ArkUI_NativeNodeAPI_1 in . * @return Returns the pointer to the abstract native API, which can be used after being converted into a specific type. * @code {.cpp} -- Gitee From b5132fdb807b1fc4b3ea532e2126d4b764b698db Mon Sep 17 00:00:00 2001 From: liumingxiang Date: Mon, 16 Dec 2024 14:53:21 +0800 Subject: [PATCH 537/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liumingxiang --- graphic/graphic_2d/native_drawing/drawing_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h index c1bfda620..65a39f672 100644 --- a/graphic/graphic_2d/native_drawing/drawing_types.h +++ b/graphic/graphic_2d/native_drawing/drawing_types.h @@ -486,7 +486,7 @@ typedef struct { * @version 1.0 */ typedef struct { - /** A pointer to a byte string containing UTF-16BE(Big Endian) encoded entities */ + /** A pointer to a byte string containing UTF-16 encoded entities */ uint8_t* strData; /** The length of `strData` in bytes */ uint32_t strLen; -- Gitee From 599a1e0e473cba255d818df02c0d30d1eb2f1340 Mon Sep 17 00:00:00 2001 From: zhouyan Date: Mon, 16 Dec 2024 15:49:00 +0800 Subject: [PATCH 538/620] =?UTF-8?q?=E4=BF=AE=E5=A4=8DAPI=20Lint=E5=91=8A?= =?UTF-8?q?=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhouyan Change-Id: I3abd2498536cbbb3bdb5c302e7638df02334ad9a --- arkui/ace_engine/native/native_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 8ebb2055e..0e7abf9f0 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -3522,7 +3522,7 @@ ArkUI_CustomSpanMetrics* OH_ArkUI_CustomSpanMetrics_Create(); /** * @brief Disposes of measurement metrics of this custom span. * - * @param info The CustomSpanMetrics instance to be destroyed. + * @param metrics The CustomSpanMetrics instance to be destroyed. * @since 12 */ void OH_ArkUI_CustomSpanMetrics_Dispose(ArkUI_CustomSpanMetrics* metrics); -- Gitee From 8a33122f14959c8564a95261fb8b1a15c9fc4ae9 Mon Sep 17 00:00:00 2001 From: w30052974 Date: Mon, 16 Dec 2024 19:13:42 +0800 Subject: [PATCH 539/620] interface_sdk addtogroup fixed Signed-off-by: w30052974 --- ai/neural_network_runtime/neural_network_core.h | 2 +- ai/neural_network_runtime/neural_network_runtime.h | 2 +- ai/neural_network_runtime/neural_network_runtime_type.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ai/neural_network_runtime/neural_network_core.h b/ai/neural_network_runtime/neural_network_core.h index 8d0665738..c3485d5c5 100644 --- a/ai/neural_network_runtime/neural_network_core.h +++ b/ai/neural_network_runtime/neural_network_core.h @@ -14,7 +14,7 @@ */ /** - * @addtogroup NeuralNeworkRuntime + * @addtogroup NeuralNetworkRuntime * @{ * * @brief Provides APIs of Neural Network Runtime for accelerating the model inference. diff --git a/ai/neural_network_runtime/neural_network_runtime.h b/ai/neural_network_runtime/neural_network_runtime.h index 294b362f5..a92a27d83 100644 --- a/ai/neural_network_runtime/neural_network_runtime.h +++ b/ai/neural_network_runtime/neural_network_runtime.h @@ -14,7 +14,7 @@ */ /** - * @addtogroup NeuralNeworkRuntime + * @addtogroup NeuralNetworkRuntime * @{ * * @brief Provides APIs of Neural Network Runtime for accelerating the model inference. diff --git a/ai/neural_network_runtime/neural_network_runtime_type.h b/ai/neural_network_runtime/neural_network_runtime_type.h index 414fa872c..5c003b0a8 100644 --- a/ai/neural_network_runtime/neural_network_runtime_type.h +++ b/ai/neural_network_runtime/neural_network_runtime_type.h @@ -14,7 +14,7 @@ */ /** - * @addtogroup NeuralNeworkRuntime + * @addtogroup NeuralNetworkRuntime * @{ * * @brief Provides APIs for accelerating the Neural Network Runtime model inference. -- Gitee From 27ac054255ca1c88fd0b11f818f7c25b59a42324 Mon Sep 17 00:00:00 2001 From: WangJiazhen Date: Tue, 17 Dec 2024 10:39:45 +0800 Subject: [PATCH 540/620] api lint Signed-off-by: WangJiazhen --- .../native/native_interface_xcomponent.h | 4 +++- arkui/ace_engine/native/native_type.h | 14 +++++++------- .../native/native_xcomponent_key_event.h | 9 ++++++++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/arkui/ace_engine/native/native_interface_xcomponent.h b/arkui/ace_engine/native/native_interface_xcomponent.h index c06d6cec6..5bdad5100 100644 --- a/arkui/ace_engine/native/native_interface_xcomponent.h +++ b/arkui/ace_engine/native/native_interface_xcomponent.h @@ -28,7 +28,8 @@ * @file native_interface_xcomponent.h * * @brief Declares APIs for accessing a Native XComponent. - * + * @library libace_ndk.z.so + * @syscap SystemCapability.ArkUI.ArkUI.Full * @kit ArkUI * @since 8 * @version 1.0 @@ -848,3 +849,4 @@ int32_t OH_NativeXComponent_RegisterKeyEventCallbackWithResult( }; #endif #endif // _NATIVE_INTERFACE_XCOMPONENT_H_ +/** @} */ \ No newline at end of file diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 8ebb2055e..674e103b1 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -2986,7 +2986,7 @@ void OH_ArkUI_AlignmentRuleOption_Dispose(ArkUI_AlignmentRuleOption* option); * * @param option Alignment rule information of subcomponents in the relative container. * @param id The id value of the anchor component. - * @param value Alignment relative to the anchor component. + * @param alignment Alignment relative to the anchor component. * @since 12 */ void OH_ArkUI_AlignmentRuleOption_SetStart( @@ -2997,7 +2997,7 @@ void OH_ArkUI_AlignmentRuleOption_SetStart( * * @param option Alignment rule information of subcomponents in the relative container. * @param id The id value of the anchor component. - * @param value Alignment relative to the anchor component. + * @param alignment Alignment relative to the anchor component. * @since 12 */ void OH_ArkUI_AlignmentRuleOption_SetEnd( @@ -3008,7 +3008,7 @@ void OH_ArkUI_AlignmentRuleOption_SetEnd( * * @param option Alignment rule information of subcomponents in the relative container. * @param id The id value of the anchor component. -* @param value Alignment relative to anchor component +* @param alignment Alignment relative to anchor component * @since 12 */ void OH_ArkUI_AlignmentRuleOption_SetCenterHorizontal( @@ -3019,7 +3019,7 @@ void OH_ArkUI_AlignmentRuleOption_SetCenterHorizontal( * * @param option Alignment rule information of subcomponents in the relative container. * @param id The id value of the anchor component. - * @param value Alignment relative to anchor component + * @param alignment Alignment relative to anchor component * @since 12 */ void OH_ArkUI_AlignmentRuleOption_SetTop(ArkUI_AlignmentRuleOption* option, const char* id, @@ -3030,7 +3030,7 @@ void OH_ArkUI_AlignmentRuleOption_SetTop(ArkUI_AlignmentRuleOption* option, cons * * @param option Alignment rule information of subcomponents in the relative container. * @param id The id value of the anchor component. - * @param value Alignment relative to anchor component + * @param alignment Alignment relative to anchor component * @since 12 */ void OH_ArkUI_AlignmentRuleOption_SetBottom( @@ -3041,7 +3041,7 @@ void OH_ArkUI_AlignmentRuleOption_SetBottom( * * @param option Alignment rule information of subcomponents in the relative container. * @param id The id value of the anchor component. -* @param value Alignment relative to the anchor component. +* @param alignment Alignment relative to the anchor component. * @since 12 */ void OH_ArkUI_AlignmentRuleOption_SetCenterVertical( @@ -3060,7 +3060,7 @@ void OH_ArkUI_AlignmentRuleOption_SetBiasHorizontal(ArkUI_AlignmentRuleOption* o * @brief Set the vertical offset parameter of the component under the anchor point constraint. * * @param option Alignment rule information of subcomponents in the relative container. - * @param horizontal bias value in the vertical direction. + * @param vertical bias value in the vertical direction. * @since 12 */ void OH_ArkUI_AlignmentRuleOption_SetBiasVertical(ArkUI_AlignmentRuleOption* option, float vertical); diff --git a/arkui/ace_engine/native/native_xcomponent_key_event.h b/arkui/ace_engine/native/native_xcomponent_key_event.h index 3bde2de13..f4b178cc1 100644 --- a/arkui/ace_engine/native/native_xcomponent_key_event.h +++ b/arkui/ace_engine/native/native_xcomponent_key_event.h @@ -16,13 +16,19 @@ /** * @addtogroup OH_NativeXComponent Native XComponent * @{ + * + * @brief Describes the key event held by the ArkUI XComponent, which can be used for the EGL/OpenGL ES. + * + * @since 10 + * @version 1.0 */ /** * @file native_xcomponent_key_event.h * * @brief Declares enums for key event of Native XComponent. - * + * @library libace_ndk.z.so + * @syscap SystemCapability.ArkUI.ArkUI.Full * @kit ArkUI * @since 10 * @version 1.0 @@ -390,3 +396,4 @@ typedef enum { }; #endif #endif // _NATIVE_INTERFACE_XCOMPONENT_KEY_EVENT_H_ +/** @} */ \ No newline at end of file -- Gitee From 4659b12cda5a7becb3aa18a930809eb584c98bd3 Mon Sep 17 00:00:00 2001 From: y30053096 Date: Tue, 26 Nov 2024 20:34:04 +0800 Subject: [PATCH 541/620] add enum for ndk Signed-off-by: y30053096 Change-Id: I000536d9cd10d1f3092ff3f0019766dc5e341313 --- security/huks/include/native_huks_type.h | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/security/huks/include/native_huks_type.h b/security/huks/include/native_huks_type.h index b7d00d8ca..49f976334 100644 --- a/security/huks/include/native_huks_type.h +++ b/security/huks/include/native_huks_type.h @@ -137,6 +137,14 @@ enum OH_Huks_KeyPadding { OH_HUKS_PADDING_PKCS5 = 4, /** PKCS #7. */ OH_HUKS_PADDING_PKCS7 = 5, + /** ISO IEC 9796-2 + * @since 16 + */ + OH_HUKS_PADDING_ISO_IEC_9796_2 = 6, + /** ISO IEC 9797-1 + * @since 16 + */ + OH_HUKS_PADDING_ISO_IEC_9797_1 = 7, }; /** @@ -217,6 +225,19 @@ enum OH_Huks_KeySize { OH_HUKS_SM2_KEY_SIZE_256 = 256, /** ShangMi4 (SM4) key of 128 bits. */ OH_HUKS_SM4_KEY_SIZE_128 = 128, + + /** DES key of 64 bits. + * @since 16 + */ + OH_HUKS_DES_KEY_SIZE_64 = 64, + /** 3DES key of 128 bits. + * @since 16 + */ + OH_HUKS_3DES_KEY_SIZE_128 = 128, + /** 3DES key of 192 bits. + * @since 16 + */ + OH_HUKS_3DES_KEY_SIZE_192 = 192, }; /** @@ -257,6 +278,19 @@ enum OH_Huks_KeyAlg { OH_HUKS_ALG_SM3 = 151, /** SM4. */ OH_HUKS_ALG_SM4 = 152, + + /** DES. + * @since 16 + */ + OH_HUKS_ALG_DES = 160, + /** 3DES. + * @since 16 + */ + OH_HUKS_ALG_3DES = 161, + /** CMAC. + * @since 16 + */ + OH_HUKS_ALG_CMAC = 162, }; /** -- Gitee From a710f02a71385289d26eb1fca77905b58660212b Mon Sep 17 00:00:00 2001 From: chenjunxiang Date: Tue, 17 Dec 2024 17:58:31 +0800 Subject: [PATCH 542/620] =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenjunxiang Change-Id: I1d1d30199733564b67f6fe83d9b0ff3e45ea366f --- arkui/ace_engine/native/native_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 8ebb2055e..8ffdba928 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -3825,7 +3825,7 @@ ArkUI_AccessibilityValue* OH_ArkUI_AccessibilityValue_Create(void); /** * @brief Dispose accessibility value. * -* @param state accessibility value object. +* @param value accessibility value object. * @since 12 */ void OH_ArkUI_AccessibilityValue_Dispose(ArkUI_AccessibilityValue* value); -- Gitee From 53fadeca1a3cc4da3869f5dc07f3daae9a06e8a2 Mon Sep 17 00:00:00 2001 From: sun-xinyan Date: Tue, 17 Dec 2024 20:15:46 +0800 Subject: [PATCH 543/620] =?UTF-8?q?CAPI=20Lint=E5=91=8A=E8=AD=A6=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sun-xinyan Change-Id: Ie8e63e10bae5a586e9aece6d0a628f299571a039 --- arkui/ace_engine/native/native_animate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_animate.h b/arkui/ace_engine/native/native_animate.h index 1538ee9c5..858ccfa39 100644 --- a/arkui/ace_engine/native/native_animate.h +++ b/arkui/ace_engine/native/native_animate.h @@ -1189,4 +1189,4 @@ int32_t OH_ArkUI_TransitionEffect_SetAnimation( #endif #endif // ARKUI_NATIVE_ANIMATE_H -/** @}*/ \ No newline at end of file +/** @} */ \ No newline at end of file -- Gitee From 9ab3dcef694a62aba2c9d992372ac01cfcb74f29 Mon Sep 17 00:00:00 2001 From: WangYing225 Date: Mon, 16 Dec 2024 15:09:52 +0800 Subject: [PATCH 544/620] =?UTF-8?q?=E8=A1=A5=E5=85=85CAPI=E5=88=9B?= =?UTF-8?q?=E5=BB=BATEXTURE=E7=B1=BB=E5=9E=8Bxcomponent=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: WangYing225 --- arkui/ace_engine/native/native_node.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 14ac42137..ccbb77543 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -92,6 +92,10 @@ typedef enum { ARKUI_NODE_RADIO = 18, /** Image animator. */ ARKUI_NODE_IMAGE_ANIMATOR = 19, + /** XComponent of type TEXTURE. + * @since 16 + */ + ARKUI_NODE_XCOMPONENT_TEXTURE, /** Stack container. */ ARKUI_NODE_STACK = MAX_NODE_SCOPE_NUM, /** Swiper. */ -- Gitee From 19c4b90667392feba0798395542f7f3d32db9081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Wed, 18 Dec 2024 12:06:02 +0800 Subject: [PATCH 545/620] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- multimedia/image_framework/include/image/image_common.h | 2 ++ multimedia/image_framework/include/image/pixelmap_native.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index 43c3af017..d414451ba 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -174,6 +174,8 @@ typedef enum { IMAGE_ALLOC_FAILED = 7600301, /** memory copy failed */ IMAGE_COPY_FAILED = 7600302, + /** @error memory lock or unlock failed */ + IMAGE_LOCK_UNLOCK_FAILED = 7600303, /** unknown error */ IMAGE_UNKNOWN_ERROR = 7600901, /** decode data source exception */ diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 6d33db8d4..ad645d2c8 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -903,12 +903,15 @@ Image_ErrorCode OH_PixelmapNative_SetMemoryName(OH_PixelmapNative *pixelmap, cha /** * @brief Obtains the memory address of a PixelMap and locks the memory. + * When the memory is locked, any operation that modifies or releases the PixelMap will fail and return + * {@link IMAGE_BAD_PARAMETER}. * * @param pixelmap The PixelMap pointer to be operated. * @param addr The double pointer to the memory address of the PixelMap. * @return Function result code: * {@link IMAGE_SUCCESS} If the operation is successful. * {@link IMAGE_BAD_PARAMETER} If invalid parameter, pixelmap or addr are invalid. + * {@link IMAGE_LOCK_UNLOCK_FAILED} If memory failed to be locked. * @see OH_PixelmapNative * @since 16 */ @@ -922,6 +925,7 @@ Image_ErrorCode OH_PixelmapNative_AccessPixels(OH_PixelmapNative *pixelmap, void * @return Function result code: * {@link IMAGE_SUCCESS} If the operation is successful. * {@link IMAGE_BAD_PARAMETER} If invalid parameter, pixelmap is invalid. + * {@link IMAGE_LOCK_UNLOCK_FAILED} If memory failed to be unlocked. * @see OH_PixelmapNative * @since 16 */ -- Gitee From 20148b77fd42ae452f3fb57ed886e2b012c4c6f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Wed, 18 Dec 2024 14:25:14 +0800 Subject: [PATCH 546/620] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- multimedia/image_framework/include/image/image_common.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index d414451ba..1626ecbee 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -174,7 +174,10 @@ typedef enum { IMAGE_ALLOC_FAILED = 7600301, /** memory copy failed */ IMAGE_COPY_FAILED = 7600302, - /** @error memory lock or unlock failed */ + /** + * @error memory lock or unlock failed + * @since 16 + */ IMAGE_LOCK_UNLOCK_FAILED = 7600303, /** unknown error */ IMAGE_UNKNOWN_ERROR = 7600901, -- Gitee From 6f280ffeee81b7247bf4a1ad0589e7a7cb7b7747 Mon Sep 17 00:00:00 2001 From: owenCreeper Date: Wed, 18 Dec 2024 07:13:47 +0000 Subject: [PATCH 547/620] add unprocessed Signed-off-by: owenCreeper --- .../audio_framework/common/native_audiostream_base.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/multimedia/audio_framework/common/native_audiostream_base.h b/multimedia/audio_framework/common/native_audiostream_base.h index 718976920..894bc4fd4 100644 --- a/multimedia/audio_framework/common/native_audiostream_base.h +++ b/multimedia/audio_framework/common/native_audiostream_base.h @@ -445,7 +445,13 @@ typedef enum { * * @since 13 */ - AUDIOSTREAM_SOURCE_TYPE_CAMCORDER = 13 + AUDIOSTREAM_SOURCE_TYPE_CAMCORDER = 13, + /** + * Unprocessed source type. + * + * @since 14 + */ + AUDIOSTREAM_SOURCE_TYPE_UNPROCESSED = 14 } OH_AudioStream_SourceType; /** -- Gitee From a5fd86f95ed41abe1d737702ed4a63b3c966b32d Mon Sep 17 00:00:00 2001 From: zhangkai Date: Wed, 18 Dec 2024 16:05:06 +0800 Subject: [PATCH 548/620] =?UTF-8?q?api=20lint=E5=91=8A=E8=AD=A6=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangkai --- multimedia/audio_framework/audio_manager/native_audio_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_manager.h b/multimedia/audio_framework/audio_manager/native_audio_manager.h index 0c5232d6c..8bfbf2c89 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_manager.h @@ -67,7 +67,7 @@ OH_AudioCommon_Result OH_GetAudioManager(OH_AudioManager **audioManager); /** * @brief Get audio scene. * - * @param audioManager the {@link OH_AudioManager} handle received from {@link OH_GetAudioManager}. + * @param manager the {@link OH_AudioManager} handle received from {@link OH_GetAudioManager}. * @param scene the {@link OH_AudioScene} pointer to receive the result. * @return Function result code: * {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful. -- Gitee From 4942fdc41217704e8386fab638163c2005f81276 Mon Sep 17 00:00:00 2001 From: bluhuang Date: Wed, 6 Nov 2024 15:13:04 +0800 Subject: [PATCH 549/620] preferences support CLKV Signed-off-by: bluhuang --- .../preferences/include/oh_preferences.h | 12 +++++++++ .../include/oh_preferences_option.h | 25 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/distributeddatamgr/preferences/include/oh_preferences.h b/distributeddatamgr/preferences/include/oh_preferences.h index 944fa9dff..837891ae7 100644 --- a/distributeddatamgr/preferences/include/oh_preferences.h +++ b/distributeddatamgr/preferences/include/oh_preferences.h @@ -263,6 +263,18 @@ int OH_Preferences_RegisterDataObserver(OH_Preferences *preference, void *contex int OH_Preferences_UnregisterDataObserver(OH_Preferences *preference, void *context, OH_PreferencesDataObserver observer, const char *keys[], uint32_t keyCount); +/** + * @brief Check if a type is supported or not. + * + * @param type the storage type of {@Link Preferences_StorageType}. + * @param isSupported Pointer to the Boolean value obtained. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} indicates the operation is successful. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * @since 16 + */ +int OH_Preferences_IsStorageTypeSupported(Preferences_StorageType type, bool *isSupported); + #ifdef __cplusplus }; #endif diff --git a/distributeddatamgr/preferences/include/oh_preferences_option.h b/distributeddatamgr/preferences/include/oh_preferences_option.h index 80ae78809..9100f4054 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_option.h +++ b/distributeddatamgr/preferences/include/oh_preferences_option.h @@ -52,6 +52,18 @@ extern "C" { */ typedef struct OH_PreferencesOption OH_PreferencesOption; +/** + * @brief Enumerates the preferences storage types. + * + * @since 16 + */ +typedef enum Preferences_StorageType { + /** XML storage*/ + PREFERENCES_STORAGE_XML = 0, + /** CLKV storage */ + PREFERENCES_STORAGE_CLKV +} Preferences_StorageType; + /** * @brief Creates an {@Link OH_PreferencesOption} instance. * @@ -101,6 +113,19 @@ int OH_PreferencesOption_SetBundleName(OH_PreferencesOption *option, const char */ int OH_PreferencesOption_SetDataGroupId(OH_PreferencesOption *option, const char *dataGroupId); +/** + * @brief Sets the storage type in an {@Link OH_PreferencesOption} instance. + * + * @param option Represents a pointer to an {@link OH_PreferencesOption} instance. + * @param type Represents preferences storage type. + * @return Returns the status code of the execution. + * {@link PREFERENCES_OK} success. + * {@link PREFERENCES_ERROR_INVALID_PARAM} indicates invalid args are passed in. + * @see OH_PreferencesOption. + * @since 16 + */ +int OH_PreferencesOption_SetStorageType(OH_PreferencesOption *option, Preferences_StorageType type); + /** * @brief Destroys an {@Link OH_PreferencesOption} instance. * -- Gitee From 3287b43a3308e2df0db3663f93c8d5c1b95d62ac Mon Sep 17 00:00:00 2001 From: lihui Date: Mon, 9 Dec 2024 15:00:08 +0800 Subject: [PATCH 550/620] add native buffer format enum Signed-off-by: lihui --- graphic/graphic_2d/native_buffer/native_buffer.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/graphic/graphic_2d/native_buffer/native_buffer.h b/graphic/graphic_2d/native_buffer/native_buffer.h index 154df76d3..9460c7bc9 100644 --- a/graphic/graphic_2d/native_buffer/native_buffer.h +++ b/graphic/graphic_2d/native_buffer/native_buffer.h @@ -193,6 +193,16 @@ typedef enum OH_NativeBuffer_Format { * @since 12 */ NATIVEBUFFER_PIXEL_FMT_RAW10, + /** + * BLOB format + * @since 16 + */ + NATIVEBUFFER_PIXEL_FMT_BLOB, + /** + * RGBA16 float format + * @since 16 + */ + NATIVEBUFFER_PIXEL_FMT_RGBA16_FLOAT, /** * vender mask format * @since 12 -- Gitee From 6cceaafa56df8932398f489555c70a842671786a Mon Sep 17 00:00:00 2001 From: wangyimin Date: Mon, 16 Dec 2024 16:54:50 +0800 Subject: [PATCH 551/620] cherry-pick jsvm api Signed-off-by: wangyimin --- ark_runtime/jsvm/jsvm.h | 465 ++++++++++++++++++++++++++++++ ark_runtime/jsvm/jsvm_types.h | 234 +++++++++++++++ ark_runtime/jsvm/libjsvm.ndk.json | 116 ++++++++ 3 files changed, 815 insertions(+) diff --git a/ark_runtime/jsvm/jsvm.h b/ark_runtime/jsvm/jsvm.h index 830971a20..3a5d3f7a3 100644 --- a/ark_runtime/jsvm/jsvm.h +++ b/ark_runtime/jsvm/jsvm.h @@ -121,6 +121,18 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Init(const JSVM_InitOptions* options); JSVM_EXTERN JSVM_Status OH_JSVM_CreateVM(const JSVM_CreateVMOptions* options, JSVM_VM* result); +/** + * @brief This function controls how Microtasks are invoked of the vm. If the method is not + * called, the default microtask policy of vm is JSVM_MicrotaskPolicy::JSVM_MICROTASK_AUTO. + * + * @param vm The VM instance to set mircrotasks policy. + * @param policy Policy for running microtasks. + * @return Returns JSVM_OK if the API succeeded. + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_SetMicrotaskPolicy(JSVM_VM vm, + JSVM_MicrotaskPolicy policy); + /** * @brief Destroys VM instance. * @@ -131,6 +143,61 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateVM(const JSVM_CreateVMOptions* options, */ JSVM_EXTERN JSVM_Status OH_JSVM_DestroyVM(JSVM_VM vm); +/** + * @brief This API allocates a default JavaScript Proxy. It is the equivalent of + * doing new Proxy(target, handler) in JavaScript. + * + * @param env The environment that the API is invoked under. + * @param target A JSVM_Value representing the JavaScript Object which you want to proxy. + * @param handler A JSVM_Value representing the JavaScript Object that defines which + * operations will be intercepted and how to redefine intercepted operations. + * @param result A JSVM_Value representing a JavaScript Proxy. + * @return Returns JSVM functions result code. + * {@link JSVM_OK } if the API succeeded. \n + * {@link JSVM_INVALID_ARG } if the any of the input arguments is NULL. \n + * {@link JSVM_OBJECT_EXPECTED} if target or handler is not Javascript Object. \n + * {@link JSVM_PENDING_EXCEPTION} if an exception occurs. \n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_CreateProxy(JSVM_Env env, + JSVM_Value target, + JSVM_Value handler, + JSVM_Value* result); + +/** + * @brief This API checks if the value passed in is a Proxy. + * + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param isProxy Whether the given value is Proxy. + * @return Returns JSVM functions result code. + * {@link JSVM_OK } if the API succeeded. \n + * {@link JSVM_INVALID_ARG } if the any of the input arguments is NULL. \n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_IsProxy(JSVM_Env env, + JSVM_Value value, + bool* isProxy); + +/** + * @brief This API gets target from proxy. + * + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript Proxy whose target to return. + * @param result Target of the given proxy. + * @return Returns JSVM functions result code. + * {@link JSVM_OK } if the API succeeded. \n + * {@link JSVM_INVALID_ARG } if the any of the input arguments is NULL. \n + * {@link JSVM_INVALID_TYPE} if value is not a Javascript Proxy. \n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_ProxyGetTarget(JSVM_Env env, + JSVM_Value value, + JSVM_Value* result); + /** * @brief This API open a new VM scope for the VM instance. * @@ -2314,6 +2381,28 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsPromise(JSVM_Env env, JSVM_Value value, bool* isPromise); +/** + * @brief This API register a resolution/rejection handler with a promise. + * @param env The environment that the API is invoked under. + * @param promise The promise to be handled. + * @param onFulfilled The function to be invoked if promise is resolved. + * @param onRejected The function to be invoked if promise is rejected. + * @param result Another promise returned from promise then/catch method. + * @return Returns JSVM functions result code. + * {@link JSVM_OK } if the API succeeded. \n + * {@link JSVM_INVALID_ARG } if the arguments are invalid. \n + * {@link JSVM_INVALID_TYPE } if the arguments are invalid Javascript type. \n + * {@link JSVM_PENDING_EXCEPTION} if an exception occurs. \n + * {@link JSVM_GENERIC_FAILURE} if the API failed. \n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_PromiseRegisterHandler(JSVM_Env env, + JSVM_Value promise, + JSVM_Value onFulfilled, + JSVM_Value onRejected, + JSVM_Value* result); + /** * @brief This API parses a JSON string and returns it as value if successful. * @param env The environment that the API is invoked under. @@ -3207,6 +3296,382 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateDataReference(JSVM_Env env, JSVM_EXTERN JSVM_Status OH_JSVM_GetReferenceData(JSVM_Env env, JSVM_Ref ref, JSVM_Data* result); + +/** + * @brief Check whether the given JSVM_Value is a BigInt Object. + * + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given value is a BigInt Object. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_IsBigIntObject(JSVM_Env env, + JSVM_Value value, + bool* result); + +/** + * @brief Check whether the given JSVM_Value is a Boolean Object. + * + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given value is a Boolean Object. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_IsBooleanObject(JSVM_Env env, + JSVM_Value value, + bool* result); + +/** + * @brief Check whether the given JSVM_Value is a String Object. + * + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given value is a String Object. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_IsStringObject(JSVM_Env env, + JSVM_Value value, + bool* result); + +/** + * @brief Check whether the given JSVM_Value is a Number Object. + * + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given value is a Number Object. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_IsNumberObject(JSVM_Env env, + JSVM_Value value, + bool* result); + +/** + * @brief Check whether the given JSVM_Value is a Symbol Object. + * + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given value is a Symbol Object. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_IsSymbolObject(JSVM_Env env, + JSVM_Value value, + bool* result); + +/** + * @brief This API returns the Symbol.asyncIterator of Well-Known Symbols. + * + * @param env The environment that the API is invoked under. + * @param result The Symbol.asyncIterator of Well-Known Symbols. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_GetSymbolAsyncIterator(JSVM_Env env, JSVM_Value* result); + +/** + * @brief This API returns the Symbol.hasInstance of Well-Known Symbols. + * + * @param env The environment that the API is invoked under. + * @param result The Symbol.hasInstance of Well-Known Symbols. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_GetSymbolHasInstance(JSVM_Env env, JSVM_Value* result); + +/** + * @brief This API returns the Symbol.isConcatSpreadable of Well-Known Symbols + * + * @param env The environment that the API is invoked under. + * @param result The Symbol.isConcatSpreadable of Well-Known Symbols. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_GetSymbolIsConcatSpreadable(JSVM_Env env, JSVM_Value* result); + +/** + * @brief This API returns the Symbol.match of Well-Known Symbols + * + * @param env The environment that the API is invoked under. + * @param result The Symbol.match of Well-Known Symbols. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_GetSymbolMatch(JSVM_Env env, JSVM_Value* result); + +/** + * @brief This API returns the Symbol.replace of Well-Known Symbols + * + * @param env The environment that the API is invoked under. + * @param result The Symbol.replace of Well-Known Symbols. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_GetSymbolReplace(JSVM_Env env, JSVM_Value* result); + +/** + * @brief This API returns the Symbol.search of Well-Known Symbols + * + * @param env The environment that the API is invoked under. + * @param result The Symbol.search of Well-Known Symbols. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_GetSymbolSearch(JSVM_Env env, JSVM_Value* result); + +/** + * @brief This API returns the Symbol.split of Well-Known Symbols + * + * @param env The environment that the API is invoked under. + * @param result The Symbol.split of Well-Known Symbols. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_GetSymbolSplit(JSVM_Env env, JSVM_Value* result); + +/** + * @brief This API returns the Symbol.toPrimitive of Well-Known Symbols + * + * @param env The environment that the API is invoked under. + * @param result The Symbol.toPrimitive of Well-Known Symbols. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_GetSymbolToPrimitive(JSVM_Env env, JSVM_Value* result); + +/** + * @brief This API returns the Symbol.unscopables of Well-Known Symbols + * + * @param env The environment that the API is invoked under. + * @param result The Symbol.unscopables of Well-Known Symbols. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_GetSymbolUnscopables(JSVM_Env env, JSVM_Value* result); + +/** + * @brief This API returns the Symbol.toStringTag of Well-Known Symbols + * + * @param env The environment that the API is invoked under. + * @param result The Symbol.toStringTag of Well-Known Symbols. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_GetSymbolToStringTag(JSVM_Env env, JSVM_Value* result); + +/** + * @brief This API returns the Symbol.iterator of Well-Known Symbols + * + * @param env The environment that the API is invoked under. + * @param result The Symbol.iterator of Well-Known Symbols. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_GetSymbolIterator(JSVM_Env env, JSVM_Value* result); + +/** + * @brief Trace start with specified categories for all JSVM VM.(Non-thread-safe) + * + * @param count The count of trace categories. + * @param categories Select internal trace events for tracing by categories. + * @param tag User-defined tag of trace data. + * @param eventsCount Number of trace events. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if categories or count is illegal.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_TraceStart(size_t count, const JSVM_TraceCategory* categories, + const char* tag, size_t eventsCount); + +/** + * @brief Trace stop for specified categories for all JSVM VM.(Non-thread-safe) + * + * @param stream The output stream callback for receiving the data. + * @param streamData Data passed to the stream callback. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if stream or streamData is NULL\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_TraceStop(JSVM_OutputStream stream, void* streamData); + +/** + * @brief Set Handler For OOM Error. If this function is invoked repeatedly, + * only the last time takes effect. When handler is null, the previous setting is canceled. + * + * @param vm The environment that the API is invoked under. + * @param handler The handler for OOM Error. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if vm is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_SetHandlerForOOMError(JSVM_VM vm, + JSVM_HandlerForOOMError handler); + +/** + * @brief Set Handler For Fatal Error. If this function is invoked repeatedly, + * only the last time takes effect. When handler is null, the previous setting is canceled. + * + * @param vm The environment that the API is invoked under. + * @param handler The handler for Fatal Error. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if vm is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_SetHandlerForFatalError(JSVM_VM vm, + JSVM_HandlerForFatalError handler); + +/** + * @brief Set Handler For Promise Reject. If this function is invoked repeatedly, + * only the last time takes effect. When handler is null, the previous setting is canceled. + * + * @param vm The environment that the API is invoked under. + * @param handler The handler for Promise Reject. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if vm is NULL.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_SetHandlerForPromiseReject(JSVM_VM vm, + JSVM_HandlerForPromiseReject handler); + +/** + * @brief When wrapping a C++ class, the C++ constructor callback passed via constructor + * should be a static method on the class that calls the actual class constructor, then + * wraps the new C++ instance in a JavaScript object according to the different Options + * passed in, and returns the wrapper object. + * + * @param env The environment that the API is invoked under. + * @param utf8name Name of the JavaScript constructor function. For clarity, it is + * recommended to use the C++ class name when wrapping a C++ class. + * @param length The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it + * is null-terminated. + * @param constructor Struct include callback function that handles constructing instances of the class. + * When wrapping a C++ class, this method must be a static member with the JSVM_Callback.callback + * signature. A C++ class constructor cannot be used. + * Include Optional data to be passed to the constructor callback as the data + * property of the callback info. JSVM_Callback provides more details. + * @param propertyCount Number of items in the properties array argument. + * @param properties Array of property descriptors describing static and instance data + * properties, accessors, and methods on the class See JSVM_PropertyDescriptor. + * @param parentClass The parent-class of the currently defined class. + * @param option_count Number of items in an option array argument. + * @param options DefineClass options to be passed. + * @param result A JSVM_Value representing the constructor function for the class. + * @return Returns JSVM functions result code. + * {@link JSVM_OK } if the function executed successfully. \n + * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL. \n + * {@link JSVM_GENERIC_FAILURE} if the input utf8name | constructor | properties is invalid. \n + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_DefineClassWithOptions(JSVM_Env env, + const char* utf8name, + size_t length, + JSVM_Callback constructor, + size_t propertyCount, + const JSVM_PropertyDescriptor* properties, + JSVM_Value parentClass, + size_t option_count, + JSVM_DefineClassOptions options[], + JSVM_Value* result); + +/** + * @brief Add VM GC Callback. + * + * @param vm The environment that the API is invoked under. + * @param triggerTime The timing of GC callback trigger. + * @param handler When Trigger gc, the callback function will be called. + * @param gcType The type of gc. + * @param userData The native pointer data. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if the vm or the handler is NULL or the handler has been added before.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_AddHandlerForGC(JSVM_VM vm, + JSVM_CBTriggerTimeForGC triggerTime, + JSVM_HandlerForGC handler, + JSVM_GCType gcType, + void* userData); + +/** + * @brief Remove VM GC Callback. + * + * @param vm The environment that the API is invoked under. + * @param triggerTime The timing of GC callback trigger. + * @param handler When Trigger gc, the callback function will be called. + * @param userData The native pointer data. + * @return Returns JSVM funtions result code. + * {@link JSVM_OK } if the function executed successfully.\n + * {@link JSVM_INVALID_ARG } if the vm or the handler is NULL, or the handler has been removed, + * or the handler has never been added.\n + * + * @since 16 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_RemoveHandlerForGC(JSVM_VM vm, + JSVM_CBTriggerTimeForGC triggerTime, + JSVM_HandlerForGC handler, + void* userData); EXTERN_C_END /** @} */ #endif /* ARK_RUNTIME_JSVM_JSVM_H */ diff --git a/ark_runtime/jsvm/jsvm_types.h b/ark_runtime/jsvm/jsvm_types.h index 9c834bc11..069bc95b5 100644 --- a/ark_runtime/jsvm/jsvm_types.h +++ b/ark_runtime/jsvm/jsvm_types.h @@ -327,6 +327,10 @@ typedef enum { JSVM_NO_EXTERNAL_BUFFERS_ALLOWED, /** cannot run +js status. */ JSVM_CANNOT_RUN_JS, + /** invalid input type status. + * @since 16 + */ + JSVM_INVALID_TYPE, } JSVM_Status; /** @@ -771,6 +775,236 @@ typedef enum { JSVM_CACHE_TYPE_WASM, } JSVM_CacheType; +/** + * @brief Microtask policies of JSVM. + * + * @since 16 + */ +typedef enum { + /** Microtasks are invoked with the OH_JSVM_PerformMicrotaskCheckpoint() method. */ + JSVM_MICROTASK_EXPLICIT = 0, + /** Microtasks are invoked when the script call depth decrements to zero. + * Default mode. + */ + JSVM_MICROTASK_AUTO, +} JSVM_MicrotaskPolicy; + +/** + * @brief Trace category for jsvm internal trace events. + * + * @since 16 + */ +typedef enum { + /** Tracing main interface invoking of JSVM, such as run scripts. */ + JSVM_TRACE_VM, + /** Tracing interface invoking about compilation, such as CompileCodeBackground. */ + JSVM_TRACE_COMPILE, + /** Tracing interface invoking about execution status, such as Interrupts and Microtasks. */ + JSVM_TRACE_EXECUTE, + /** Tracing external callback */ + JSVM_TRACE_RUNTIME, + /** Tracing stack trace in JSVM. */ + JSVM_TRACE_STACK_TRACE, + /** Tracing Main interface invoking of WASM, such as Compile Wasm Module and Instantiate. */ + JSVM_TRACE_WASM, + /** Tracing more detailed interface invoking of WASM, such as background compilation and wrappers. */ + JSVM_TRACE_WASM_DETAILED +} JSVM_TraceCategory; + +/** + * @brief The promise-reject event. + * + * @since 16 + */ +typedef enum { + /** Promise is rejected for other reasons. */ + JSVM_PROMISE_REJECT_OTHER_REASONS = 0, + /** Promise rejected with no handler. */ + JSVM_PROMISE_REJECT_WITH_NO_HANDLER = 1, + /** Add the handler after Promise has been rejected. */ + JSVM_PROMISE_ADD_HANDLER_AFTER_REJECTED = 2, + /** After the Promise has been resolved, try to reject the Promise again. */ + JSVM_PROMISE_REJECT_AFTER_RESOLVED = 3, + /** After the Promise has been resolved, try resolving the Promise again. */ + JSVM_PROMISE_RESOLVE_AFTER_RESOLVED = 4, +} JSVM_PromiseRejectEvent; + +/** + * @brief The level of message error. + * + * @since 16 + */ +typedef enum { + /** Log level message. */ + JSVM_MESSAGE_LOG = (1 << 0), + /** Debug level message. */ + JSVM_MESSAGE_DEBUG = (1 << 1), + /** Info level message. */ + JSVM_MESSAGE_INFO = (1 << 2), + /** Error level message. */ + JSVM_MESSAGE_ERROR = (1 << 3), + /** Warning level message. */ + JSVM_MESSAGE_WARNING = (1 << 4), + /** All level message. */ + JSVM_MESSAGE_ALL = JSVM_MESSAGE_LOG | JSVM_MESSAGE_DEBUG | JSVM_MESSAGE_INFO | JSVM_MESSAGE_ERROR | + JSVM_MESSAGE_WARNING, +} JSVM_MessageErrorLevel; + +/** + * @brief Function pointer type of OOM-Error callback. + * + * @param location The location information of the OOM error. + * @param detail The detail of the OOM error. + * @param isHeapOOM Determine whether the OOM type is Heap OOM. + * + * @since 16 + */ +typedef void(JSVM_CDECL* JSVM_HandlerForOOMError)(const char* location, + const char* detail, + bool isHeapOOM); + +/** + * @brief Function pointer type of Fatal-Error callback. + * + * @param location The location information of the Fatal error. + * @param message The message of the Fatal error. + * + * @since 16 + */ +typedef void(JSVM_CDECL* JSVM_HandlerForFatalError)(const char* location, + const char* message); + +/** + * @brief Function pointer type of Promise-Reject callback. + * + * @param env The environment that the function is invoked under. + * @param rejectEvent The promise-reject event. + * @param rejectInfo An JS-object containing two properties: 'promise' and 'value'. + * The 'promise' represents a reference to the Promise object that was rejected. + * The 'value' represents the rejection reason associated with that promise. + * + * @since 16 + */ +typedef void(JSVM_CDECL* JSVM_HandlerForPromiseReject)(JSVM_Env env, + JSVM_PromiseRejectEvent rejectEvent, + JSVM_Value rejectInfo); + +/** + * @brief DefineClass options id. + * + * @since 16 + */ +typedef enum { + /** Defining a class in normal mode. */ + JSVM_DEFINE_CLASS_NORMAL, + /** Defining a class with count. */ + JSVM_DEFINE_CLASS_WITH_COUNT, + /** Defining a class with property handler. */ + JSVM_DEFINE_CLASS_WITH_PROPERTY_HANDLER, +} JSVM_DefineClassOptionsId; + +/** + * @brief DefineClass options. + * + * @since 16 + */ +typedef struct { + /** DefineClass option id. */ + JSVM_DefineClassOptionsId id; + /** option content. */ + union { + /** for option value with pointer type. */ + void* ptr; + /** for option value with integer type */ + int num; + /** for option value with bool type */ + bool boolean; + } content; +} JSVM_DefineClassOptions; + +/** + * @brief The property-handler used to define class. + * + * @since 16 + */ +typedef struct { + /** The instance object triggers the corresponding callback function. */ + JSVM_PropertyHandlerCfg propertyHandlerCfg; + /** Calling an instance object as a function will trigger this callback. */ + JSVM_Callback callAsFunctionCallback; +} JSVM_PropertyHandler; + +/** + * @brief The timing of GC callback trigger. + * + * @since 16 + */ +typedef enum { + /** Trigger GC callback before GC. */ + JSVM_CB_TRIGGER_BEFORE_GC, + /** Trigger GC callback after GC. */ + JSVM_CB_TRIGGER_AFTER_GC, +} JSVM_CBTriggerTimeForGC; + +/** + * @brief The GC type. + * + * @since 16 + */ +typedef enum { + /** The GC algorithm is Scavenge. */ + JSVM_GC_TYPE_SCAVENGE = 1 << 0, + /** The GC algorithm is Minor-Mark-Compact. */ + JSVM_GC_TYPE_MINOR_MARK_COMPACT = 1 << 1, + /** The GC algorithm is Mark-Sweep-Compact. */ + JSVM_GC_TYPE_MARK_SWEEP_COMPACT = 1 << 2, + /** The GC algorithm is Incremental-Marking. */ + JSVM_GC_TYPE_INCREMENTAL_MARKING = 1 << 3, + /** The GC algorithm is Weak-Callbacks. */ + JSVM_GC_TYPE_PROCESS_WEAK_CALLBACKS = 1 << 4, + /** All GC algorithm. */ + JSVM_GC_TYPE_ALL = JSVM_GC_TYPE_SCAVENGE | JSVM_GC_TYPE_MINOR_MARK_COMPACT | + JSVM_GC_TYPE_MARK_SWEEP_COMPACT | JSVM_GC_TYPE_INCREMENTAL_MARKING | + JSVM_GC_TYPE_PROCESS_WEAK_CALLBACKS, +} JSVM_GCType; + +/** + * @brief The GC callback flags. + * + * @since 16 + */ +typedef enum { + /** No GC callback falgs. */ + JSVM_NO_GC_CALLBACK_FLAGS, + /** Reserved object information will be built in the garbage collection callback. */ + JSVM_GC_CALLBACK_CONSTRUCT_RETAINED_OBJECT_INFOS, + /** Enforce Garbage Collection Callback. */ + JSVM_GC_CALLBACK_FORCED, + /** Synchronous phantom callback processing. */ + JSVM_GC_CALLBACK_SYNCHRONOUS_PHANTOM_CALLBACK_PROCESSING, + /** All available garbage objects are collected during garbage collection. */ + JSVM_GC_CALLBACK_COLLECT_ALL_AVAILABLE_GARBAGE, + /** Garbage collection collects all external memory. */ + JSVM_GC_CALLBACK_COLLECT_ALL_EXTERNAL_MEMORY, + /** Schedule Garbage Collection at Idle Time. */ + JSVM_GC_CALLBACK_SCHEDULE_IDLE_GARBAGE_COLLECTION, +} JSVM_GCCallbackFlags; + +/** + * @brief Function pointer type of GC callback. + * + * @param vm The VM instance that the JSVM-API call is invoked under. + * @param gcType The gc type. + * @param flags The GC callback flags. + * @param data The native pointer data. + * + * @since 16 + */ +typedef void(JSVM_CDECL* JSVM_HandlerForGC)(JSVM_VM vm, + JSVM_GCType gcType, + JSVM_GCCallbackFlags flags, + void* data); + /** * @brief To represent a JavaScript Data type. * diff --git a/ark_runtime/jsvm/libjsvm.ndk.json b/ark_runtime/jsvm/libjsvm.ndk.json index ea0cb6092..abfded3f9 100644 --- a/ark_runtime/jsvm/libjsvm.ndk.json +++ b/ark_runtime/jsvm/libjsvm.ndk.json @@ -735,6 +735,122 @@ "first_introduced": "12", "name": "OH_JSVM_ReleaseCache" }, + { + "first_introduced": "16", + "name": "OH_JSVM_PromiseRegisterHandler" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_CreateProxy" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_IsProxy" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_ProxyGetTarget" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_IsBigIntObject" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_IsBooleanObject" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_IsStringObject" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_IsNumberObject" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_IsSymbolObject" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_GetSymbolAsyncIterator" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_GetSymbolHasInstance" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_GetSymbolIsConcatSpreadable" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_GetSymbolMatch" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_GetSymbolReplace" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_GetSymbolSearch" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_GetSymbolSplit" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_GetSymbolToPrimitive" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_GetSymbolUnscopables" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_GetSymbolToStringTag" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_GetSymbolIterator" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_SetMicrotaskPolicy" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_TraceStart" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_TraceStop" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_SetHandlerForOOMError" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_SetHandlerForFatalError" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_SetHandlerForPromiseReject" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_DefineClassWithOptions" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_AddHandlerForGC" + }, + { + "first_introduced": "16", + "name": "OH_JSVM_RemoveHandlerForGC" + }, { "first_introduced": "16", "name": "OH_JSVM_CreateExternalStringLatin1" -- Gitee From 5bfe56fc390b3e517d45b6df16585242439c4e97 Mon Sep 17 00:00:00 2001 From: sunyaozu Date: Wed, 18 Dec 2024 18:31:11 +0800 Subject: [PATCH 552/620] provide icu ndk function Signed-off-by: sunyaozu --- third_party/icu4c/BUILD.gn | 4 + third_party/icu4c/libicu.ndk.json | 272 ++++ .../icu4c/ndk_headers/unicode/ustring.h | 1353 +++++++++++++++++ third_party/icu4c/ndk_headers/unicode/utext.h | 582 +++++++ .../icu4c/ndk_headers/unicode/utypes.h | 8 + 5 files changed, 2219 insertions(+) create mode 100644 third_party/icu4c/ndk_headers/unicode/ustring.h create mode 100644 third_party/icu4c/ndk_headers/unicode/utext.h diff --git a/third_party/icu4c/BUILD.gn b/third_party/icu4c/BUILD.gn index d3466f1eb..c5dd29f72 100644 --- a/third_party/icu4c/BUILD.gn +++ b/third_party/icu4c/BUILD.gn @@ -45,6 +45,8 @@ ohos_ndk_library("libicu_ndk") { "unicode/unumberformatter.h", "unicode/uscript.h", "unicode/uset.h", + "unicode/ustring.h", + "unicode/utext.h", "unicode/utrans.h", "unicode/utypes.h", ] @@ -79,6 +81,8 @@ ohos_ndk_headers("icu_unicode_header") { "ndk_headers/unicode/unumberformatter.h", "ndk_headers/unicode/uscript.h", "ndk_headers/unicode/uset.h", + "ndk_headers/unicode/ustring.h", + "ndk_headers/unicode/utext.h", "ndk_headers/unicode/utrans.h", "ndk_headers/unicode/utypes.h", ] diff --git a/third_party/icu4c/libicu.ndk.json b/third_party/icu4c/libicu.ndk.json index 5fc158cad..40397f053 100644 --- a/third_party/icu4c/libicu.ndk.json +++ b/third_party/icu4c/libicu.ndk.json @@ -1814,5 +1814,277 @@ { "first_introduced": "12", "name":"uidna_nameToUnicodeUTF8" + }, + { + "first_introduced": "15", + "name":"utext_close" + }, + { + "first_introduced": "15", + "name":"utext_openUTF8" + }, + { + "first_introduced": "15", + "name":"utext_openUChars" + }, + { + "first_introduced": "15", + "name":"utext_clone" + }, + { + "first_introduced": "15", + "name":"utext_equals" + }, + { + "first_introduced": "15", + "name":"utext_nativeLength" + }, + { + "first_introduced": "15", + "name":"utext_char32At" + }, + { + "first_introduced": "15", + "name":"utext_current32" + }, + { + "first_introduced": "15", + "name":"utext_next32" + }, + { + "first_introduced": "15", + "name":"utext_previous32" + }, + { + "first_introduced": "15", + "name":"utext_next32From" + }, + { + "first_introduced": "15", + "name":"utext_previous32From" + }, + { + "first_introduced": "15", + "name":"utext_getNativeIndex" + }, + { + "first_introduced": "15", + "name":"utext_setNativeIndex" + }, + { + "first_introduced": "15", + "name":"utext_moveIndex32" + }, + { + "first_introduced": "15", + "name":"utext_getPreviousNativeIndex" + }, + { + "first_introduced": "15", + "name":"utext_extract" + }, + { + "first_introduced": "15", + "name":"u_strlen" + }, + { + "first_introduced": "15", + "name":"u_countChar32" + }, + { + "first_introduced": "15", + "name":"u_strHasMoreChar32Than" + }, + { + "first_introduced": "15", + "name":"u_strcat" + }, + { + "first_introduced": "15", + "name":"u_strncat" + }, + { + "first_introduced": "15", + "name":"u_strstr" + }, + { + "first_introduced": "15", + "name":"u_strFindFirst" + }, + { + "first_introduced": "15", + "name":"u_strchr" + }, + { + "first_introduced": "15", + "name":"u_strchr32" + }, + { + "first_introduced": "15", + "name":"u_strrstr" + }, + { + "first_introduced": "15", + "name":"u_strFindLast" + }, + { + "first_introduced": "15", + "name":"u_strrchr" + }, + { + "first_introduced": "15", + "name":"u_strrchr32" + }, + { + "first_introduced": "15", + "name":"u_strpbrk" + }, + { + "first_introduced": "15", + "name":"u_strcspn" + }, + { + "first_introduced": "15", + "name":"u_strspn" + }, + { + "first_introduced": "15", + "name":"u_strtok_r" + }, + { + "first_introduced": "15", + "name":"u_strcmp" + }, + { + "first_introduced": "15", + "name":"u_strcmpCodePointOrder" + }, + { + "first_introduced": "15", + "name":"u_strCompare" + }, + { + "first_introduced": "15", + "name":"u_strCaseCompare" + }, + { + "first_introduced": "15", + "name":"u_strncmp" + }, + { + "first_introduced": "15", + "name":"u_strncmpCodePointOrder" + }, + { + "first_introduced": "15", + "name":"u_strcasecmp" + }, + { + "first_introduced": "15", + "name":"u_strncasecmp" + }, + { + "first_introduced": "15", + "name":"u_memcasecmp" + }, + { + "first_introduced": "15", + "name":"u_strcpy" + }, + { + "first_introduced": "15", + "name":"u_strncpy" + }, + { + "first_introduced": "15", + "name":"u_memcpy" + }, + { + "first_introduced": "15", + "name":"u_memmove" + }, + { + "first_introduced": "15", + "name":"u_memset" + }, + { + "first_introduced": "15", + "name":"u_memcmp" + }, + { + "first_introduced": "15", + "name":"u_memcmpCodePointOrder" + }, + { + "first_introduced": "15", + "name":"u_memchr" + }, + { + "first_introduced": "15", + "name":"u_memchr32" + }, + { + "first_introduced": "15", + "name":"u_memrchr" + }, + { + "first_introduced": "15", + "name":"u_memrchr32" + }, + { + "first_introduced": "15", + "name":"u_strToUpper" + }, + { + "first_introduced": "15", + "name":"u_strToLower" + }, + { + "first_introduced": "15", + "name":"u_strToTitle" + }, + { + "first_introduced": "15", + "name":"u_strFoldCase" + }, + { + "first_introduced": "15", + "name":"u_strToUTF8" + }, + { + "first_introduced": "15", + "name":"u_strFromUTF8" + }, + { + "first_introduced": "15", + "name":"u_strToUTF8WithSub" + }, + { + "first_introduced": "15", + "name":"u_strFromUTF8WithSub" + }, + { + "first_introduced": "15", + "name":"u_strFromUTF8Lenient" + }, + { + "first_introduced": "15", + "name":"u_strToUTF32" + }, + { + "first_introduced": "15", + "name":"u_strFromUTF32" + }, + { + "first_introduced": "15", + "name":"u_strToUTF32WithSub" + }, + { + "first_introduced": "15", + "name":"u_strFromUTF32WithSub" + }, + { + "first_introduced": "15", + "name":"u_errorName" } ] diff --git a/third_party/icu4c/ndk_headers/unicode/ustring.h b/third_party/icu4c/ndk_headers/unicode/ustring.h new file mode 100644 index 000000000..bbb1ee309 --- /dev/null +++ b/third_party/icu4c/ndk_headers/unicode/ustring.h @@ -0,0 +1,1353 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +********************************************************************** +* Copyright (C) 1998-2014, International Business Machines +* Corporation and others. All Rights Reserved. +********************************************************************** +* +* File ustring.h +* +* Modification History: +* +* Date Name Description +* 12/07/98 bertrand Creation. +****************************************************************************** +*/ + +#ifndef USTRING_H +#define USTRING_H + +#include "unicode/utypes.h" + +/** + * \def UBRK_TYPEDEF_UBREAK_ITERATOR + * @internal + */ + +#ifndef UBRK_TYPEDEF_UBREAK_ITERATOR +# define UBRK_TYPEDEF_UBREAK_ITERATOR +/** Simple declaration for u_strToTitle() to avoid including unicode/ubrk.h. @stable ICU 2.1*/ + typedef struct UBreakIterator UBreakIterator; +#endif + +/** + * \file + * \brief C API: Unicode string handling functions + * + * These C API functions provide general Unicode string handling. + * + * Some functions are equivalent in name, signature, and behavior to the ANSI C + * functions. (For example, they do not check for bad arguments like NULL string pointers.) + * In some cases, only the thread-safe variant of such a function is implemented here + * (see u_strtok_r()). + * + * Other functions provide more Unicode-specific functionality like locale-specific + * upper/lower-casing and string comparison in code point order. + * + * ICU uses 16-bit Unicode (UTF-16) in the form of arrays of UChar code units. + * UTF-16 encodes each Unicode code point with either one or two UChar code units. + * (This is the default form of Unicode, and a forward-compatible extension of the original, + * fixed-width form that was known as UCS-2. UTF-16 superseded UCS-2 with Unicode 2.0 + * in 1996.) + * + * Some APIs accept a 32-bit UChar32 value for a single code point. + * + * ICU also handles 16-bit Unicode text with unpaired surrogates. + * Such text is not well-formed UTF-16. + * Code-point-related functions treat unpaired surrogates as surrogate code points, + * i.e., as separate units. + * + * Although UTF-16 is a variable-width encoding form (like some legacy multi-byte encodings), + * it is much more efficient even for random access because the code unit values + * for single-unit characters vs. lead units vs. trail units are completely disjoint. + * This means that it is easy to determine character (code point) boundaries from + * random offsets in the string. + * + * Unicode (UTF-16) string processing is optimized for the single-unit case. + * Although it is important to support supplementary characters + * (which use pairs of lead/trail code units called "surrogates"), + * their occurrence is rare. Almost all characters in modern use require only + * a single UChar code unit (i.e., their code point values are <=0xffff). + * + * For more details see the User Guide Strings chapter (https://unicode-org.github.io/icu/userguide/strings/). + * For a discussion of the handling of unpaired surrogates see also + * Jitterbug 2145 and its icu mailing list proposal on 2002-sep-18. + */ + +/** + * \defgroup ustring_ustrlen String Length + * \ingroup ustring_strlen + */ +/*@{*/ +/** + * Determine the length of an array of UChar. + * + * @param s The array of UChars, NULL (U+0000) terminated. + * @return The number of UChars in chars, minus the terminator. + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_strlen(const UChar *s); +/*@}*/ + +/** + * Count Unicode code points in the length UChar code units of the string. + * A code point may occupy either one or two UChar code units. + * Counting code points involves reading all code units. + * + * This functions is basically the inverse of the U16_FWD_N() macro (see utf.h). + * + * @param s The input string. + * @param length The number of UChar code units to be checked, or -1 to count all + * code points before the first NUL (U+0000). + * @return The number of code points in the specified code units. + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_countChar32(const UChar *s, int32_t length); + +/** + * Check if the string contains more Unicode code points than a certain number. + * This is more efficient than counting all code points in the entire string + * and comparing that number with a threshold. + * This function may not need to scan the string at all if the length is known + * (not -1 for NUL-termination) and falls within a certain range, and + * never needs to count more than 'number+1' code points. + * Logically equivalent to (u_countChar32(s, length)>number). + * A Unicode code point may occupy either one or two UChar code units. + * + * @param s The input string. + * @param length The length of the string, or -1 if it is NUL-terminated. + * @param number The number of code points in the string is compared against + * the 'number' parameter. + * @return Boolean value for whether the string contains more Unicode code points + * than 'number'. Same as (u_countChar32(s, length)>number). + * @stable ICU 2.4 + */ +U_CAPI UBool U_EXPORT2 +u_strHasMoreChar32Than(const UChar *s, int32_t length, int32_t number); + +/** + * Concatenate two ustrings. Appends a copy of src, + * including the null terminator, to dst. The initial copied + * character from src overwrites the null terminator in dst. + * + * @param dst The destination string. + * @param src The source string. + * @return A pointer to dst. + * @stable ICU 2.0 + */ +U_CAPI UChar* U_EXPORT2 +u_strcat(UChar *dst, + const UChar *src); + +/** + * Concatenate two ustrings. + * Appends at most n characters from src to dst. + * Adds a terminating NUL. + * If src is too long, then only n-1 characters will be copied + * before the terminating NUL. + * If n<=0 then dst is not modified. + * + * @param dst The destination string. + * @param src The source string (can be NULL/invalid if n<=0). + * @param n The maximum number of characters to append; no-op if <=0. + * @return A pointer to dst. + * @stable ICU 2.0 + */ +U_CAPI UChar* U_EXPORT2 +u_strncat(UChar *dst, + const UChar *src, + int32_t n); + +/** + * Find the first occurrence of a substring in a string. + * The substring is found at code point boundaries. + * That means that if the substring begins with + * a trail surrogate or ends with a lead surrogate, + * then it is found only if these surrogates stand alone in the text. + * Otherwise, the substring edge units would be matched against + * halves of surrogate pairs. + * + * @param s The string to search (NUL-terminated). + * @param substring The substring to find (NUL-terminated). + * @return A pointer to the first occurrence of substring in s, + * or s itself if the substring is empty, + * or NULL if substring is not in s. + * @stable ICU 2.0 + * + * @see u_strrstr + * @see u_strFindFirst + * @see u_strFindLast + */ +U_CAPI UChar * U_EXPORT2 +u_strstr(const UChar *s, const UChar *substring); + +/** + * Find the first occurrence of a substring in a string. + * The substring is found at code point boundaries. + * That means that if the substring begins with + * a trail surrogate or ends with a lead surrogate, + * then it is found only if these surrogates stand alone in the text. + * Otherwise, the substring edge units would be matched against + * halves of surrogate pairs. + * + * @param s The string to search. + * @param length The length of s (number of UChars), or -1 if it is NUL-terminated. + * @param substring The substring to find (NUL-terminated). + * @param subLength The length of substring (number of UChars), or -1 if it is NUL-terminated. + * @return A pointer to the first occurrence of substring in s, + * or s itself if the substring is empty, + * or NULL if substring is not in s. + * @stable ICU 2.4 + * + * @see u_strstr + * @see u_strFindLast + */ +U_CAPI UChar * U_EXPORT2 +u_strFindFirst(const UChar *s, int32_t length, const UChar *substring, int32_t subLength); + +/** + * Find the first occurrence of a BMP code point in a string. + * A surrogate code point is found only if its match in the text is not + * part of a surrogate pair. + * A NUL character is found at the string terminator. + * + * @param s The string to search (NUL-terminated). + * @param c The BMP code point to find. + * @return A pointer to the first occurrence of c in s + * or NULL if c is not in s. + * @stable ICU 2.0 + * + * @see u_strchr32 + * @see u_memchr + * @see u_strstr + * @see u_strFindFirst + */ +U_CAPI UChar * U_EXPORT2 +u_strchr(const UChar *s, UChar c); + +/** + * Find the first occurrence of a code point in a string. + * A surrogate code point is found only if its match in the text is not + * part of a surrogate pair. + * A NUL character is found at the string terminator. + * + * @param s The string to search (NUL-terminated). + * @param c The code point to find. + * @return A pointer to the first occurrence of c in s + * or NULL if c is not in s. + * @stable ICU 2.0 + * + * @see u_strchr + * @see u_memchr32 + * @see u_strstr + * @see u_strFindFirst + */ +U_CAPI UChar * U_EXPORT2 +u_strchr32(const UChar *s, UChar32 c); + +/** + * Find the last occurrence of a substring in a string. + * The substring is found at code point boundaries. + * That means that if the substring begins with + * a trail surrogate or ends with a lead surrogate, + * then it is found only if these surrogates stand alone in the text. + * Otherwise, the substring edge units would be matched against + * halves of surrogate pairs. + * + * @param s The string to search (NUL-terminated). + * @param substring The substring to find (NUL-terminated). + * @return A pointer to the last occurrence of substring in s, + * or s itself if the substring is empty, + * or NULL if substring is not in s. + * @stable ICU 2.4 + * + * @see u_strstr + * @see u_strFindFirst + * @see u_strFindLast + */ +U_CAPI UChar * U_EXPORT2 +u_strrstr(const UChar *s, const UChar *substring); + +/** + * Find the last occurrence of a substring in a string. + * The substring is found at code point boundaries. + * That means that if the substring begins with + * a trail surrogate or ends with a lead surrogate, + * then it is found only if these surrogates stand alone in the text. + * Otherwise, the substring edge units would be matched against + * halves of surrogate pairs. + * + * @param s The string to search. + * @param length The length of s (number of UChars), or -1 if it is NUL-terminated. + * @param substring The substring to find (NUL-terminated). + * @param subLength The length of substring (number of UChars), or -1 if it is NUL-terminated. + * @return A pointer to the last occurrence of substring in s, + * or s itself if the substring is empty, + * or NULL if substring is not in s. + * @stable ICU 2.4 + * + * @see u_strstr + * @see u_strFindLast + */ +U_CAPI UChar * U_EXPORT2 +u_strFindLast(const UChar *s, int32_t length, const UChar *substring, int32_t subLength); + +/** + * Find the last occurrence of a BMP code point in a string. + * A surrogate code point is found only if its match in the text is not + * part of a surrogate pair. + * A NUL character is found at the string terminator. + * + * @param s The string to search (NUL-terminated). + * @param c The BMP code point to find. + * @return A pointer to the last occurrence of c in s + * or NULL if c is not in s. + * @stable ICU 2.4 + * + * @see u_strrchr32 + * @see u_memrchr + * @see u_strrstr + * @see u_strFindLast + */ +U_CAPI UChar * U_EXPORT2 +u_strrchr(const UChar *s, UChar c); + +/** + * Find the last occurrence of a code point in a string. + * A surrogate code point is found only if its match in the text is not + * part of a surrogate pair. + * A NUL character is found at the string terminator. + * + * @param s The string to search (NUL-terminated). + * @param c The code point to find. + * @return A pointer to the last occurrence of c in s + * or NULL if c is not in s. + * @stable ICU 2.4 + * + * @see u_strrchr + * @see u_memchr32 + * @see u_strrstr + * @see u_strFindLast + */ +U_CAPI UChar * U_EXPORT2 +u_strrchr32(const UChar *s, UChar32 c); + +/** + * Locates the first occurrence in the string string of any of the characters + * in the string matchSet. + * Works just like C's strpbrk but with Unicode. + * + * @param string The string in which to search, NUL-terminated. + * @param matchSet A NUL-terminated string defining a set of code points + * for which to search in the text string. + * @return A pointer to the character in string that matches one of the + * characters in matchSet, or NULL if no such character is found. + * @stable ICU 2.0 + */ +U_CAPI UChar * U_EXPORT2 +u_strpbrk(const UChar *string, const UChar *matchSet); + +/** + * Returns the number of consecutive characters in string, + * beginning with the first, that do not occur somewhere in matchSet. + * Works just like C's strcspn but with Unicode. + * + * @param string The string in which to search, NUL-terminated. + * @param matchSet A NUL-terminated string defining a set of code points + * for which to search in the text string. + * @return The number of initial characters in string that do not + * occur in matchSet. + * @see u_strspn + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_strcspn(const UChar *string, const UChar *matchSet); + +/** + * Returns the number of consecutive characters in string, + * beginning with the first, that occur somewhere in matchSet. + * Works just like C's strspn but with Unicode. + * + * @param string The string in which to search, NUL-terminated. + * @param matchSet A NUL-terminated string defining a set of code points + * for which to search in the text string. + * @return The number of initial characters in string that do + * occur in matchSet. + * @see u_strcspn + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_strspn(const UChar *string, const UChar *matchSet); + +/** + * The string tokenizer API allows an application to break a string into + * tokens. Unlike strtok(), the saveState (the current pointer within the + * original string) is maintained in saveState. In the first call, the + * argument src is a pointer to the string. In subsequent calls to + * return successive tokens of that string, src must be specified as + * NULL. The value saveState is set by this function to maintain the + * function's position within the string, and on each subsequent call + * you must give this argument the same variable. This function does + * handle surrogate pairs. This function is similar to the strtok_r() + * the POSIX Threads Extension (1003.1c-1995) version. + * + * @param src String containing token(s). This string will be modified. + * After the first call to u_strtok_r(), this argument must + * be NULL to get to the next token. + * @param delim Set of delimiter characters (Unicode code points). + * @param saveState The current pointer within the original string, + * which is set by this function. The saveState + * parameter should the address of a local variable of type + * UChar *. (i.e. defined "UChar *myLocalSaveState" and use + * &myLocalSaveState for this parameter). + * @return A pointer to the next token found in src, or NULL + * when there are no more tokens. + * @stable ICU 2.0 + */ +U_CAPI UChar * U_EXPORT2 +u_strtok_r(UChar *src, + const UChar *delim, + UChar **saveState); + +/** + * Compare two Unicode strings for bitwise equality (code unit order). + * + * @param s1 A string to compare. + * @param s2 A string to compare. + * @return 0 if s1 and s2 are bitwise equal; a negative + * value if s1 is bitwise less than s2,; a positive + * value if s1 is bitwise greater than s2. + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_strcmp(const UChar *s1, + const UChar *s2); + +/** + * Compare two Unicode strings in code point order. + * See u_strCompare for details. + * + * @param s1 A string to compare. + * @param s2 A string to compare. + * @return a negative/zero/positive integer corresponding to whether + * the first string is less than/equal to/greater than the second one + * in code point order + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_strcmpCodePointOrder(const UChar *s1, const UChar *s2); + +/** + * Compare two Unicode strings (binary order). + * + * The comparison can be done in code unit order or in code point order. + * They differ only in UTF-16 when + * comparing supplementary code points (U+10000..U+10ffff) + * to BMP code points near the end of the BMP (i.e., U+e000..U+ffff). + * In code unit order, high BMP code points sort after supplementary code points + * because they are stored as pairs of surrogates which are at U+d800..U+dfff. + * + * This functions works with strings of different explicitly specified lengths + * unlike the ANSI C-like u_strcmp() and u_memcmp() etc. + * NUL-terminated strings are possible with length arguments of -1. + * + * @param s1 First source string. + * @param length1 Length of first source string, or -1 if NUL-terminated. + * + * @param s2 Second source string. + * @param length2 Length of second source string, or -1 if NUL-terminated. + * + * @param codePointOrder Choose between code unit order (false) + * and code point order (true). + * + * @return <0 or 0 or >0 as usual for string comparisons + * + * @stable ICU 2.2 + */ +U_CAPI int32_t U_EXPORT2 +u_strCompare(const UChar *s1, int32_t length1, + const UChar *s2, int32_t length2, + UBool codePointOrder); + + +/** + * Compare two strings case-insensitively using full case folding. + * This is equivalent to + * u_strCompare(u_strFoldCase(s1, options), + * u_strFoldCase(s2, options), + * (options&U_COMPARE_CODE_POINT_ORDER)!=0). + * + * The comparison can be done in UTF-16 code unit order or in code point order. + * They differ only when comparing supplementary code points (U+10000..U+10ffff) + * to BMP code points near the end of the BMP (i.e., U+e000..U+ffff). + * In code unit order, high BMP code points sort after supplementary code points + * because they are stored as pairs of surrogates which are at U+d800..U+dfff. + * + * This functions works with strings of different explicitly specified lengths + * unlike the ANSI C-like u_strcmp() and u_memcmp() etc. + * NUL-terminated strings are possible with length arguments of -1. + * + * @param s1 First source string. + * @param length1 Length of first source string, or -1 if NUL-terminated. + * + * @param s2 Second source string. + * @param length2 Length of second source string, or -1 if NUL-terminated. + * + * @param options A bit set of options: + * - U_FOLD_CASE_DEFAULT or 0 is used for default options: + * Comparison in code unit order with default case folding. + * + * - U_COMPARE_CODE_POINT_ORDER + * Set to choose code point order instead of code unit order + * (see u_strCompare for details). + * + * - U_FOLD_CASE_EXCLUDE_SPECIAL_I + * + * @param pErrorCode Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. + * + * @return <0 or 0 or >0 as usual for string comparisons + * + * @stable ICU 2.2 + */ +U_CAPI int32_t U_EXPORT2 +u_strCaseCompare(const UChar *s1, int32_t length1, + const UChar *s2, int32_t length2, + uint32_t options, + UErrorCode *pErrorCode); + +/** + * Compare two ustrings for bitwise equality. + * Compares at most n characters. + * + * @param ucs1 A string to compare (can be NULL/invalid if n<=0). + * @param ucs2 A string to compare (can be NULL/invalid if n<=0). + * @param n The maximum number of characters to compare; always returns 0 if n<=0. + * @return 0 if s1 and s2 are bitwise equal; a negative + * value if s1 is bitwise less than s2; a positive + * value if s1 is bitwise greater than s2. + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_strncmp(const UChar *ucs1, + const UChar *ucs2, + int32_t n); + +/** + * Compare two Unicode strings in code point order. + * This is different in UTF-16 from u_strncmp() if supplementary characters are present. + * For details, see u_strCompare(). + * + * @param s1 A string to compare. + * @param s2 A string to compare. + * @param n The maximum number of characters to compare. + * @return a negative/zero/positive integer corresponding to whether + * the first string is less than/equal to/greater than the second one + * in code point order + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_strncmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t n); + +/** + * Compare two strings case-insensitively using full case folding. + * This is equivalent to u_strcmp(u_strFoldCase(s1, options), u_strFoldCase(s2, options)). + * + * @param s1 A string to compare. + * @param s2 A string to compare. + * @param options A bit set of options: + * - U_FOLD_CASE_DEFAULT or 0 is used for default options: + * Comparison in code unit order with default case folding. + * + * - U_COMPARE_CODE_POINT_ORDER + * Set to choose code point order instead of code unit order + * (see u_strCompare for details). + * + * - U_FOLD_CASE_EXCLUDE_SPECIAL_I + * + * @return A negative, zero, or positive integer indicating the comparison result. + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_strcasecmp(const UChar *s1, const UChar *s2, uint32_t options); + +/** + * Compare two strings case-insensitively using full case folding. + * This is equivalent to u_strcmp(u_strFoldCase(s1, at most n, options), + * u_strFoldCase(s2, at most n, options)). + * + * @param s1 A string to compare. + * @param s2 A string to compare. + * @param n The maximum number of characters each string to case-fold and then compare. + * @param options A bit set of options: + * - U_FOLD_CASE_DEFAULT or 0 is used for default options: + * Comparison in code unit order with default case folding. + * + * - U_COMPARE_CODE_POINT_ORDER + * Set to choose code point order instead of code unit order + * (see u_strCompare for details). + * + * - U_FOLD_CASE_EXCLUDE_SPECIAL_I + * + * @return A negative, zero, or positive integer indicating the comparison result. + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_strncasecmp(const UChar *s1, const UChar *s2, int32_t n, uint32_t options); + +/** + * Compare two strings case-insensitively using full case folding. + * This is equivalent to u_strcmp(u_strFoldCase(s1, n, options), + * u_strFoldCase(s2, n, options)). + * + * @param s1 A string to compare. + * @param s2 A string to compare. + * @param length The number of characters in each string to case-fold and then compare. + * @param options A bit set of options: + * - U_FOLD_CASE_DEFAULT or 0 is used for default options: + * Comparison in code unit order with default case folding. + * + * - U_COMPARE_CODE_POINT_ORDER + * Set to choose code point order instead of code unit order + * (see u_strCompare for details). + * + * - U_FOLD_CASE_EXCLUDE_SPECIAL_I + * + * @return A negative, zero, or positive integer indicating the comparison result. + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_memcasecmp(const UChar *s1, const UChar *s2, int32_t length, uint32_t options); + +/** + * Copy a ustring. Adds a null terminator. + * + * @param dst The destination string. + * @param src The source string. + * @return A pointer to dst. + * @stable ICU 2.0 + */ +U_CAPI UChar* U_EXPORT2 +u_strcpy(UChar *dst, + const UChar *src); + +/** + * Copy a ustring. + * Copies at most n characters. The result will be null terminated + * if the length of src is less than n. + * + * @param dst The destination string. + * @param src The source string (can be NULL/invalid if n<=0). + * @param n The maximum number of characters to copy; no-op if <=0. + * @return A pointer to dst. + * @stable ICU 2.0 + */ +U_CAPI UChar* U_EXPORT2 +u_strncpy(UChar *dst, + const UChar *src, + int32_t n); + + +/** + * Synonym for memcpy(), but with UChars only. + * @param dest The destination string + * @param src The source string (can be NULL/invalid if count<=0) + * @param count The number of characters to copy; no-op if <=0 + * @return A pointer to dest + * @stable ICU 2.0 + */ +U_CAPI UChar* U_EXPORT2 +u_memcpy(UChar *dest, const UChar *src, int32_t count); + +/** + * Synonym for memmove(), but with UChars only. + * @param dest The destination string + * @param src The source string (can be NULL/invalid if count<=0) + * @param count The number of characters to move; no-op if <=0 + * @return A pointer to dest + * @stable ICU 2.0 + */ +U_CAPI UChar* U_EXPORT2 +u_memmove(UChar *dest, const UChar *src, int32_t count); + +/** + * Initialize count characters of dest to c. + * + * @param dest The destination string. + * @param c The character to initialize the string. + * @param count The maximum number of characters to set. + * @return A pointer to dest. + * @stable ICU 2.0 + */ +U_CAPI UChar* U_EXPORT2 +u_memset(UChar *dest, UChar c, int32_t count); + +/** + * Compare the first count UChars of each buffer. + * + * @param buf1 The first string to compare. + * @param buf2 The second string to compare. + * @param count The maximum number of UChars to compare. + * @return When buf1 < buf2, a negative number is returned. + * When buf1 == buf2, 0 is returned. + * When buf1 > buf2, a positive number is returned. + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_memcmp(const UChar *buf1, const UChar *buf2, int32_t count); + +/** + * Compare two Unicode strings in code point order. + * This is different in UTF-16 from u_memcmp() if supplementary characters are present. + * For details, see u_strCompare(). + * + * @param s1 A string to compare. + * @param s2 A string to compare. + * @param count The maximum number of characters to compare. + * @return a negative/zero/positive integer corresponding to whether + * the first string is less than/equal to/greater than the second one + * in code point order + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_memcmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t count); + +/** + * Find the first occurrence of a BMP code point in a string. + * A surrogate code point is found only if its match in the text is not + * part of a surrogate pair. + * A NUL character is found at the string terminator. + * + * @param s The string to search (contains count UChars). + * @param c The BMP code point to find. + * @param count The length of the string. + * @return A pointer to the first occurrence of c in s + * or NULL if c is not in s. + * @stable ICU 2.0 + * + * @see u_strchr + * @see u_memchr32 + * @see u_strFindFirst + */ +U_CAPI UChar* U_EXPORT2 +u_memchr(const UChar *s, UChar c, int32_t count); + +/** + * Find the first occurrence of a code point in a string. + * A surrogate code point is found only if its match in the text is not + * part of a surrogate pair. + * A NUL character is found at the string terminator. + * + * @param s The string to search (contains count UChars). + * @param c The code point to find. + * @param count The length of the string. + * @return A pointer to the first occurrence of c in s + * or NULL if c is not in s. + * @stable ICU 2.0 + * + * @see u_strchr32 + * @see u_memchr + * @see u_strFindFirst + */ +U_CAPI UChar* U_EXPORT2 +u_memchr32(const UChar *s, UChar32 c, int32_t count); + +/** + * Find the last occurrence of a BMP code point in a string. + * A surrogate code point is found only if its match in the text is not + * part of a surrogate pair. + * A NUL character is found at the string terminator. + * + * @param s The string to search (contains count UChars). + * @param c The BMP code point to find. + * @param count The length of the string. + * @return A pointer to the last occurrence of c in s + * or NULL if c is not in s. + * @stable ICU 2.4 + * + * @see u_strrchr + * @see u_memrchr32 + * @see u_strFindLast + */ +U_CAPI UChar* U_EXPORT2 +u_memrchr(const UChar *s, UChar c, int32_t count); + +/** + * Find the last occurrence of a code point in a string. + * A surrogate code point is found only if its match in the text is not + * part of a surrogate pair. + * A NUL character is found at the string terminator. + * + * @param s The string to search (contains count UChars). + * @param c The code point to find. + * @param count The length of the string. + * @return A pointer to the last occurrence of c in s + * or NULL if c is not in s. + * @stable ICU 2.4 + * + * @see u_strrchr32 + * @see u_memrchr + * @see u_strFindLast + */ +U_CAPI UChar* U_EXPORT2 +u_memrchr32(const UChar *s, UChar32 c, int32_t count); + +/** + * Unicode String literals in C. + * We need one macro to declare a variable for the string + * and to statically preinitialize it if possible, + * and a second macro to dynamically initialize such a string variable if necessary. + * + * The macros are defined for maximum performance. + * They work only for strings that contain "invariant characters", i.e., + * only latin letters, digits, and some punctuation. + * See utypes.h for details. + * + * A pair of macros for a single string must be used with the same + * parameters. + * The string parameter must be a C string literal. + * The length of the string, not including the terminating + * `NUL`, must be specified as a constant. + * The U_STRING_DECL macro should be invoked exactly once for one + * such string variable before it is used. + * + * Usage: + * + * U_STRING_DECL(ustringVar1, "Quick-Fox 2", 11); + * U_STRING_DECL(ustringVar2, "jumps 5%", 8); + * static UBool didInit=false; + * + * int32_t function() { + * if(!didInit) { + * U_STRING_INIT(ustringVar1, "Quick-Fox 2", 11); + * U_STRING_INIT(ustringVar2, "jumps 5%", 8); + * didInit=true; + * } + * return u_strcmp(ustringVar1, ustringVar2); + * } + * + * Note that the macros will NOT consistently work if their argument is another #`define`. + * The following will not work on all platforms, don't use it. + * + * #define GLUCK "Mr. Gluck" + * U_STRING_DECL(var, GLUCK, 9) + * U_STRING_INIT(var, GLUCK, 9) + * + * Instead, use the string literal "Mr. Gluck" as the argument to both macro + * calls. + * + * + * @stable ICU 2.0 + */ +#if defined(U_DECLARE_UTF16) +# define U_STRING_DECL(var, cs, length) static const UChar *var=(const UChar *)U_DECLARE_UTF16(cs) + /**@stable ICU 2.0 */ +# define U_STRING_INIT(var, cs, length) +#elif U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && (U_CHARSET_FAMILY==U_ASCII_FAMILY || (U_SIZEOF_UCHAR == 2 && defined(U_WCHAR_IS_UTF16))) +# define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]=L ## cs + /**@stable ICU 2.0 */ +# define U_STRING_INIT(var, cs, length) +#elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY +# define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]=cs + /**@stable ICU 2.0 */ +# define U_STRING_INIT(var, cs, length) +#else +# define U_STRING_DECL(var, cs, length) static UChar var[(length)+1] + /**@stable ICU 2.0 */ +# define U_STRING_INIT(var, cs, length) u_charsToUChars(cs, var, length+1) +#endif + + +/** + * Uppercase the characters in a string. + * Casing is locale-dependent and context-sensitive. + * The result may be longer or shorter than the original. + * The source string and the destination buffer are allowed to overlap. + * + * @param dest A buffer for the result string. The result will be zero-terminated if + * the buffer is large enough. + * @param destCapacity The size of the buffer (number of UChars). If it is 0, then + * dest may be NULL and the function will only return the length of the result + * without writing any of the result string. + * @param src The original string + * @param srcLength The length of the original string. If -1, then src must be zero-terminated. + * @param locale The locale to consider, or "" for the root locale or NULL for the default locale. + * @param pErrorCode Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. + * @return The length of the result string. It may be greater than destCapacity. In that case, + * only some of the result was written to the destination buffer. + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_strToUpper(UChar *dest, int32_t destCapacity, + const UChar *src, int32_t srcLength, + const char *locale, + UErrorCode *pErrorCode); + +/** + * Lowercase the characters in a string. + * Casing is locale-dependent and context-sensitive. + * The result may be longer or shorter than the original. + * The source string and the destination buffer are allowed to overlap. + * + * @param dest A buffer for the result string. The result will be zero-terminated if + * the buffer is large enough. + * @param destCapacity The size of the buffer (number of UChars). If it is 0, then + * dest may be NULL and the function will only return the length of the result + * without writing any of the result string. + * @param src The original string + * @param srcLength The length of the original string. If -1, then src must be zero-terminated. + * @param locale The locale to consider, or "" for the root locale or NULL for the default locale. + * @param pErrorCode Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. + * @return The length of the result string. It may be greater than destCapacity. In that case, + * only some of the result was written to the destination buffer. + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_strToLower(UChar *dest, int32_t destCapacity, + const UChar *src, int32_t srcLength, + const char *locale, + UErrorCode *pErrorCode); + +#if !UCONFIG_NO_BREAK_ITERATION + +/** + * Titlecase a string. + * Casing is locale-dependent and context-sensitive. + * Titlecasing uses a break iterator to find the first characters of words + * that are to be titlecased. It titlecases those characters and lowercases + * all others. + * + * The titlecase break iterator can be provided to customize for arbitrary + * styles, using rules and dictionaries beyond the standard iterators. + * It may be more efficient to always provide an iterator to avoid + * opening and closing one for each string. + * The standard titlecase iterator for the root locale implements the + * algorithm of Unicode TR 21. + * + * This function uses only the setText(), first() and next() methods of the + * provided break iterator. + * + * The result may be longer or shorter than the original. + * The source string and the destination buffer are allowed to overlap. + * + * @param dest A buffer for the result string. The result will be zero-terminated if + * the buffer is large enough. + * @param destCapacity The size of the buffer (number of UChars). If it is 0, then + * dest may be NULL and the function will only return the length of the result + * without writing any of the result string. + * @param src The original string + * @param srcLength The length of the original string. If -1, then src must be zero-terminated. + * @param titleIter A break iterator to find the first characters of words + * that are to be titlecased. + * If none is provided (NULL), then a standard titlecase + * break iterator is opened. + * @param locale The locale to consider, or "" for the root locale or NULL for the default locale. + * @param pErrorCode Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. + * @return The length of the result string. It may be greater than destCapacity. In that case, + * only some of the result was written to the destination buffer. + * @stable ICU 2.1 + */ +U_CAPI int32_t U_EXPORT2 +u_strToTitle(UChar *dest, int32_t destCapacity, + const UChar *src, int32_t srcLength, + UBreakIterator *titleIter, + const char *locale, + UErrorCode *pErrorCode); + +#endif + +/** + * Case-folds the characters in a string. + * + * Case-folding is locale-independent and not context-sensitive, + * but there is an option for whether to include or exclude mappings for dotted I + * and dotless i that are marked with 'T' in CaseFolding.txt. + * + * The result may be longer or shorter than the original. + * The source string and the destination buffer are allowed to overlap. + * + * @param dest A buffer for the result string. The result will be zero-terminated if + * the buffer is large enough. + * @param destCapacity The size of the buffer (number of UChars). If it is 0, then + * dest may be NULL and the function will only return the length of the result + * without writing any of the result string. + * @param src The original string + * @param srcLength The length of the original string. If -1, then src must be zero-terminated. + * @param options Either U_FOLD_CASE_DEFAULT or U_FOLD_CASE_EXCLUDE_SPECIAL_I + * @param pErrorCode Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. + * @return The length of the result string. It may be greater than destCapacity. In that case, + * only some of the result was written to the destination buffer. + * @stable ICU 2.0 + */ +U_CAPI int32_t U_EXPORT2 +u_strFoldCase(UChar *dest, int32_t destCapacity, + const UChar *src, int32_t srcLength, + uint32_t options, + UErrorCode *pErrorCode); + + +/** + * Convert a UTF-16 string to UTF-8. + * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND error code is set. + * + * @param dest A buffer for the result string. The result will be zero-terminated if + * the buffer is large enough. + * @param destCapacity The size of the buffer (number of chars). If it is 0, then + * dest may be NULL and the function will only return the length of the + * result without writing any of the result string (pre-flighting). + * @param pDestLength A pointer to receive the number of units written to the destination. If + * pDestLength!=NULL then *pDestLength is always set to the + * number of output units corresponding to the transformation of + * all the input units, even in case of a buffer overflow. + * @param src The original source string + * @param srcLength The length of the original string. If -1, then src must be zero-terminated. + * @param pErrorCode Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. + * @return The pointer to destination buffer. + * @stable ICU 2.0 + * @see u_strToUTF8WithSub + * @see u_strFromUTF8 + */ +U_CAPI char* U_EXPORT2 +u_strToUTF8(char *dest, + int32_t destCapacity, + int32_t *pDestLength, + const UChar *src, + int32_t srcLength, + UErrorCode *pErrorCode); + +/** + * Convert a UTF-8 string to UTF-16. + * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND error code is set. + * + * @param dest A buffer for the result string. The result will be zero-terminated if + * the buffer is large enough. + * @param destCapacity The size of the buffer (number of UChars). If it is 0, then + * dest may be NULL and the function will only return the length of the + * result without writing any of the result string (pre-flighting). + * @param pDestLength A pointer to receive the number of units written to the destination. If + * pDestLength!=NULL then *pDestLength is always set to the + * number of output units corresponding to the transformation of + * all the input units, even in case of a buffer overflow. + * @param src The original source string + * @param srcLength The length of the original string. If -1, then src must be zero-terminated. + * @param pErrorCode Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. + * @return The pointer to destination buffer. + * @stable ICU 2.0 + * @see u_strFromUTF8WithSub + * @see u_strFromUTF8Lenient + */ +U_CAPI UChar* U_EXPORT2 +u_strFromUTF8(UChar *dest, + int32_t destCapacity, + int32_t *pDestLength, + const char *src, + int32_t srcLength, + UErrorCode *pErrorCode); + +/** + * Convert a UTF-16 string to UTF-8. + * + * Same as u_strToUTF8() except for the additional subchar which is output for + * illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOUND error code. + * With subchar==U_SENTINEL, this function behaves exactly like u_strToUTF8(). + * + * @param dest A buffer for the result string. The result will be zero-terminated if + * the buffer is large enough. + * @param destCapacity The size of the buffer (number of chars). If it is 0, then + * dest may be NULL and the function will only return the length of the + * result without writing any of the result string (pre-flighting). + * @param pDestLength A pointer to receive the number of units written to the destination. If + * pDestLength!=NULL then *pDestLength is always set to the + * number of output units corresponding to the transformation of + * all the input units, even in case of a buffer overflow. + * @param src The original source string + * @param srcLength The length of the original string. If -1, then src must be zero-terminated. + * @param subchar The substitution character to use in place of an illegal input sequence, + * or U_SENTINEL if the function is to return with U_INVALID_CHAR_FOUND instead. + * A substitution character can be any valid Unicode code point (up to U+10FFFF) + * except for surrogate code points (U+D800..U+DFFF). + * The recommended value is U+FFFD "REPLACEMENT CHARACTER". + * @param pNumSubstitutions Output parameter receiving the number of substitutions if subchar>=0. + * Set to 0 if no substitutions occur or subchar<0. + * pNumSubstitutions can be NULL. + * @param pErrorCode Pointer to a standard ICU error code. Its input value must + * pass the U_SUCCESS() test, or else the function returns + * immediately. Check for U_FAILURE() on output or use with + * function chaining. (See User Guide for details.) + * @return The pointer to destination buffer. + * @see u_strToUTF8 + * @see u_strFromUTF8WithSub + * @stable ICU 3.6 + */ +U_CAPI char* U_EXPORT2 +u_strToUTF8WithSub(char *dest, + int32_t destCapacity, + int32_t *pDestLength, + const UChar *src, + int32_t srcLength, + UChar32 subchar, int32_t *pNumSubstitutions, + UErrorCode *pErrorCode); + +/** + * Convert a UTF-8 string to UTF-16. + * + * Same as u_strFromUTF8() except for the additional subchar which is output for + * illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOUND error code. + * With subchar==U_SENTINEL, this function behaves exactly like u_strFromUTF8(). + * + * @param dest A buffer for the result string. The result will be zero-terminated if + * the buffer is large enough. + * @param destCapacity The size of the buffer (number of UChars). If it is 0, then + * dest may be NULL and the function will only return the length of the + * result without writing any of the result string (pre-flighting). + * @param pDestLength A pointer to receive the number of units written to the destination. If + * pDestLength!=NULL then *pDestLength is always set to the + * number of output units corresponding to the transformation of + * all the input units, even in case of a buffer overflow. + * @param src The original source string + * @param srcLength The length of the original string. If -1, then src must be zero-terminated. + * @param subchar The substitution character to use in place of an illegal input sequence, + * or U_SENTINEL if the function is to return with U_INVALID_CHAR_FOUND instead. + * A substitution character can be any valid Unicode code point (up to U+10FFFF) + * except for surrogate code points (U+D800..U+DFFF). + * The recommended value is U+FFFD "REPLACEMENT CHARACTER". + * @param pNumSubstitutions Output parameter receiving the number of substitutions if subchar>=0. + * Set to 0 if no substitutions occur or subchar<0. + * pNumSubstitutions can be NULL. + * @param pErrorCode Pointer to a standard ICU error code. Its input value must + * pass the U_SUCCESS() test, or else the function returns + * immediately. Check for U_FAILURE() on output or use with + * function chaining. (See User Guide for details.) + * @return The pointer to destination buffer. + * @see u_strFromUTF8 + * @see u_strFromUTF8Lenient + * @see u_strToUTF8WithSub + * @stable ICU 3.6 + */ +U_CAPI UChar* U_EXPORT2 +u_strFromUTF8WithSub(UChar *dest, + int32_t destCapacity, + int32_t *pDestLength, + const char *src, + int32_t srcLength, + UChar32 subchar, int32_t *pNumSubstitutions, + UErrorCode *pErrorCode); + +/** + * Convert a UTF-8 string to UTF-16. + * + * Same as u_strFromUTF8() except that this function is designed to be very fast, + * which it achieves by being lenient about malformed UTF-8 sequences. + * This function is intended for use in environments where UTF-8 text is + * expected to be well-formed. + * + * Its semantics are: + * - Well-formed UTF-8 text is correctly converted to well-formed UTF-16 text. + * - The function will not read beyond the input string, nor write beyond + * the destCapacity. + * - Malformed UTF-8 results in "garbage" 16-bit Unicode strings which may not + * be well-formed UTF-16. + * The function will resynchronize to valid code point boundaries + * within a small number of code points after an illegal sequence. + * - Non-shortest forms are not detected and will result in "spoofing" output. + * + * For further performance improvement, if srcLength is given (>=0), + * then it must be destCapacity>=srcLength. + * + * There is no inverse u_strToUTF8Lenient() function because there is practically + * no performance gain from not checking that a UTF-16 string is well-formed. + * + * @param dest A buffer for the result string. The result will be zero-terminated if + * the buffer is large enough. + * @param destCapacity The size of the buffer (number of UChars). If it is 0, then + * dest may be NULL and the function will only return the length of the + * result without writing any of the result string (pre-flighting). + * Unlike for other ICU functions, if srcLength>=0 then it + * must be destCapacity>=srcLength. + * @param pDestLength A pointer to receive the number of units written to the destination. If + * pDestLength!=NULL then *pDestLength is always set to the + * number of output units corresponding to the transformation of + * all the input units, even in case of a buffer overflow. + * Unlike for other ICU functions, if srcLength>=0 but + * destCapacity=0. + * Set to 0 if no substitutions occur or subchar<0. + * pNumSubstitutions can be NULL. + * @param pErrorCode Pointer to a standard ICU error code. Its input value must + * pass the U_SUCCESS() test, or else the function returns + * immediately. Check for U_FAILURE() on output or use with + * function chaining. (See User Guide for details.) + * @return The pointer to destination buffer. + * @see u_strToUTF32 + * @see u_strFromUTF32WithSub + * @stable ICU 4.2 + */ +U_CAPI UChar32* U_EXPORT2 +u_strToUTF32WithSub(UChar32 *dest, + int32_t destCapacity, + int32_t *pDestLength, + const UChar *src, + int32_t srcLength, + UChar32 subchar, int32_t *pNumSubstitutions, + UErrorCode *pErrorCode); + +/** + * Convert a UTF-32 string to UTF-16. + * + * Same as u_strFromUTF32() except for the additional subchar which is output for + * illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOUND error code. + * With subchar==U_SENTINEL, this function behaves exactly like u_strFromUTF32(). + * + * @param dest A buffer for the result string. The result will be zero-terminated if + * the buffer is large enough. + * @param destCapacity The size of the buffer (number of UChars). If it is 0, then + * dest may be NULL and the function will only return the length of the + * result without writing any of the result string (pre-flighting). + * @param pDestLength A pointer to receive the number of units written to the destination. If + * pDestLength!=NULL then *pDestLength is always set to the + * number of output units corresponding to the transformation of + * all the input units, even in case of a buffer overflow. + * @param src The original source string + * @param srcLength The length of the original string. If -1, then src must be zero-terminated. + * @param subchar The substitution character to use in place of an illegal input sequence, + * or U_SENTINEL if the function is to return with U_INVALID_CHAR_FOUND instead. + * A substitution character can be any valid Unicode code point (up to U+10FFFF) + * except for surrogate code points (U+D800..U+DFFF). + * The recommended value is U+FFFD "REPLACEMENT CHARACTER". + * @param pNumSubstitutions Output parameter receiving the number of substitutions if subchar>=0. + * Set to 0 if no substitutions occur or subchar<0. + * pNumSubstitutions can be NULL. + * @param pErrorCode Pointer to a standard ICU error code. Its input value must + * pass the U_SUCCESS() test, or else the function returns + * immediately. Check for U_FAILURE() on output or use with + * function chaining. (See User Guide for details.) + * @return The pointer to destination buffer. + * @see u_strFromUTF32 + * @see u_strToUTF32WithSub + * @stable ICU 4.2 + */ +U_CAPI UChar* U_EXPORT2 +u_strFromUTF32WithSub(UChar *dest, + int32_t destCapacity, + int32_t *pDestLength, + const UChar32 *src, + int32_t srcLength, + UChar32 subchar, int32_t *pNumSubstitutions, + UErrorCode *pErrorCode); + + +#endif diff --git a/third_party/icu4c/ndk_headers/unicode/utext.h b/third_party/icu4c/ndk_headers/unicode/utext.h new file mode 100644 index 000000000..66e557ccf --- /dev/null +++ b/third_party/icu4c/ndk_headers/unicode/utext.h @@ -0,0 +1,582 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +******************************************************************************* +* +* Copyright (C) 2004-2012, International Business Machines +* Corporation and others. All Rights Reserved. +* +******************************************************************************* +* file name: utext.h +* encoding: UTF-8 +* tab size: 8 (not used) +* indentation:4 +* +* created on: 2004oct06 +* created by: Markus W. Scherer +*/ + +#ifndef __UTEXT_H__ +#define __UTEXT_H__ + +/** + * \file + * \brief C API: Abstract Unicode Text API + * + * The Text Access API provides a means to allow text that is stored in alternative + * formats to work with ICU services. ICU normally operates on text that is + * stored in UTF-16 format, in (UChar *) arrays for the C APIs or as type + * UnicodeString for C++ APIs. + * + * ICU Text Access allows other formats, such as UTF-8 or non-contiguous + * UTF-16 strings, to be placed in a UText wrapper and then passed to ICU services. + * + * There are three general classes of usage for UText: + * + * Application Level Use. This is the simplest usage - applications would + * use one of the utext_open() functions on their input text, and pass + * the resulting UText to the desired ICU service. + * + * Second is usage in ICU Services, such as break iteration, that will need to + * operate on input presented to them as a UText. These implementations + * will need to use the iteration and related UText functions to gain + * access to the actual text. + * + * The third class of UText users are "text providers." These are the + * UText implementations for the various text storage formats. An application + * or system with a unique text storage format can implement a set of + * UText provider functions for that format, which will then allow + * ICU services to operate on that format. + * + * + * Iterating over text + * + * Here is sample code for a forward iteration over the contents of a UText + * + * \code + * UChar32 c; + * UText *ut = whatever(); + * + * for (c=utext_next32From(ut, 0); c>=0; c=utext_next32(ut)) { + * // do whatever with the codepoint c here. + * } + * \endcode + * + * And here is similar code to iterate in the reverse direction, from the end + * of the text towards the beginning. + * + * \code + * UChar32 c; + * UText *ut = whatever(); + * int textLength = utext_nativeLength(ut); + * for (c=utext_previous32From(ut, textLength); c>=0; c=utext_previous32(ut)) { + * // do whatever with the codepoint c here. + * } + * \endcode + * + * Characters and Indexing + * + * Indexing into text by UText functions is nearly always in terms of the native + * indexing of the underlying text storage. The storage format could be UTF-8 + * or UTF-32, for example. When coding to the UText access API, no assumptions + * can be made regarding the size of characters, or how far an index + * may move when iterating between characters. + * + * All indices supplied to UText functions are pinned to the length of the + * text. An out-of-bounds index is not considered to be an error, but is + * adjusted to be in the range 0 <= index <= length of input text. + * + * + * When an index position is returned from a UText function, it will be + * a native index to the underlying text. In the case of multi-unit characters, + * it will always refer to the first position of the character, + * never to the interior. This is essentially the same thing as saying that + * a returned index will always point to a boundary between characters. + * + * When a native index is supplied to a UText function, all indices that + * refer to any part of a multi-unit character representation are considered + * to be equivalent. In the case of multi-unit characters, an incoming index + * will be logically normalized to refer to the start of the character. + * + * It is possible to test whether a native index is on a code point boundary + * by doing a utext_setNativeIndex() followed by a utext_getNativeIndex(). + * If the index is returned unchanged, it was on a code point boundary. If + * an adjusted index is returned, the original index referred to the + * interior of a character. + * + * Conventions for calling UText functions + * + * Most UText access functions have as their first parameter a (UText *) pointer, + * which specifies the UText to be used. Unless otherwise noted, the + * pointer must refer to a valid, open UText. Attempting to + * use a closed UText or passing a NULL pointer is a programming error and + * will produce undefined results or NULL pointer exceptions. + * + * The UText_Open family of functions can either open an existing (closed) + * UText, or heap allocate a new UText. Here is sample code for creating + * a stack-allocated UText. + * + * \code + * char *s = whatever(); // A utf-8 string + * U_ErrorCode status = U_ZERO_ERROR; + * UText ut = UTEXT_INITIALIZER; + * utext_openUTF8(ut, s, -1, &status); + * if (U_FAILURE(status)) { + * // error handling + * } else { + * // work with the UText + * } + * \endcode + * + * Any existing UText passed to an open function _must_ have been initialized, + * either by the UTEXT_INITIALIZER, or by having been originally heap-allocated + * by an open function. Passing NULL will cause the open function to + * heap-allocate and fully initialize a new UText. + * + */ + + + +#include "unicode/utypes.h" +#include "unicode/uchar.h" +#if U_SHOW_CPLUSPLUS_API +#include "unicode/localpointer.h" +#include "unicode/rep.h" +#include "unicode/unistr.h" +#include "unicode/chariter.h" +#endif + + +U_CDECL_BEGIN + +struct UText; +typedef struct UText UText; /**< C typedef for struct UText. @stable ICU 3.6 */ + + +/*************************************************************************************** + * + * C Functions for creating UText wrappers around various kinds of text strings. + * + ****************************************************************************************/ + + +/** + * Close function for UText instances. + * Cleans up, releases any resources being held by an open UText. + *

+ * If the UText was originally allocated by one of the utext_open functions, + * the storage associated with the utext will also be freed. + * If the UText storage originated with the application, as it would with + * a local or static instance, the storage will not be deleted. + * + * An open UText can be reset to refer to new string by using one of the utext_open() + * functions without first closing the UText. + * + * @param ut The UText to be closed. + * @return NULL if the UText struct was deleted by the close. If the UText struct + * was originally provided by the caller to the open function, it is + * returned by this function, and may be safely used again in + * a subsequent utext_open. + * + * @stable ICU 3.4 + */ +U_CAPI UText * U_EXPORT2 +utext_close(UText *ut); + +/** + * Open a read-only UText implementation for UTF-8 strings. + * + * \htmlonly + * Any invalid UTF-8 in the input will be handled in this way: + * a sequence of bytes that has the form of a truncated, but otherwise valid, + * UTF-8 sequence will be replaced by a single unicode replacement character, \uFFFD. + * Any other illegal bytes will each be replaced by a \uFFFD. + * \endhtmlonly + * + * @param ut Pointer to a UText struct. If NULL, a new UText will be created. + * If non-NULL, must refer to an initialized UText struct, which will then + * be reset to reference the specified UTF-8 string. + * @param s A UTF-8 string. Must not be NULL. + * @param length The length of the UTF-8 string in bytes, or -1 if the string is + * zero terminated. + * @param status Errors are returned here. + * @return A pointer to the UText. If a pre-allocated UText was provided, it + * will always be used and returned. + * @stable ICU 3.4 + */ +U_CAPI UText * U_EXPORT2 +utext_openUTF8(UText *ut, const char *s, int64_t length, UErrorCode *status); + + +/** + * Open a read-only UText for UChar * string. + * + * @param ut Pointer to a UText struct. If NULL, a new UText will be created. + * If non-NULL, must refer to an initialized UText struct, which will then + * be reset to reference the specified UChar string. + * @param s A UChar (UTF-16) string + * @param length The number of UChars in the input string, or -1 if the string is + * zero terminated. + * @param status Errors are returned here. + * @return A pointer to the UText. If a pre-allocated UText was provided, it + * will always be used and returned. + * @stable ICU 3.4 + */ +U_CAPI UText * U_EXPORT2 +utext_openUChars(UText *ut, const UChar *s, int64_t length, UErrorCode *status); + + +/** + * Clone a UText. This is much like opening a UText where the source text is itself + * another UText. + * + * A deep clone will copy both the UText data structures and the underlying text. + * The original and cloned UText will operate completely independently; modifications + * made to the text in one will not affect the other. Text providers are not + * required to support deep clones. The user of clone() must check the status return + * and be prepared to handle failures. + * + * The standard UText implementations for UTF8, UChar *, UnicodeString and + * Replaceable all support deep cloning. + * + * The UText returned from a deep clone will be writable, assuming that the text + * provider is able to support writing, even if the source UText had been made + * non-writable by means of UText_freeze(). + * + * A shallow clone replicates only the UText data structures; it does not make + * a copy of the underlying text. Shallow clones can be used as an efficient way to + * have multiple iterators active in a single text string that is not being + * modified. + * + * A shallow clone operation will not fail, barring truly exceptional conditions such + * as memory allocation failures. + * + * Shallow UText clones should be avoided if the UText functions that modify the + * text are expected to be used, either on the original or the cloned UText. + * Any such modifications can cause unpredictable behavior. Read Only + * shallow clones provide some protection against errors of this type by + * disabling text modification via the cloned UText. + * + * A shallow clone made with the readOnly parameter == false will preserve the + * utext_isWritable() state of the source object. Note, however, that + * write operations must be avoided while more than one UText exists that refer + * to the same underlying text. + * + * A UText and its clone may be safely concurrently accessed by separate threads. + * This is true for read access only with shallow clones, and for both read and + * write access with deep clones. + * It is the responsibility of the Text Provider to ensure that this thread safety + * constraint is met. + * + * @param dest A UText struct to be filled in with the result of the clone operation, + * or NULL if the clone function should heap-allocate a new UText struct. + * If non-NULL, must refer to an already existing UText, which will then + * be reset to become the clone. + * @param src The UText to be cloned. + * @param deep true to request a deep clone, false for a shallow clone. + * @param readOnly true to request that the cloned UText have read only access to the + * underlying text. + + * @param status Errors are returned here. For deep clones, U_UNSUPPORTED_ERROR + * will be returned if the text provider is unable to clone the + * original text. + * @return The newly created clone, or NULL if the clone operation failed. + * @stable ICU 3.4 + */ +U_CAPI UText * U_EXPORT2 +utext_clone(UText *dest, const UText *src, UBool deep, UBool readOnly, UErrorCode *status); + + +/** + * Compare two UText objects for equality. + * UTexts are equal if they are iterating over the same text, and + * have the same iteration position within the text. + * If either or both of the parameters are NULL, the comparison is false. + * + * @param a The first of the two UTexts to compare. + * @param b The other UText to be compared. + * @return true if the two UTexts are equal. + * @stable ICU 3.6 + */ +U_CAPI UBool U_EXPORT2 +utext_equals(const UText *a, const UText *b); + + +/***************************************************************************** + * + * Functions to work with the text represented by a UText wrapper + * + *****************************************************************************/ + +/** + * Get the length of the text. Depending on the characteristics + * of the underlying text representation, this may be expensive. + * @see utext_isLengthExpensive() + * + * + * @param ut the text to be accessed. + * @return the length of the text, expressed in native units. + * + * @stable ICU 3.4 + */ +U_CAPI int64_t U_EXPORT2 +utext_nativeLength(UText *ut); + +/** + * Returns the code point at the requested index, + * or U_SENTINEL (-1) if it is out of bounds. + * + * If the specified index points to the interior of a multi-unit + * character - one of the trail bytes of a UTF-8 sequence, for example - + * the complete code point will be returned. + * + * The iteration position will be set to the start of the returned code point. + * + * This function is roughly equivalent to the sequence + * utext_setNativeIndex(index); + * utext_current32(); + * (There is a subtle difference if the index is out of bounds by being less than zero - + * utext_setNativeIndex(negative value) sets the index to zero, after which utext_current() + * will return the char at zero. utext_char32At(negative index), on the other hand, will + * return the U_SENTINEL value of -1.) + * + * @param ut the text to be accessed + * @param nativeIndex the native index of the character to be accessed. If the index points + * to other than the first unit of a multi-unit character, it will be adjusted + * to the start of the character. + * @return the code point at the specified index. + * @stable ICU 3.4 + */ +U_CAPI UChar32 U_EXPORT2 +utext_char32At(UText *ut, int64_t nativeIndex); + + +/** + * + * Get the code point at the current iteration position, + * or U_SENTINEL (-1) if the iteration has reached the end of + * the input text. + * + * @param ut the text to be accessed. + * @return the Unicode code point at the current iterator position. + * @stable ICU 3.4 + */ +U_CAPI UChar32 U_EXPORT2 +utext_current32(UText *ut); + + +/** + * Get the code point at the current iteration position of the UText, and + * advance the position to the first index following the character. + * + * If the position is at the end of the text (the index following + * the last character, which is also the length of the text), + * return U_SENTINEL (-1) and do not advance the index. + * + * This is a post-increment operation. + * + * An inline macro version of this function, UTEXT_NEXT32(), + * is available for performance critical use. + * + * @param ut the text to be accessed. + * @return the Unicode code point at the iteration position. + * @see UTEXT_NEXT32 + * @stable ICU 3.4 + */ +U_CAPI UChar32 U_EXPORT2 +utext_next32(UText *ut); + + +/** + * Move the iterator position to the character (code point) whose + * index precedes the current position, and return that character. + * This is a pre-decrement operation. + * + * If the initial position is at the start of the text (index of 0) + * return U_SENTINEL (-1), and leave the position unchanged. + * + * An inline macro version of this function, UTEXT_PREVIOUS32(), + * is available for performance critical use. + * + * @param ut the text to be accessed. + * @return the previous UChar32 code point, or U_SENTINEL (-1) + * if the iteration has reached the start of the text. + * @see UTEXT_PREVIOUS32 + * @stable ICU 3.4 + */ +U_CAPI UChar32 U_EXPORT2 +utext_previous32(UText *ut); + + +/** + * Set the iteration index and return the code point at that index. + * Leave the iteration index at the start of the following code point. + * + * This function is the most efficient and convenient way to + * begin a forward iteration. The results are identical to the those + * from the sequence + * \code + * utext_setIndex(); + * utext_next32(); + * \endcode + * + * @param ut the text to be accessed. + * @param nativeIndex Iteration index, in the native units of the text provider. + * @return Code point which starts at or before index, + * or U_SENTINEL (-1) if it is out of bounds. + * @stable ICU 3.4 + */ +U_CAPI UChar32 U_EXPORT2 +utext_next32From(UText *ut, int64_t nativeIndex); + + + +/** + * Set the iteration index, and return the code point preceding the + * one specified by the initial index. Leave the iteration position + * at the start of the returned code point. + * + * This function is the most efficient and convenient way to + * begin a backwards iteration. + * + * @param ut the text to be accessed. + * @param nativeIndex Iteration index in the native units of the text provider. + * @return Code point preceding the one at the initial index, + * or U_SENTINEL (-1) if it is out of bounds. + * + * @stable ICU 3.4 + */ +U_CAPI UChar32 U_EXPORT2 +utext_previous32From(UText *ut, int64_t nativeIndex); + +/** + * Get the current iterator position, which can range from 0 to + * the length of the text. + * The position is a native index into the input text, in whatever format it + * may have (possibly UTF-8 for example), and may not always be the same as + * the corresponding UChar (UTF-16) index. + * The returned position will always be aligned to a code point boundary. + * + * @param ut the text to be accessed. + * @return the current index position, in the native units of the text provider. + * @stable ICU 3.4 + */ +U_CAPI int64_t U_EXPORT2 +utext_getNativeIndex(const UText *ut); + +/** + * Set the current iteration position to the nearest code point + * boundary at or preceding the specified index. + * The index is in the native units of the original input text. + * If the index is out of range, it will be pinned to be within + * the range of the input text. + *

+ * It will usually be more efficient to begin an iteration + * using the functions utext_next32From() or utext_previous32From() + * rather than setIndex(). + *

+ * Moving the index position to an adjacent character is best done + * with utext_next32(), utext_previous32() or utext_moveIndex32(). + * Attempting to do direct arithmetic on the index position is + * complicated by the fact that the size (in native units) of a + * character depends on the underlying representation of the character + * (UTF-8, UTF-16, UTF-32, arbitrary codepage), and is not + * easily knowable. + * + * @param ut the text to be accessed. + * @param nativeIndex the native unit index of the new iteration position. + * @stable ICU 3.4 + */ +U_CAPI void U_EXPORT2 +utext_setNativeIndex(UText *ut, int64_t nativeIndex); + +/** + * Move the iterator position by delta code points. The number of code points + * is a signed number; a negative delta will move the iterator backwards, + * towards the start of the text. + *

+ * The index is moved by delta code points + * forward or backward, but no further backward than to 0 and + * no further forward than to utext_nativeLength(). + * The resulting index value will be in between 0 and length, inclusive. + * + * @param ut the text to be accessed. + * @param delta the signed number of code points to move the iteration position. + * @return true if the position could be moved the requested number of positions while + * staying within the range [0 - text length]. + * @stable ICU 3.4 + */ +U_CAPI UBool U_EXPORT2 +utext_moveIndex32(UText *ut, int32_t delta); + +/** + * Get the native index of the character preceding the current position. + * If the iteration position is already at the start of the text, zero + * is returned. + * The value returned is the same as that obtained from the following sequence, + * but without the side effect of changing the iteration position. + * + * \code + * UText *ut = whatever; + * ... + * utext_previous(ut) + * utext_getNativeIndex(ut); + * \endcode + * + * This function is most useful during forwards iteration, where it will get the + * native index of the character most recently returned from utext_next(). + * + * @param ut the text to be accessed + * @return the native index of the character preceding the current index position, + * or zero if the current position is at the start of the text. + * @stable ICU 3.6 + */ +U_CAPI int64_t U_EXPORT2 +utext_getPreviousNativeIndex(UText *ut); + + +/** + * + * Extract text from a UText into a UChar buffer. The range of text to be extracted + * is specified in the native indices of the UText provider. These may not necessarily + * be UTF-16 indices. + *

+ * The size (number of 16 bit UChars) of the data to be extracted is returned. The + * full number of UChars is returned, even when the extracted text is truncated + * because the specified buffer size is too small. + *

+ * The extracted string will (if you are a user) / must (if you are a text provider) + * be NUL-terminated if there is sufficient space in the destination buffer. This + * terminating NUL is not included in the returned length. + *

+ * The iteration index is left at the position following the last extracted character. + * + * @param ut the UText from which to extract data. + * @param nativeStart the native index of the first character to extract.\ + * If the specified index is out of range, + * it will be pinned to be within 0 <= index <= textLength + * @param nativeLimit the native string index of the position following the last + * character to extract. If the specified index is out of range, + * it will be pinned to be within 0 <= index <= textLength. + * nativeLimit must be >= nativeStart. + * @param dest the UChar (UTF-16) buffer into which the extracted text is placed + * @param destCapacity The size, in UChars, of the destination buffer. May be zero + * for precomputing the required size. + * @param status receives any error status. + * U_BUFFER_OVERFLOW_ERROR: the extracted text was truncated because the + * buffer was too small. Returns number of UChars for preflighting. + * @return Number of UChars in the data to be extracted. Does not include a trailing NUL. + * + * @stable ICU 3.4 + */ +U_CAPI int32_t U_EXPORT2 +utext_extract(UText *ut, + int64_t nativeStart, int64_t nativeLimit, + UChar *dest, int32_t destCapacity, + UErrorCode *status); + + +U_CDECL_END + + +#endif diff --git a/third_party/icu4c/ndk_headers/unicode/utypes.h b/third_party/icu4c/ndk_headers/unicode/utypes.h index 5f6cac32a..8293ca70e 100644 --- a/third_party/icu4c/ndk_headers/unicode/utypes.h +++ b/third_party/icu4c/ndk_headers/unicode/utypes.h @@ -637,5 +637,13 @@ typedef enum UErrorCode { # define U_FAILURE(x) ((x)>U_ZERO_ERROR) #endif +/** + * Return a string for a UErrorCode value. + * The string will be the same as the name of the error code constant + * in the UErrorCode enum above. + * @stable ICU 2.0 + */ +U_CAPI const char * U_EXPORT2 +u_errorName(UErrorCode code); #endif /* _UTYPES */ -- Gitee From 66a34cbed3d6631a33a2d69e85fd51c67eed5396 Mon Sep 17 00:00:00 2001 From: Zhang Jinyu Date: Fri, 20 Dec 2024 16:14:54 +0800 Subject: [PATCH 553/620] =?UTF-8?q?TextPicker=E6=94=AF=E6=8C=81=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=AF=8F=E4=B8=80=E5=88=97=E7=9A=84=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zhang Jinyu Change-Id: I7f993139dbb364f0a360dba3603b6601a04b68a0 --- arkui/ace_engine/native/native_node.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index f20102e7c..fbbc866b6 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -5423,6 +5423,28 @@ typedef enum { * .value[0].i32: number of cached items in the grid adapter. \n */ NODE_GRID_CACHED_COUNT, + + /** + * @brief Defines the column width of the text picker. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: percentage of total width. The default value is that all colulmns are equal width.\n + * .value[1]?.f32: percentage of total width. The default value is that all colulmns are equal width.\n + * .value[2]?.f32: percentage of total width. The default value is that all colulmns are equal width.\n + * ...\n + * .value[n]?.f32: percentage of total width. The default value is that all colulmns are equal width.\n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * value[0].f32: percentage of total width.\n + * value[1].f32: percentage of total width.\n + * value[2].f32: percentage of total width.\n + * ...\n + * value[n].f32: percentage of total width.\n + * + * @since 16 + */ + NODE_TEXT_PICKER_COLUMN_WIDTHS = 15009, } ArkUI_NodeAttributeType; #define MAX_COMPONENT_EVENT_ARG_NUM 12 -- Gitee From 105abd67e3b90bb1de97ef03e4d4da0fdb42f7d8 Mon Sep 17 00:00:00 2001 From: fandongyu Date: Sat, 7 Dec 2024 12:10:37 +0800 Subject: [PATCH 554/620] Signed-off-by:fandongyu Signed-off-by: fandongyu --- .../include/image/image_packer_native.h | 4 +- .../include/image/image_source_native.h | 4 +- .../include/image/picture_native.h | 4 +- .../image_framework/include/image_mdk.h | 4 +- .../include/image_mdk_common.h | 4 +- .../include/image_packer_mdk.h | 2 +- .../include/image_receiver_mdk.h | 4 +- .../include/image_source_mdk.h | 88 ++++++++++--------- 8 files changed, 61 insertions(+), 53 deletions(-) diff --git a/multimedia/image_framework/include/image/image_packer_native.h b/multimedia/image_framework/include/image/image_packer_native.h index 4078a60da..068deed46 100644 --- a/multimedia/image_framework/include/image/image_packer_native.h +++ b/multimedia/image_framework/include/image/image_packer_native.h @@ -327,7 +327,7 @@ Image_ErrorCode OH_PackingOptionsForSequence_Release(OH_PackingOptionsForSequenc /** * @brief Create a pointer for OH_ImagePackerNative struct. * - * @param options The OH_ImagePackerNative pointer will be operated. + * @param imagePacker The imagePacker to be created. * @return Returns {@link Image_ErrorCode} * @since 12 */ @@ -469,5 +469,5 @@ Image_ErrorCode OH_ImagePackerNative_Release(OH_ImagePackerNative *imagePacker); #ifdef __cplusplus }; #endif -/* *@} */ +/** @} */ #endif // INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_IMAGE_PACKER_NATIVE_H_ \ No newline at end of file diff --git a/multimedia/image_framework/include/image/image_source_native.h b/multimedia/image_framework/include/image/image_source_native.h index 7e54b94ef..b48056ff5 100644 --- a/multimedia/image_framework/include/image/image_source_native.h +++ b/multimedia/image_framework/include/image/image_source_native.h @@ -353,7 +353,7 @@ Image_ErrorCode OH_ImageSourceNative_CreateFromRawFile(RawFileDescriptor *rawFil * @param source Indicates a void pointer(from ImageSource pointer convert). * @param options Indicates a pointer to the options for decoding the image source. * For details, see {@link OH_DecodingOptions}. - * @param resPixMap Indicates a void pointer to the Pixelmap object obtained at the C++ native layer. + * @param pixelmap Indicates a void pointer to the Pixelmap object obtained at the C++ native layer. * @return Returns {@link Image_ErrorCode} * @since 12 */ @@ -448,7 +448,7 @@ Image_ErrorCode OH_ImageSourceNative_ModifyImageProperty(OH_ImageSourceNative *s * @brief Obtains the number of frames from an ImageSource object. * * @param source Indicates a pointer to the {@link OH_ImageSource} object at the C++ native layer. - * @param res Indicates a pointer to the number of frames obtained. + * @param frameCount The number of image frameCount. * @return Returns {@link Image_ErrorCode} * @since 12 */ diff --git a/multimedia/image_framework/include/image/picture_native.h b/multimedia/image_framework/include/image/picture_native.h index 42eed5065..1602c85b0 100644 --- a/multimedia/image_framework/include/image/picture_native.h +++ b/multimedia/image_framework/include/image/picture_native.h @@ -19,7 +19,7 @@ * * @brief Provides APIs for obtaining picture data and information. * - * @Syscap SystemCapability.Multimedia.Image.Core + * @syscap SystemCapability.Multimedia.Image.Core * @since 13 */ @@ -30,7 +30,7 @@ * * @library libpicture.so * @kit ImageKit - * @Syscap SystemCapability.Multimedia.Image.Core + * @syscap SystemCapability.Multimedia.Image.Core * @since 13 */ #ifndef INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PICTURE_NATIVE_H_ diff --git a/multimedia/image_framework/include/image_mdk.h b/multimedia/image_framework/include/image_mdk.h index 3b3653658..053fbde05 100644 --- a/multimedia/image_framework/include/image_mdk.h +++ b/multimedia/image_framework/include/image_mdk.h @@ -19,7 +19,7 @@ * * @brief Provides APIs for access to the image interface. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 2.0 */ @@ -30,7 +30,9 @@ * @brief Declares functions that access the image rectangle, size, format, and component data. * Need link libimagendk.z.so * + * @library libimage_ndk.z.so * @kit ImageKit + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 2.0 */ diff --git a/multimedia/image_framework/include/image_mdk_common.h b/multimedia/image_framework/include/image_mdk_common.h index 2ed208982..c34252403 100644 --- a/multimedia/image_framework/include/image_mdk_common.h +++ b/multimedia/image_framework/include/image_mdk_common.h @@ -19,7 +19,7 @@ * * @brief Provides APIs for access to the image interface. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 2.0 */ @@ -30,6 +30,8 @@ * @brief Declares the common enums and structs used by the image interface. * * @kit ImageKit + * @library libimage_ndk.z.so + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 2.0 */ diff --git a/multimedia/image_framework/include/image_packer_mdk.h b/multimedia/image_framework/include/image_packer_mdk.h index 48a26cf4c..c7783cfc0 100644 --- a/multimedia/image_framework/include/image_packer_mdk.h +++ b/multimedia/image_framework/include/image_packer_mdk.h @@ -95,7 +95,7 @@ typedef struct ImagePacker_Opts_ ImagePacker_Opts; * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 11 * @version 4.1 */ diff --git a/multimedia/image_framework/include/image_receiver_mdk.h b/multimedia/image_framework/include/image_receiver_mdk.h index 1033f0bfe..9f90dc947 100644 --- a/multimedia/image_framework/include/image_receiver_mdk.h +++ b/multimedia/image_framework/include/image_receiver_mdk.h @@ -19,7 +19,7 @@ * * @brief Provides APIs for obtaining image data from the native layer. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 2.0 */ @@ -30,7 +30,9 @@ * @brief Declares the APIs for obtaining image data from the native layer. * Need link libimagendk.z.so and libimage_receiverndk.z.so * + * @library libimage_receiver_ndk.z.so * @kit ImageKit + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 2.0 */ diff --git a/multimedia/image_framework/include/image_source_mdk.h b/multimedia/image_framework/include/image_source_mdk.h index 91b4b5abd..aa5014037 100644 --- a/multimedia/image_framework/include/image_source_mdk.h +++ b/multimedia/image_framework/include/image_source_mdk.h @@ -19,7 +19,7 @@ * * @brief Provides native APIs for image sources. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -29,8 +29,9 @@ * * @brief Declares APIs for decoding an image source into a pixel map. * + * @library libimage_source_ndk.z.so * @kit ImageKit - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -52,7 +53,7 @@ extern "C" { /** * @brief Defines a native image source object for the image source APIs. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -61,7 +62,7 @@ struct ImageSourceNative_; /** * @brief Defines a native image source object for the image source APIs. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -72,7 +73,7 @@ typedef struct ImageSourceNative_ ImageSourceNative; * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}.\n * Add static keyword since API 12, it is used to limit the scope of the constant to a single file.\n * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -83,7 +84,7 @@ static const char* OHOS_IMAGE_PROPERTY_BITS_PER_SAMPLE = "BitsPerSample"; * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}.\n * Add static keyword since API 12, it is used to limit the scope of the constant to a single file.\n * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -94,7 +95,7 @@ static const char* OHOS_IMAGE_PROPERTY_ORIENTATION = "Orientation"; * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}.\n * Add static keyword since API 12, it is used to limit the scope of the constant to a single file.\n * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -105,7 +106,7 @@ static const char* OHOS_IMAGE_PROPERTY_IMAGE_LENGTH = "ImageLength"; * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}.\n * Add static keyword since API 12, it is used to limit the scope of the constant to a single file.\n * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -116,7 +117,7 @@ static const char* OHOS_IMAGE_PROPERTY_IMAGE_WIDTH = "ImageWidth"; * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}.\n * Add static keyword since API 12, it is used to limit the scope of the constant to a single file.\n * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -127,7 +128,7 @@ static const char* OHOS_IMAGE_PROPERTY_GPS_LATITUDE = "GPSLatitude"; * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}.\n * Add static keyword since API 12, it is used to limit the scope of the constant to a single file.\n * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -138,7 +139,7 @@ static const char* OHOS_IMAGE_PROPERTY_GPS_LONGITUDE = "GPSLongitude"; * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}.\n * Add static keyword since API 12, it is used to limit the scope of the constant to a single file.\n * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -149,7 +150,7 @@ static const char* OHOS_IMAGE_PROPERTY_GPS_LATITUDE_REF = "GPSLatitudeRef"; * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}.\n * Add static keyword since API 12, it is used to limit the scope of the constant to a single file.\n * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -160,7 +161,7 @@ static const char* OHOS_IMAGE_PROPERTY_GPS_LONGITUDE_REF = "GPSLongitudeRef"; * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}.\n * Add static keyword since API 12, it is used to limit the scope of the constant to a single file.\n * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -171,7 +172,7 @@ static const char* OHOS_IMAGE_PROPERTY_DATE_TIME_ORIGINAL = "DateTimeOriginal"; * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}.\n * Add static keyword since API 12, it is used to limit the scope of the constant to a single file.\n * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -182,7 +183,7 @@ static const char* OHOS_IMAGE_PROPERTY_EXPOSURE_TIME = "ExposureTime"; * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}.\n * Add static keyword since API 12, it is used to limit the scope of the constant to a single file.\n * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -193,7 +194,7 @@ static const char* OHOS_IMAGE_PROPERTY_SCENE_TYPE = "SceneType"; * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}.\n * Add static keyword since API 12, it is used to limit the scope of the constant to a single file.\n * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -204,7 +205,7 @@ static const char* OHOS_IMAGE_PROPERTY_ISO_SPEED_RATINGS = "ISOSpeedRatings"; * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}.\n * Add static keyword since API 12, it is used to limit the scope of the constant to a single file.\n * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -215,7 +216,7 @@ static const char* OHOS_IMAGE_PROPERTY_F_NUMBER = "FNumber"; * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}.\n * Add static keyword since API 12, it is used to limit the scope of the constant to a single file.\n * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -226,7 +227,7 @@ static const char* OHOS_IMAGE_PROPERTY_COMPRESSED_BITS_PER_PIXEL = "CompressedBi * It is used in {@link OhosImageDecodingOps}, {@link OH_ImageSource_CreatePixelMap}, and * {@link OH_ImageSource_CreatePixelMapList}. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -245,7 +246,7 @@ struct OhosImageRegion { * @brief Defines image source options infomation * {@link OH_ImageSource_Create} and {@link OH_ImageSource_CreateIncremental}. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -262,7 +263,7 @@ struct OhosImageSourceOps { * @brief Defines the options for decoding the image source. * It is used in {@link OH_ImageSource_CreatePixelMap} and {@link OH_ImageSource_CreatePixelMapList}. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -288,7 +289,7 @@ struct OhosImageDecodingOps { /** * @brief Defines the image source information, which is obtained by calling {@link OH_ImageSource_GetImageInfo}. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -331,7 +332,7 @@ struct OhosImageSource { * @brief Defines the delay time list of the image source. It is obtained by calling * {@link OH_ImageSource_GetDelayTime}. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -346,7 +347,7 @@ struct OhosImageSourceDelayTimeList { * @brief Defines image source supported format string. * {@link OhosImageSourceSupportedFormatList} and {@link OH_ImageSource_GetSupportedFormats} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -361,7 +362,7 @@ struct OhosImageSourceSupportedFormat { * @brief Defines the format string list supported by the image source. * It is obtained by calling {@link OH_ImageSource_GetSupportedFormats}. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -376,7 +377,7 @@ struct OhosImageSourceSupportedFormatList { * @brief Defines the property string (in key-value format) of the image source. * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -390,7 +391,7 @@ struct OhosImageSourceProperty { /** * @brief Defines the update data of the image source. It is obtained by calling {@link OH_ImageSource_UpdateData}. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -463,7 +464,7 @@ int32_t OH_ImageSource_Create(napi_env env, struct OhosImageSource* src, * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. * @see {@link OhosImageSourceOps} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 11 * @version 4.1 */ @@ -485,7 +486,7 @@ int32_t OH_ImageSource_CreateFromUri(napi_env env, char* uri, size_t size, * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. * @see {@link OhosImageSourceOps} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 11 * @version 4.1 */ @@ -508,7 +509,7 @@ int32_t OH_ImageSource_CreateFromFd(napi_env env, int32_t fd, * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. * @see {@link OhosImageSourceOps} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 11 * @version 4.1 */ @@ -530,7 +531,7 @@ int32_t OH_ImageSource_CreateFromData(napi_env env, uint8_t* data, size_t dataSi * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. * @see {@link OhosImageSourceOps} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 11 * @version 4.1 */ @@ -594,7 +595,7 @@ int32_t OH_ImageSource_CreateIncremental(napi_env env, struct OhosImageSource* s * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. * @see {@link OhosImageSourceOps}, {@link OH_ImageSource_UpdateData} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 11 * @version 4.1 */ @@ -617,7 +618,7 @@ int32_t OH_ImageSource_CreateIncrementalFromData(napi_env env, uint8_t* data, si * returns {@link IRNdkErrCode} IMAGE_RESULT_CHECK_FORMAT_ERROR - if decode fail. * @see {@link OhosImageSourceSupportedFormatList}, {@link OhosImageSourceSupportedFormat} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -633,7 +634,7 @@ int32_t OH_ImageSource_GetSupportedFormats(struct OhosImageSourceSupportedFormat * returns a null pointer otherwise. * @see {@link ImageSourceNative}, {@link OH_ImageSource_Release} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -678,7 +679,7 @@ ImageSourceNative* OH_ImageSource_InitNative(napi_env env, napi_value source); * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. * @see {@link ImageSourceNative}, {@link OhosImageDecodingOps} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -726,7 +727,7 @@ int32_t OH_ImageSource_CreatePixelMap(const ImageSourceNative* native, * returns {@link IRNdkErrCode} IMAGE_RESULT_PROPERTY_NOT_EXIST - if image property not exist. * @see {@link ImageSourceNative}, {@link OhosImageDecodingOps} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -761,7 +762,7 @@ int32_t OH_ImageSource_CreatePixelMapList(const ImageSourceNative* native, * returns {@link IRNdkErrCode} IMAGE_RESULT_PROPERTY_NOT_EXIST - if image property not exist. * @see {@link ImageSourceNative}, {@link OhosImageSourceDelayTimeList} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -793,7 +794,7 @@ int32_t OH_ImageSource_GetDelayTime(const ImageSourceNative* native, * returns {@link IRNdkErrCode} IMAGE_RESULT_PROPERTY_NOT_EXIST - if image property not exist. * @see {@link ImageSourceNative} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -826,7 +827,7 @@ int32_t OH_ImageSource_GetFrameCount(const ImageSourceNative* native, uint32_t * * returns {@link IRNdkErrCode} IMAGE_RESULT_PROPERTY_NOT_EXIST - if image property not exist. * @see {@link ImageSourceNative}, {@link OhosImageSourceInfo} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -862,7 +863,7 @@ int32_t OH_ImageSource_GetImageInfo(const ImageSourceNative* native, int32_t ind * returns {@link IRNdkErrCode} IMAGE_RESULT_PROPERTY_NOT_EXIST - if image property not exist. * @see {@link ImageSourceNative}, {@link OhosImageSourceProperty} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -895,7 +896,7 @@ int32_t OH_ImageSource_GetImageProperty(const ImageSourceNative* native, * returns {@link IRNdkErrCode} IMAGE_RESULT_PROPERTY_NOT_EXIST - if image property not exist. * @see {@link ImageSourceNative}, {@link OhosImageSourceProperty} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -938,7 +939,7 @@ int32_t OH_ImageSource_ModifyImageProperty(const ImageSourceNative* native, * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. * @see {@link ImageSourceNative}, {@link OhosImageSourceUpdateData} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -957,7 +958,7 @@ int32_t OH_ImageSource_UpdateData(const ImageSourceNative* native, struct OhosIm * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_ABNORMAL - if image input data error. * @see {@link ImageSourceNative}, {@link OH_ImageSource_Create}, {@link OH_ImageSource_CreateIncremental} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ @@ -966,3 +967,4 @@ int32_t OH_ImageSource_Release(ImageSourceNative* native); }; #endif #endif // INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_SOURCE_MDK_H_ +/** @} */ -- Gitee From fac57ef4d4538de99754fb97ee6246c1707953a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=91=E5=B1=91=E5=B1=91?= Date: Fri, 20 Dec 2024 19:23:36 +0800 Subject: [PATCH 555/620] api link fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 屑屑屑 --- multimedia/image_framework/include/image_pixel_map_mdk.h | 4 +++- multimedia/image_framework/include/image_pixel_map_napi.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/multimedia/image_framework/include/image_pixel_map_mdk.h b/multimedia/image_framework/include/image_pixel_map_mdk.h index b05dc9ca7..2fd6f9f22 100644 --- a/multimedia/image_framework/include/image_pixel_map_mdk.h +++ b/multimedia/image_framework/include/image_pixel_map_mdk.h @@ -19,7 +19,7 @@ * * @brief Provides APIs for obtaining pixel map data and information. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 1.0 */ @@ -30,6 +30,8 @@ * @brief Declares the APIs that can lock, access, and unlock a pixel map. * Need link libpixelmapndk.z.so * + * @library libpixelmap_ndk.so + * @syscap SystemCapability.Multimedia.Image * @kit ImageKit * @since 10 * @version 1.0 diff --git a/multimedia/image_framework/include/image_pixel_map_napi.h b/multimedia/image_framework/include/image_pixel_map_napi.h index 3608dac13..91328b45e 100644 --- a/multimedia/image_framework/include/image_pixel_map_napi.h +++ b/multimedia/image_framework/include/image_pixel_map_napi.h @@ -19,7 +19,7 @@ * * @brief Provides APIs for obtaining pixel map data and information. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 8 * @version 1.0 */ @@ -29,6 +29,8 @@ * * @brief Declares the APIs that can lock, access, and unlock a pixel map. * + * @library libpixelmap_ndk.so + * @syscap SystemCapability.Multimedia.Image * @kit ImageKit * @since 8 * @version 1.0 -- Gitee From ea2c8395e9099c3028ca76f42642aab2e48a9f51 Mon Sep 17 00:00:00 2001 From: yangqirun Date: Sat, 21 Dec 2024 11:15:16 +0800 Subject: [PATCH 556/620] Add ndk interfaces of processor Signed-off-by: yangqirun Change-Id: I0c0ef03b9fcfb8ab9e24933a64c81a757d9c0747 --- .../include/hiappevent/hiappevent.h | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h index 26a001799..d2867a903 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h @@ -87,6 +87,30 @@ extern "C" { #endif +/** + * @brief Defines error code + * + * @since 16 + */ +typedef enum { + /** @error The operation is successful. */ + HIAPPEVENT_SUCCESS = 0, + /** @error Invalid param value length */ + HIAPPEVENT_INVALID_PARAM_VALUE_LENGTH = 4, + /** @error Processor is null */ + HIAPPEVENT_PROCESSOR_IS_NULL = -7, + /** @error Processor not found */ + HIAPPEVENT_PROCESSOR_NOT_FOUND = -8, + /** @error Invalid param value */ + HIAPPEVENT_INVALID_PARAM_VALUE = -9, + /** @error event config is null */ + HIAPPEVENT_EVENT_CONFIG_IS_NULL = -10, + /** @error Operate failed */ + HIAPPEVENT_OPERATE_FAILED = -100, + /** @error Invalid uid */ + HIAPPEVENT_INVALID_UID = -200 +} HiAppEvent_ErrorCode; + /** * @brief Event types. * @@ -164,6 +188,13 @@ typedef struct ParamListNode* ParamList; */ typedef struct HiAppEvent_Watcher HiAppEvent_Watcher; +/** + * @brief The HiAppEvent_Processor structure is designed for event report. + * + * @since 16 + */ +typedef struct HiAppEvent_Processor HiAppEvent_Processor; + /** * @brief The OH_HiAppEvent_OnReceive function acts as the callback function for the HiAppEvent_Watcher. It is called * when an event occurs. @@ -610,6 +641,163 @@ int OH_HiAppEvent_RemoveWatcher(HiAppEvent_Watcher* watcher); * @version 1.0 */ void OH_HiAppEvent_ClearData(); + +/** + * @brief Create a HiAppEvent_Processor handler pointer to set the property. + * + * @param name The name of the processor. + * @return Returns a pointer to the HiAppEvent_Processor instance. + * @since 16 + */ +HiAppEvent_Processor* OH_HiAppEvent_CreateProcessor(const char* name); + +/** + * @brief The interface to set route for processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @param appId The appid of the processor. + * @param routeInfo The server location information. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_PROCESSOR_IS_NULL} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE_LENGTH} Invalid param value length. + * @since 16 + */ +int OH_HiAppEvent_SetReportRoute(HiAppEvent_Processor* processor, const char* appId, const char* routeInfo); + +/** + * @brief The interface to set policy for processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @param periodReport The time interval to report. + * @param batchReport The threthold to report. + * @param onStartReport The strategy to report. + * @param onBackgroundReport The strategy to report. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_PROCESSOR_IS_NULL} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * @since 16 + */ +int OH_HiAppEvent_SetReportPolicy(HiAppEvent_Processor* processor, int periodReport, int batchReport, + bool onStartReport, bool onBackgroundReport); + +/** + * @brief The interface to set report event for processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @param domain The event domain to report. + * @param name The event name to report. + * @param isRealTime The strategy to report. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_PROCESSOR_IS_NULL} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * @since 16 + */ +int OH_HiAppEvent_SetReportEvent(HiAppEvent_Processor* processor, const char* domain, const char* name, + bool isRealTime); + +/** + * @brief The interface to set config for processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @param key The custom key of processor. + * @param value The custom value of processor. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_PROCESSOR_IS_NULL} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE_LENGTH} Invalid param value length. + * @since 16 + */ +int OH_HiAppEvent_SetCustomConfig(HiAppEvent_Processor* processor, const char* key, const char* value); + +/** + * @brief The interface to set configId for processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @param configId The configId of processor. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_INVALID_PROCESSOR} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * @since 16 + */ +int OH_HiAppEvent_SetConfigId(HiAppEvent_Processor* processor, int configId); + +/** + * @brief The interface to set user info for processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @param userIdNames The userIdNames of processor. + * @param size The size of userIdNames array. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_INVALID_PROCESSOR} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE_LENGTH} Invalid param value length. + * @since 16 + */ +int OH_HiAppEvent_SetReportUserId(HiAppEvent_Processor* processor, const char* const * userIdNames, int size); + +/** + * @brief The interface to set user property for processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @param userPropertyNames The userPropertyNames of processor. + * @param size The size of userPropertyNames array. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_INVALID_PROCESSOR} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE_LENGTH} Invalid param value length. + * @since 16 + */ +int OH_HiAppEvent_SetReportUserProperty(HiAppEvent_Processor* processor, const char* const * userPropertyNames, + int size); + +/** + * @brief The interface to add processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @return process id if set is successful. + * {@link HIAPPEVENT_INVALID_PROCESSOR} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_OPERATE_FAILED} Name not found or register processor error. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * @since 16 + */ +int64_t OH_HiAppEvent_AddProcessor(HiAppEvent_Processor* processor); + +/** + * @brief The interface to destroy processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @since 16 + */ +void OH_HiAppEvent_DestoryProcessor(HiAppEvent_Processor* processor); + +/** + * @brief The interface to remove processor. + * + * @param processorId The id of the processor. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_PROCESSOR_NOT_FOUND} Processor not add. + * {@link HIAPPEVENT_OPERATE_FAILED} The operation is failed. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * @since 16 + */ +int OH_HiAppEvent_RemoveProcessor(int64_t processorId); #ifdef __cplusplus } #endif -- Gitee From e978df42ace9871fde1edf991bf096ec763be18a Mon Sep 17 00:00:00 2001 From: l00844999 Date: Wed, 27 Nov 2024 15:36:43 +0800 Subject: [PATCH 557/620] Drawing ThemeFont Signed-off-by: l00844999 --- .../graphic_2d/native_drawing/drawing_font.h | 26 +++++++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 8 ++++++ 2 files changed, 34 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index 364ffb886..df5d11398 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -552,6 +552,32 @@ OH_Drawing_ErrorCode OH_Drawing_FontGetPathForGlyph(const OH_Drawing_Font* font, OH_Drawing_ErrorCode OH_Drawing_FontGetTextPath(const OH_Drawing_Font* font, const void* text, size_t byteLength, OH_Drawing_TextEncoding encoding, float x, float y, OH_Drawing_Path* path); +/** + * @brief Sets whether to follow the theme font. If the value is true, the theme font is used when typeface is not set. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param font Indicates the pointer to an OH_Drawing_Font object. + * @param followed Indicates whether to follow the theme font. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if font is nullptr. + * @since 16 + */ +OH_Drawing_ErrorCode OH_Drawing_FontSetThemeFontFollowed(OH_Drawing_Font* font, bool followed); + +/** + * @brief Gets whether to follow the theme font. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param font Indicates the pointer to an OH_Drawing_Font object. + * @param followed Indicates whether to follow the theme font. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if font or followed is nullptr. + * @since 16 + */ +OH_Drawing_ErrorCode OH_Drawing_FontIsThemeFontFollowed(const OH_Drawing_Font* font, bool* followed); + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 827409165..c33c60140 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -238,6 +238,10 @@ "first_introduced": "12", "name": "OH_Drawing_FontIsSubpixel" }, + { + "first_introduced": "16", + "name": "OH_Drawing_FontIsThemeFontFollowed" + }, { "first_introduced": "12", "name": "OH_Drawing_FontMeasureSingleCharacter" @@ -276,6 +280,10 @@ "first_introduced": "12", "name": "OH_Drawing_FontSetSubpixel" }, + { + "first_introduced": "16", + "name": "OH_Drawing_FontSetThemeFontFollowed" + }, { "first_introduced": "12", "name": "OH_Drawing_FontTextToGlyphs" -- Gitee From 9f1ca80c9c11bc622f18c20dbc544a0190eb0c64 Mon Sep 17 00:00:00 2001 From: AnBetter Date: Sat, 21 Dec 2024 14:20:15 +0800 Subject: [PATCH 558/620] =?UTF-8?q?Progress=E7=BA=BF=E6=80=A7=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E5=A2=9E=E5=8A=A0CAPI=E6=8E=A5=E5=8F=A3=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E4=B8=BB=E5=B9=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: AnBetter --- arkui/ace_engine/native/libace.ndk.json | 40 ++++++++++ arkui/ace_engine/native/native_node.h | 13 ++++ arkui/ace_engine/native/native_type.h | 99 +++++++++++++++++++++++++ 3 files changed, 152 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index d4a39a67f..1ffea35d0 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2502,5 +2502,45 @@ { "first_introduced": "15", "name": "OH_ArkUI_FocusAxisEvent_SetStopPropagation" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_ProgressLinearStyleOption_Create" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_ProgressLinearStyleOption_Destroy" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_ProgressLinearStyleOption_SetScanEffectEnabled" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_ProgressLinearStyleOption_SetSmoothEffectEnabled" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_ProgressLinearStyleOption_SetStrokeWidth" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_ProgressLinearStyleOption_SetStrokeRadius" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_ProgressLinearStyleOption_GetScanEffectEnabled" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_ProgressLinearStyleOption_GetSmoothEffectEnabled" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_ProgressLinearStyleOption_GetStrokeWidth" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_ProgressLinearStyleOption_GetStrokeRadius" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index ccbb77543..5a66cb05b 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -3339,6 +3339,19 @@ typedef enum { * */ NODE_PROGRESS_TYPE, + /** + * @brief Sets the style of the linear progress indicator. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .object: Use the {@link ArkUI_ProgressLinearStyleOption} object to set the style. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .object: Use the {@link ArkUI_ProgressLinearStyleOption} object to get the style. \n + * + * @since 16 + */ + NODE_PROGRESS_LINEAR_STYLE, /** * @brief Defines whether the check box is selected. diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index d5062eb60..91d8f9944 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -207,6 +207,13 @@ typedef struct ArkUI_CustomProperty ArkUI_CustomProperty; */ typedef struct ArkUI_ActiveChildrenInfo ArkUI_ActiveChildrenInfo; +/** + * @brief Set the linear progress indicator style. + * + * @since 16 + */ +typedef struct ArkUI_ProgressLinearStyleOption ArkUI_ProgressLinearStyleOption; + /** * @brief Defines the event callback type. * @@ -4005,6 +4012,98 @@ ArkUI_NodeHandle OH_ArkUI_ActiveChildrenInfo_GetNodeByIndex(ArkUI_ActiveChildren * @since 14 */ int32_t OH_ArkUI_ActiveChildrenInfo_GetCount(ArkUI_ActiveChildrenInfo* handle); + +/** + * @brief Create linear progress indicator style information. + * + * @return Returns a ProgressLinearStyleOption instance. + *
If the result returns nullptr, there may be out of memory. + * @since 16 + */ +ArkUI_ProgressLinearStyleOption* OH_ArkUI_ProgressLinearStyleOption_Create(); + +/** + * @brief Destroy linear progress indicator style information. + * + * @param option Linear progress indicator style information. + * @since 16 + */ +void OH_ArkUI_ProgressLinearStyleOption_Destroy(ArkUI_ProgressLinearStyleOption* option); + +/** + * @brief Set whether the scan effect is enabled. + * + * @param option Linear progress indicator style information. + * @param enabled Whether to enable the scan effect. Default value: false. + * @since 16 + */ +void OH_ArkUI_ProgressLinearStyleOption_SetScanEffectEnabled(ArkUI_ProgressLinearStyleOption* option, bool enabled); + +/** + * @brief Set whether smoothing effect is enabled. + * + * @param option Linear progress indicator style information. + * @param enabled Whether to enable the smooth effect. When this effect is enabled, the progress change to + * the set value takes place gradually. Otherwise, it takes place immediately. Default value: true. + * @since 16 + */ +void OH_ArkUI_ProgressLinearStyleOption_SetSmoothEffectEnabled(ArkUI_ProgressLinearStyleOption* option, bool enabled); + +/** + * @brief Set linear progress indicator stroke width. + * + * @param option Linear progress indicator style information. + * @param strokeWidth Stroke width of the progress indicator. It cannot be set in percentage. + * Default value: 4.0vp. + * @since 16 + */ +void OH_ArkUI_ProgressLinearStyleOption_SetStrokeWidth(ArkUI_ProgressLinearStyleOption* option, float strokeWidth); + +/** + * @brief Set linear progress indicator stroke radius. + * + * @param option Linear progress indicator style information. + * @param strokeRadius Rounded corner radius of the progress indicator. Value range: [0, strokeWidth/2]. + * Default value: strokeWidth/2. + * @since 16 + */ +void OH_ArkUI_ProgressLinearStyleOption_SetStrokeRadius(ArkUI_ProgressLinearStyleOption* option, float strokeRadius); + +/** + * @brief Get whether scan effect is enable. + * + * @param option Linear progress indicator style information. + * @return Whether to enable the scan effect. + * @since 16 + */ +bool OH_ArkUI_ProgressLinearStyleOption_GetScanEffectEnabled(ArkUI_ProgressLinearStyleOption* option); + +/** + * @brief Get whether smoothing effect is enabled. + * + * @param option Linear progress indicator style information. + * @return Whether to enable the smooth effect. + * @since 16 + */ +bool OH_ArkUI_ProgressLinearStyleOption_GetSmoothEffectEnabled(ArkUI_ProgressLinearStyleOption* option); + +/** + * @brief Get linear progress indicator stroke width. + * + * @param option Linear progress indicator style information. + * @return Stroke width of the progress indicator. + * @since 16 + */ +float OH_ArkUI_ProgressLinearStyleOption_GetStrokeWidth(ArkUI_ProgressLinearStyleOption* option); + +/** + * @brief Get linear progress indicator stroke radius. + * + * @param option Linear progress indicator style information. + * @return Rounded corner radius of the progress indicator. + * @since 16 + */ +float OH_ArkUI_ProgressLinearStyleOption_GetStrokeRadius(ArkUI_ProgressLinearStyleOption* option); #ifdef __cplusplus }; #endif -- Gitee From 4e1509eaf97498a1157ca8a6f6148703967bab15 Mon Sep 17 00:00:00 2001 From: wanjining Date: Sat, 21 Dec 2024 18:49:29 +0800 Subject: [PATCH 559/620] =?UTF-8?q?TextInput/TextArea=20CAPI=E8=A1=A5?= =?UTF-8?q?=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanjining --- arkui/ace_engine/native/libace.ndk.json | 4 + arkui/ace_engine/native/native_node.h | 107 ++++++++++++++++++++++++ 2 files changed, 111 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 1ffea35d0..ca090d8b7 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2542,5 +2542,9 @@ { "first_introduced": "16", "name": "OH_ArkUI_ProgressLinearStyleOption_GetStrokeRadius" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_NodeEvent_GetTextChangeEvent" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 5a66cb05b..e008614e1 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -2970,6 +2970,34 @@ typedef enum { * */ NODE_TEXT_INPUT_NUMBER_OF_LINES, + + /** + * @brief Sets the letter spacing of the TextInput component. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: letter spacing. The default unit is fp. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: letter spacing. The default unit is fp. \n + * + * @since 16 + */ + NODE_TEXT_INPUT_LETTER_SPACING = 7032, + /** + * @brief Sets whether to enable preview text for the TextInput component. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: whether to enable preview tex. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether to enable preview tex. \n + * + * @since 16 + */ + NODE_TEXT_INPUT_ENABLE_PREVIEW_TEXT = 7033, + /** * @brief Defines the default placeholder text for the multi-line text box. * This attribute can be set, reset, and obtained as required through APIs. @@ -3264,6 +3292,34 @@ typedef enum { * */ NODE_TEXT_AREA_NUMBER_OF_LINES, + + /** + * @brief Sets the letter spacing of the TextArea component. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: letter spacing. The default unit is fp. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: letter spacing. The default unit is fp. \n + * + * @since 16 + */ + NODE_TEXT_AREA_LETTER_SPACING = 8023, + /** + * @brief Sets whether to enable preview text for the TextArea component. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: whether to enable preview tex. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether to enable preview tex. \n + * + * @since 16 + */ + NODE_TEXT_AREA_ENABLE_PREVIEW_TEXT = 8024, + /** * @brief Defines the button text content. This attribute can be set, reset, and obtained as required through APIs. * @@ -5476,6 +5532,20 @@ typedef struct { const char* pStr; } ArkUI_StringAsyncEvent; +/** + * @brief Defines a hybrid data structure for component events. + * + * @since 16 + */ +typedef struct { + /** String data */ + const char* pStr; + /** Extended string data */ + const char* pExtendStr; + /** Numeric data */ + int32_t number; +} ArkUI_TextChangeEvent; + /** * @brief Enumerates the event types supported by the NativeNode component. * @@ -5998,6 +6068,20 @@ typedef enum { */ NODE_TEXT_INPUT_ON_DID_DELETE = 7012, + /** + * @brief Defines the event triggered when content (including preview text) changes in the TextInput + * component. + * + * When the event callback occurs, the union type {@link ArkUI_NodeEvent} is {@link ArkUI_TextChangeEvent}. \n + * {@link ArkUI_TextChangeEvent} contains the following parameters: \n + * ArkUI_TextChangeEvent.pStr: content in the TextInput component. + * ArkUI_TextChangeEvent.pExtendStr: content of the preview text in the TextInput component. + * ArkUI_TextChangeEvent.number: start position of the preview text in the TextInput component. + * + * @since 16 + */ + NODE_TEXT_INPUT_ON_CHANGE_WITH_PREVIEW_TEXT = 7013, + /** * @brief Defines the event triggered when the input in the text box changes. * @@ -6150,6 +6234,20 @@ typedef enum { */ NODE_TEXT_AREA_ON_DID_DELETE = 8011, + /** + * @brief Defines the event triggered when content (including preview text) changes in the TextArea + * component. + * + * When the event callback occurs, the union type {@link ArkUI_NodeEvent} is {@link ArkUI_TextChangeEvent}. \n + * {@link ArkUI_TextChangeEvent} contains the following parameters: \n + * ArkUI_TextChangeEvent.pStr: content in the TextArea component. + * ArkUI_TextChangeEvent.pExtendStr: content of the preview text in the TextArea component. + * ArkUI_TextChangeEvent.number: start position of the preview text in the TextArea component. + * + * @since 16 + */ + NODE_TEXT_AREA_ON_CHANGE_WITH_PREVIEW_TEXT = 8012, + /** * @brief Defines the event triggered when the selected status of the ARKUI_NODE_CHECKBOX component changes. * @@ -6696,6 +6794,15 @@ ArkUI_NodeComponentEvent* OH_ArkUI_NodeEvent_GetNodeComponentEvent(ArkUI_NodeEve */ ArkUI_StringAsyncEvent* OH_ArkUI_NodeEvent_GetStringAsyncEvent(ArkUI_NodeEvent* event); +/** + * @brief Obtains the ArkUI_TextChangeEvent data from a component event. + * + * @param event Pointer to a component event. It cannot be null. + * @return Returns the pointer to the ArkUI_TextChangeEvent object. + * @since 16 + */ +ArkUI_TextChangeEvent* OH_ArkUI_NodeEvent_GetTextChangeEvent(ArkUI_NodeEvent* event); + /** * @brief Obtains the custom data in a component event. * -- Gitee From 7ba803fe3f9ad41b89748d2ee8bdec5ec8cb8123 Mon Sep 17 00:00:00 2001 From: peng Date: Sat, 21 Dec 2024 13:21:19 +0000 Subject: [PATCH 560/620] add muxer ndk interface Signed-off-by: peng --- multimedia/av_codec/native_avcodec_base.h | 10 +++++++++- multimedia/av_codec/native_avmuxer.h | 14 +++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 3fcd8cc53..547268a0e 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -977,6 +977,14 @@ extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE; */ extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR; +/** + * @brief Key for creation timestamp of a media file, value type is int64_t. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 14 + */ +extern const char *OH_MD_KEY_CREATION_TIME; + /** * @brief Media type. * @@ -1366,4 +1374,4 @@ typedef enum OH_BitrateMode { #endif #endif // NATIVE_AVCODEC_BASE_H -/** @} */ \ No newline at end of file +/** @} */ diff --git a/multimedia/av_codec/native_avmuxer.h b/multimedia/av_codec/native_avmuxer.h index e50b31cee..8cd87e5dc 100644 --- a/multimedia/av_codec/native_avmuxer.h +++ b/multimedia/av_codec/native_avmuxer.h @@ -76,6 +76,18 @@ OH_AVMuxer *OH_AVMuxer_Create(int32_t fd, OH_AVOutputFormat format); */ OH_AVErrCode OH_AVMuxer_SetRotation(OH_AVMuxer *muxer, int32_t rotation); +/** + * @brief Set format to the muxer. + * @syscap SystemCapability.Multimedia.Media.Muxer + * @param muxer Pointer to an OH_AVMuxer instance + * @param format OH_AVFormat handle pointer contain format + * @return Returns AV_ERR_OK if the execution is successful, + * otherwise returns a specific error code, refer to {@link OH_AVErrCode} + * {@link AV_ERR_INVALID_VAL}, the muxer or format invalid. + * @since 14 + */ +OH_AVErrCode OH_AVMuxer_SetFormat(OH_AVMuxer *muxer, OH_AVFormat *format); + /** * @brief Add track format to the muxer. * Note: This interface can only be called before OH_AVMuxer_Start. @@ -182,4 +194,4 @@ OH_AVErrCode OH_AVMuxer_Destroy(OH_AVMuxer *muxer); #endif #endif // NATIVE_AVMUXER_H -/** @} */ \ No newline at end of file +/** @} */ -- Gitee From dcba35d3a25ba82defc25310354cd3521105a938 Mon Sep 17 00:00:00 2001 From: Hu_zq Date: Sat, 21 Dec 2024 22:28:15 +0800 Subject: [PATCH 561/620] Swiper: pageflipmode change 14 to 15 Signed-off-by: Hu_zq Change-Id: Ie349fe4ddec67f9aa34a71a0621fb9dafc56f609 --- arkui/ace_engine/native/native_node.h | 2 +- arkui/ace_engine/native/native_type.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index e008614e1..ad33dc659 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -5036,7 +5036,7 @@ typedef enum { * Format of the return value {@link ArkUI_PageFlipMode}:\n * .value[0].i32: page flipping mode using the mouse wheel. \n * - * @since 14 + * @since 15 */ NODE_SWIPER_PAGE_FLIP_MODE, diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 08542a381..fdf5bb169 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -783,7 +783,7 @@ typedef enum { /** * @brief Enumerates the page flipping modes using the mouse wheel for the Swiper component. * - * @since 14 + * @since 15 */ typedef enum { /** When the mouse wheel is scrolled continuously, multiple pages are flipped, which is determined by the number of -- Gitee From b434d394183880438d4b42dca28c5e519dd91961 Mon Sep 17 00:00:00 2001 From: zcdqs Date: Sun, 22 Dec 2024 11:10:14 +0800 Subject: [PATCH 562/620] add stop when touched to swiper autoplay Signed-off-by: zcdqs Change-Id: I31e41759ec2d2dc645aaf2294f15146b3e2b29d0 --- arkui/ace_engine/native/native_node.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index e008614e1..ee0c94de8 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -4768,9 +4768,15 @@ typedef enum { * .value[0].i32: whether to enable automatic playback for child component switching. The value 1 * means to enable automatic playback, and 0 means the opposite. The default value is 0. \n * \n + * .value[1]?.i32: whether to stop automatic playback when the user touches the screen. The value 1 means + * to stop automatic playback, and 0 means the opposite. The default value is 1. This parameter is + * supported since API version 16. \n + * \n * Format of the return value {@link ArkUI_AttributeItem}:\n * .value[0].i32: whether to enable automatic playback for child component switching. The value 1 means * to enable automatic playback, and 0 means the opposite. The default value is 0. \n + * .value[1].i32: whether to stop automatic playback when the user touches the screen. The value 1 means to + * stop automatic playback, and 0 means the opposite. This parameter is supported since API version 16. \n * */ NODE_SWIPER_AUTO_PLAY, -- Gitee From e33146cec32a73c8932548fdd371421400fa5ce6 Mon Sep 17 00:00:00 2001 From: wangxiuxiu Date: Fri, 20 Dec 2024 15:16:17 +0800 Subject: [PATCH 563/620] change keyEvent note Signed-off-by: wangxiuxiu --- arkui/ace_engine/native/ui_input_event.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arkui/ace_engine/native/ui_input_event.h b/arkui/ace_engine/native/ui_input_event.h index 85a377f12..00ea54539 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -726,9 +726,7 @@ int32_t OH_ArkUI_PointerEvent_SetStopPropagation(const ArkUI_UIInputEvent* event int32_t OH_ArkUI_UIInputEvent_GetDeviceId(const ArkUI_UIInputEvent* event); /** - * @brief Obtains the pressed status of modifier keys from UI input event. - * The following modifier keys are supported: Ctrl, Alt, Shift, Fn. However, the Fn key on external keyboards - * is not supported. + * @brief Obtains all keys that are pressed from UI input event. * * @param event Pointer to an ArkUI_UIInputEvent object. * @param pressedKeyCodes Array of all keys that are pressed. You need to allocate the memory space. @@ -736,7 +734,7 @@ int32_t OH_ArkUI_UIInputEvent_GetDeviceId(const ArkUI_UIInputEvent* event); * number of the keys pressed (when used as an output parameter). * @return Returns the result code. * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - * Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} if the giving buffer is not enough. + * Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH} if the giving buffer is not enough. * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. * @since 14 */ -- Gitee From a30f53c70b77387c4ed046546977b76ed59eb5dc Mon Sep 17 00:00:00 2001 From: liuyifei Date: Mon, 23 Dec 2024 02:46:52 +0000 Subject: [PATCH 564/620] add hilog ndk interface Signed-off-by: liuyifei --- hiviewdfx/hilog/include/hilog/log.h | 72 +++++++++++++++++++++++++++++ hiviewdfx/hilog/libhilog.ndk.json | 12 +++++ 2 files changed, 84 insertions(+) diff --git a/hiviewdfx/hilog/include/hilog/log.h b/hiviewdfx/hilog/include/hilog/log.h index 5fa41928a..6d4914dc9 100644 --- a/hiviewdfx/hilog/include/hilog/log.h +++ b/hiviewdfx/hilog/include/hilog/log.h @@ -63,6 +63,7 @@ #ifndef HIVIEWDFX_HILOG_H #define HIVIEWDFX_HILOG_H +#include #include #include @@ -155,6 +156,69 @@ typedef enum { int OH_LOG_Print(LogType type, LogLevel level, unsigned int domain, const char *tag, const char *fmt, ...) __attribute__((__format__(os_log, 5, 6))); +/** + * @brief Outputs logs. + * + * You can use this function to output logs based on the specified log type, log level, service domain, log tag, + * and message text. + * + * @param type Indicates the log type. The type for third-party applications is defined by {@link LOG_APP}. + * @param level Indicates the log level, which can be LOG_DEBUG, LOG_INFO, LOG_WARN, + * LOG_ERROR, and LOG_FATAL. + * @param domain Indicates the service domain of logs. Its value is a hexadecimal integer ranging from 0x0 to 0xFFFF. + * @param tag Indicates the log tag, which is a string used to identify the class, file, or service behavior. + * @param message Indicates the log string. + * @return Returns 0 or a larger value if the operation is successful; returns a value smaller + * than 0 otherwise. + * @since 16 + */ +int OH_LOG_PrintMsg(LogType type, LogLevel level, unsigned int domain, const char *tag, const char *message); + +/** + * @brief Outputs logs. + * + * You can use this function to output logs based on the specified log type, log level, service domain, log tag, + * message text and message length. + * + * @param type Indicates the log type. The type for third-party applications is defined by {@link LOG_APP}. + * @param level Indicates the log level, which can be LOG_DEBUG, LOG_INFO, LOG_WARN, + * LOG_ERROR, and LOG_FATAL. + * @param domain Indicates the service domain of logs. Its value is a hexadecimal integer ranging from 0x0 to 0xFFFF. + * @param tag Indicates the log tag, which is a string used to identify the class, file, or service behavior. + * @param tagLen Indicates the length of tag. + * @param message Indicates the log string. + * @param messageLen Indicates the length of message. + * @return Returns 0 or a larger value if the operation is successful; returns a value smaller + * than 0 otherwise. + * @since 16 + */ +int OH_LOG_PrintMsgByLen(LogType type, LogLevel level, unsigned int domain, const char *tag, size_t tagLen, + const char *message, size_t messageLen); + +/** + * @brief Outputs logs. + * + * You can use this function to output logs based on the specified log type, log level, service domain, log tag, + * and a va_list instead of variable parameters determined by the format specifier and privacy identifier in the printf + * format. + * + * @param type Indicates the log type. The type for third-party applications is defined by {@link LOG_APP}. + * @param level Indicates the log level, which can be LOG_DEBUG, LOG_INFO, LOG_WARN, + * LOG_ERROR, and LOG_FATAL. + * @param domain Indicates the service domain of logs. Its value is a hexadecimal integer ranging from 0x0 to 0xFFFF. + * @param tag Indicates the log tag, which is a string used to identify the class, file, or service behavior. + * @param fmt Indicates the format string, which is an enhancement of a printf format string and supports the privacy + * identifier. Specifically, {public} or {private} is added between the % character and the format specifier + * in each parameter. \n + * @param ap Indicates a list of parameters. The number and type of parameters must map onto the format specifiers + * in the format string. + * @return Returns 0 or a larger value if the operation is successful; returns a value smaller + * than 0 otherwise. + * @since 16 + */ +int OH_LOG_VPrint(LogType type, LogLevel level, unsigned int domain, const char *tag, const char *fmt, va_list ap) + __attribute__((__format__(os_log, 5, 0))); + /** * @brief Checks whether logs of the specified service domain, log tag, and log level can be output. * @@ -279,6 +343,14 @@ typedef void (*LogCallback)(const LogType type, const LogLevel level, const unsi */ void OH_LOG_SetCallback(LogCallback callback); +/** + * @brief Sets the lowest log level of the current application process. + * + * @param level log level + * @since 16 + */ +void OH_LOG_SetMinLogLevel(LogLevel level); + #ifdef __cplusplus } #endif diff --git a/hiviewdfx/hilog/libhilog.ndk.json b/hiviewdfx/hilog/libhilog.ndk.json index 2ca6bed2c..0d14010e0 100644 --- a/hiviewdfx/hilog/libhilog.ndk.json +++ b/hiviewdfx/hilog/libhilog.ndk.json @@ -7,5 +7,17 @@ }, { "name": "OH_LOG_SetCallback" + }, + { + "name": "OH_LOG_PrintMsg" + }, + { + "name": "OH_LOG_PrintMsgByLen" + }, + { + "name": "OH_LOG_VPrint" + }, + { + "name": "OH_LOG_SetMinLogLevel" } ] -- Gitee From 49740acafa3cb78d6ee1b4734732af68f0202d2e Mon Sep 17 00:00:00 2001 From: liujiaxing19 Date: Fri, 20 Dec 2024 15:53:56 +0800 Subject: [PATCH 565/620] =?UTF-8?q?=E3=80=90hiappevent=E3=80=91=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=B0=83=E6=95=B4=E7=B3=BB=E7=BB=9F=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E8=A7=A6=E5=8F=91=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liujiaxing19 Change-Id: I56a35906bda91e8e8dbbbcf1097af280dd2ad72f --- .../include/hiappevent/hiappevent.h | 237 ++++++++++++++++++ 1 file changed, 237 insertions(+) diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h index 26a001799..a159aae9b 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h @@ -87,6 +87,30 @@ extern "C" { #endif +/** + * @brief Defines error code + * + * @since 16 + */ +typedef enum { + /** @error The operation is successful. */ + HIAPPEVENT_SUCCESS = 0, + /** @error Invalid param value length */ + HIAPPEVENT_INVALID_PARAM_VALUE_LENGTH = 4, + /** @error Processor is null */ + HIAPPEVENT_PROCESSOR_IS_NULL = -7, + /** @error Processor not found */ + HIAPPEVENT_PROCESSOR_NOT_FOUND = -8, + /** @error Invalid param value */ + HIAPPEVENT_INVALID_PARAM_VALUE = -9, + /** @error event config is null */ + HIAPPEVENT_EVENT_CONFIG_IS_NULL = -10, + /** @error Operate failed */ + HIAPPEVENT_OPERATE_FAILED = -100, + /** @error Invalid uid */ + HIAPPEVENT_INVALID_UID = -200 +} HiAppEvent_ErrorCode; + /** * @brief Event types. * @@ -164,6 +188,20 @@ typedef struct ParamListNode* ParamList; */ typedef struct HiAppEvent_Watcher HiAppEvent_Watcher; +/** + * @brief The HiAppEvent_Processor structure is designed for event report. + * + * @since 16 + */ +typedef struct HiAppEvent_Processor HiAppEvent_Processor; + +/** + * @brief The HiAppEvent_Config structure is designed for configuration. + * + * @since 16 + */ +typedef struct HiAppEvent_Config HiAppEvent_Config; + /** * @brief The OH_HiAppEvent_OnReceive function acts as the callback function for the HiAppEvent_Watcher. It is called * when an event occurs. @@ -610,6 +648,205 @@ int OH_HiAppEvent_RemoveWatcher(HiAppEvent_Watcher* watcher); * @version 1.0 */ void OH_HiAppEvent_ClearData(); + +/** + * @brief Create a HiAppEvent_Processor handler pointer to set the property. + * + * @param name The name of the processor. + * @return Returns a pointer to the HiAppEvent_Processor instance. + * @since 16 + */ +HiAppEvent_Processor* OH_HiAppEvent_CreateProcessor(const char* name); + +/** + * @brief The interface to set route for processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @param appId The appid of the processor. + * @param routeInfo The server location information. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_PROCESSOR_IS_NULL} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE_LENGTH} Invalid param value length. + * @since 16 + */ +int OH_HiAppEvent_SetReportRoute(HiAppEvent_Processor* processor, const char* appId, const char* routeInfo); + +/** + * @brief The interface to set policy for processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @param periodReport The time interval to report. + * @param batchReport The threthold to report. + * @param onStartReport The strategy to report. + * @param onBackgroundReport The strategy to report. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_PROCESSOR_IS_NULL} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * @since 16 + */ +int OH_HiAppEvent_SetReportPolicy(HiAppEvent_Processor* processor, int periodReport, int batchReport, + bool onStartReport, bool onBackgroundReport); + +/** + * @brief The interface to set report event for processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @param domain The event domain to report. + * @param name The event name to report. + * @param isRealTime The strategy to report. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_PROCESSOR_IS_NULL} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * @since 16 + */ +int OH_HiAppEvent_SetReportEvent(HiAppEvent_Processor* processor, const char* domain, const char* name, + bool isRealTime); + +/** + * @brief The interface to set config for processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @param key The custom key of processor. + * @param value The custom value of processor. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_PROCESSOR_IS_NULL} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE_LENGTH} Invalid param value length. + * @since 16 + */ +int OH_HiAppEvent_SetCustomConfig(HiAppEvent_Processor* processor, const char* key, const char* value); + +/** + * @brief The interface to set configId for processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @param configId The configId of processor. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_INVALID_PROCESSOR} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * @since 16 + */ +int OH_HiAppEvent_SetConfigId(HiAppEvent_Processor* processor, int configId); + +/** + * @brief The interface to set user info for processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @param userIdNames The userIdNames of processor. + * @param size The size of userIdNames array. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_INVALID_PROCESSOR} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE_LENGTH} Invalid param value length. + * @since 16 + */ +int OH_HiAppEvent_SetReportUserId(HiAppEvent_Processor* processor, const char* const * userIdNames, int size); + +/** + * @brief The interface to set user property for processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @param userPropertyNames The userPropertyNames of processor. + * @param size The size of userPropertyNames array. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_INVALID_PROCESSOR} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE_LENGTH} Invalid param value length. + * @since 16 + */ +int OH_HiAppEvent_SetReportUserProperty(HiAppEvent_Processor* processor, const char* const * userPropertyNames, + int size); + +/** + * @brief The interface to add processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @return process id if set is successful. + * {@link HIAPPEVENT_INVALID_PROCESSOR} The processor is nullptr. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. + * {@link HIAPPEVENT_OPERATE_FAILED} Name not found or register processor error. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * @since 16 + */ +int64_t OH_HiAppEvent_AddProcessor(HiAppEvent_Processor* processor); + +/** + * @brief The interface to destroy processor. + * + * @param processor The pointer to the HiAppEvent_Processor instance. + * @since 16 + */ +void OH_HiAppEvent_DestoryProcessor(HiAppEvent_Processor* processor); + +/** + * @brief The interface to remove processor. + * + * @param processorId The id of the processor. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_PROCESSOR_NOT_FOUND} Processor not add. + * {@link HIAPPEVENT_OPERATE_FAILED} The operation is failed. + * {@link HIAPPEVENT_INVALID_UID} Invalid uid. + * @since 16 + */ +int OH_HiAppEvent_RemoveProcessor(int64_t processorId); + +/** + * @brief Create a HiAppEvent_Config handler pointer to set the config. + * + * @return Returns a pointer to the HiAppEvent_Config instance. + * @since 16 + */ +HiAppEvent_Config* OH_HiAppEvent_CreateConfig(); + +/** + * @brief Destroy the specified HiAppEvent_Config handle resource. + * + * @param config The pointer to the HiAppEvent_Config instance. + * @since 16 + */ +void OH_HiAppEvent_DestroyConfig(HiAppEvent_Config* config); + +/** + * @brief The interface to set item to the config. + * + * @param config The pointer to the HiAppEvent_Config instance. + * @param itemName The name of config item. + * @param itemValue The value of config item. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_EVENT_CONFIG_IS_NULL} The event config is null. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} The item is invalid. + * @since 16 + */ +int OH_HiAppEvent_SetConfigItem(HiAppEvent_Config* config, const char* itemName, const char* itemValue); + +/** + * @brief The interface to set the config. + * + * @param name The name of the os event. + * @param config The pointer to the HiAppEvent_Config instance. + * @return set result. + * {@link HIAPPEVENT_SUCCESS} The operation is successful. + * {@link HIAPPEVENT_INVALID_PARAM_VALUE} The config is invalid. + * @since 16 + */ +int OH_HiAppEvent_SetEventConfig(const char* name, HiAppEvent_Config* config); #ifdef __cplusplus } #endif -- Gitee From 0229c8a998443e51bf1bdfc079428289cd287e33 Mon Sep 17 00:00:00 2001 From: "DESKTOP-H8KLN8I\\lisitao" Date: Mon, 23 Dec 2024 15:55:18 +0800 Subject: [PATCH 566/620] =?UTF-8?q?[L]=20capi=E6=8C=89=E9=94=AE=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=94=AF=E6=8C=81=E6=8B=A6=E6=88=AA=E5=92=8C=E5=88=86?= =?UTF-8?q?=E5=8F=91=20Signed-off-by:lisitaolisitao3@huawei.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: DESKTOP-H8KLN8I\lisitao --- arkui/ace_engine/native/libace.ndk.json | 4 ++++ arkui/ace_engine/native/native_key_event.h | 9 +++++++++ arkui/ace_engine/native/native_node.h | 12 ++++++++++++ 3 files changed, 25 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index ca090d8b7..5d8b8a8aa 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2503,6 +2503,10 @@ "first_introduced": "15", "name": "OH_ArkUI_FocusAxisEvent_SetStopPropagation" }, + { + "first_introduced": "16", + "name": "OH_ArkUI_KeyEvent_Dispatch" + }, { "first_introduced": "16", "name": "OH_ArkUI_ProgressLinearStyleOption_Create" diff --git a/arkui/ace_engine/native/native_key_event.h b/arkui/ace_engine/native/native_key_event.h index c9c2c4fb1..2aa2fe849 100644 --- a/arkui/ace_engine/native/native_key_event.h +++ b/arkui/ace_engine/native/native_key_event.h @@ -491,6 +491,15 @@ uint32_t OH_ArkUI_KeyEvent_GetUnicode(const ArkUI_UIInputEvent* event); * @since 14 */ void OH_ArkUI_KeyEvent_SetConsumed(const ArkUI_UIInputEvent* event, bool isConsumed); + +/** + * @brief Dispatch key event to a specific component node. + * + * @param node Indicates the pointer to a component node. + * @param event Pointer to an ArkUI_UIInputEvent object. + * @since 16 + */ +void OH_ArkUI_KeyEvent_Dispatch(ArkUI_NodeHandle node, const ArkUI_UIInputEvent* event); #ifdef __cplusplus }; #endif diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index e008614e1..4bac35463 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -5827,6 +5827,18 @@ typedef enum { */ NODE_ON_FOCUS_AXIS = 23, + /** + * @brief Dispatch key event on the component node. + * + * When the component node receives a key event, this callback will be triggered instead of dispatching event to its + * children. \n + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * + * @since 16 + */ + NODE_DISPATCH_KEY_EVENT = 24, + /** * @brief Triggers onDetectResultUpdate callback * when the text is set to TextDataDetectorConfig and recognized successfully. -- Gitee From b547223630c0eb593c0830a0f4fcb777cf86e7a5 Mon Sep 17 00:00:00 2001 From: wangxiuxiu96 Date: Fri, 29 Nov 2024 16:41:51 +0800 Subject: [PATCH 567/620] =?UTF-8?q?C-API=E6=94=AF=E6=8C=81=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B8=8B=E4=B8=80=E5=B8=A7=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangxiuxiu96 Change-Id: If6d345808c11ce1efbc946ec9081651bb63c6501 --- arkui/ace_engine/native/libace.ndk.json | 4 ++++ arkui/ace_engine/native/native_node_napi.h | 19 +++++++++++++++++++ arkui/ace_engine/native/native_type.h | 15 +++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index ca090d8b7..44a9f81ca 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2546,5 +2546,9 @@ { "first_introduced": "16", "name": "OH_ArkUI_NodeEvent_GetTextChangeEvent" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_PostFrameCallback" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node_napi.h b/arkui/ace_engine/native/native_node_napi.h index ade5e7edf..bba66d373 100644 --- a/arkui/ace_engine/native/native_node_napi.h +++ b/arkui/ace_engine/native/native_node_napi.h @@ -355,6 +355,25 @@ ArkUI_ErrorCode OH_ArkUI_GetRouterPageState(ArkUI_NodeHandle node, ArkUI_RouterP ArkUI_ErrorCode OH_ArkUI_GetRouterPageId( ArkUI_NodeHandle node, char* buffer, int32_t bufferSize, int32_t* writeLength); +/** + * @brief Register a callback to be executed when rendering in the next frame. Cannot be called on + * the non-UI thread. Checking for non-UI thread calls will abort. + * + * @param uiContext ArkUI_ContextHandle. + * @param userData Indicates the custom data to be saved. + * @param callback Custom callback function. + * @param nanoTimestamp Timestamp of frame signal. + * @param frameCount Frame count. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_CAPI_INIT_ERROR} if the CAPI init error. + * Returns {@link ARKUI_ERROR_CODE_UI_CONTEXT_INVALID} if the uiContext is invalid. + * Returns {@link ARKUI_ERROR_CODE_CALLBACK_INVALID} if the callback function is invalid. + * @since 16 + */ +int32_t OH_ArkUI_PostFrameCallback(ArkUI_ContextHandle uiContext, void* userData, + void (*callback)(uint64_t nanoTimestamp, uint32_t frameCount, void* userData)); + #ifdef __cplusplus }; #endif diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 08542a381..252a2c457 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -1926,6 +1926,11 @@ typedef enum { ARKUI_ERROR_CODE_NO_ERROR = 0, /** @error Parameter error. */ ARKUI_ERROR_CODE_PARAM_INVALID = 401, + /** + * @error CAPI init error. + * @since 16 + */ + ARKUI_ERROR_CODE_CAPI_INIT_ERROR = 500, /** @error The component does not support specific properties or events. */ ARKUI_ERROR_CODE_ATTRIBUTE_OR_EVENT_NOT_SUPPORTED = 106102, /** @error The corresponding operation does not support nodes created by ArkTS. */ @@ -1957,6 +1962,16 @@ typedef enum { * @since 14 */ ARKUI_ERROR_CODE_INVALID_STYLED_STRING = 180101, + /** + * @error The uiContext is invalid. + * @since 16 + */ + ARKUI_ERROR_CODE_UI_CONTEXT_INVALID = 190001, + /** + * @error The callback function is invalid. + * @since 16 + */ + ARKUI_ERROR_CODE_CALLBACK_INVALID = 190002, } ArkUI_ErrorCode; /** -- Gitee From 88e592f8c9e75120283c1cfc3c81ebd6edae7d6f Mon Sep 17 00:00:00 2001 From: zoulinken Date: Mon, 23 Dec 2024 20:15:02 +0800 Subject: [PATCH 568/620] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zoulinken --- arkui/ace_engine/native/native_node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index e008614e1..f6e7ea1cd 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -7966,7 +7966,7 @@ int32_t OH_ArkUI_NodeUtils_GetCustomProperty(ArkUI_NodeHandle node, const char* ArkUI_NodeHandle OH_ArkUI_NodeUtils_GetParentInPageTree(ArkUI_NodeHandle node); /** - * @brief Retrieve all active child nodes of a node. Span and ImageSpan will not be counted in the children. + * @brief Retrieve all active child nodes of a node. Span will not be counted in the children. * * @param head Pass in the node that needs to be obtained. * @param handle The structure corresponding to the sub node information of the head node. -- Gitee From 6a24dac07c110acbdc8392bd6d8577da64ca96b7 Mon Sep 17 00:00:00 2001 From: l00844999 Date: Mon, 23 Dec 2024 22:07:22 +0800 Subject: [PATCH 569/620] drawing errcode Signed-off-by: l00844999 --- graphic/graphic_2d/native_drawing/drawing_error_code.h | 8 ++++++++ .../graphic_2d/native_drawing/libnative_drawing.ndk.json | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_error_code.h b/graphic/graphic_2d/native_drawing/drawing_error_code.h index 38e135e3b..7b0503528 100644 --- a/graphic/graphic_2d/native_drawing/drawing_error_code.h +++ b/graphic/graphic_2d/native_drawing/drawing_error_code.h @@ -82,6 +82,14 @@ typedef enum { */ OH_Drawing_ErrorCode OH_Drawing_ErrorCodeGet(); +/** + * @brief Resets the error code of the drawing module to OH_DRAWING_SUCCESS. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @since 16 + * @version 1.0 + */ +void OH_Drawing_ErrorCodeReset(); #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index c33c60140..a4cd9973f 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -164,6 +164,10 @@ "first_introduced": "12", "name": "OH_Drawing_ErrorCodeGet" }, + { + "first_introduced": "16", + "name": "OH_Drawing_ErrorCodeReset" + }, { "name": "OH_Drawing_FilterCreate" }, { "name": "OH_Drawing_FilterSetColorFilter" }, { -- Gitee From f70a3e615d896db6fe1c3a7ab1063b0d8ca596d2 Mon Sep 17 00:00:00 2001 From: peng Date: Mon, 23 Dec 2024 14:20:55 +0000 Subject: [PATCH 570/620] modify comment Signed-off-by: peng --- multimedia/av_codec/native_avmuxer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avmuxer.h b/multimedia/av_codec/native_avmuxer.h index 8cd87e5dc..361bf3193 100644 --- a/multimedia/av_codec/native_avmuxer.h +++ b/multimedia/av_codec/native_avmuxer.h @@ -83,7 +83,7 @@ OH_AVErrCode OH_AVMuxer_SetRotation(OH_AVMuxer *muxer, int32_t rotation); * @param format OH_AVFormat handle pointer contain format * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode} - * {@link AV_ERR_INVALID_VAL}, the muxer or format invalid. + * {@link AV_ERR_INVALID_VAL}, the muxer or format is invalid. * @since 14 */ OH_AVErrCode OH_AVMuxer_SetFormat(OH_AVMuxer *muxer, OH_AVFormat *format); -- Gitee From bfc70587b018edde4f8b97a46cd41701ac6acfe1 Mon Sep 17 00:00:00 2001 From: peng Date: Tue, 24 Dec 2024 02:14:23 +0000 Subject: [PATCH 571/620] add space line Signed-off-by: peng --- multimedia/av_codec/native_avmuxer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/multimedia/av_codec/native_avmuxer.h b/multimedia/av_codec/native_avmuxer.h index 361bf3193..553bdae56 100644 --- a/multimedia/av_codec/native_avmuxer.h +++ b/multimedia/av_codec/native_avmuxer.h @@ -78,6 +78,7 @@ OH_AVErrCode OH_AVMuxer_SetRotation(OH_AVMuxer *muxer, int32_t rotation); /** * @brief Set format to the muxer. + * * @syscap SystemCapability.Multimedia.Media.Muxer * @param muxer Pointer to an OH_AVMuxer instance * @param format OH_AVFormat handle pointer contain format -- Gitee From 20022d74e62a228e24b47ee79b30857592f4512f Mon Sep 17 00:00:00 2001 From: j00466033 Date: Tue, 24 Dec 2024 10:45:31 +0800 Subject: [PATCH 572/620] jd-ndk-api16 Signed-off-by: j00466033 --- web/webview/interfaces/native/arkweb_interface.h | 2 +- web/webview/interfaces/native/arkweb_type.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/web/webview/interfaces/native/arkweb_interface.h b/web/webview/interfaces/native/arkweb_interface.h index 03f9f612b..2b1045249 100644 --- a/web/webview/interfaces/native/arkweb_interface.h +++ b/web/webview/interfaces/native/arkweb_interface.h @@ -68,7 +68,7 @@ typedef enum { /** * @brief API type related to ArkWeb JavaScript value. * - * @since 14 + * @since 16 */ ARKWEB_NATIVE_JAVASCRIPT_VALUE, } ArkWeb_NativeAPIVariantKind; diff --git a/web/webview/interfaces/native/arkweb_type.h b/web/webview/interfaces/native/arkweb_type.h index 206d6b5d1..b0cdabe2e 100644 --- a/web/webview/interfaces/native/arkweb_type.h +++ b/web/webview/interfaces/native/arkweb_type.h @@ -71,7 +71,7 @@ typedef enum ArkWeb_WebMessageType { /** * @brief Defines the data type carried in a ArkWeb_JavaScriptValue. * - * @since 14 + * @since 16 */ typedef enum ArkWeb_JavaScriptValueType { /** Represent error data */ @@ -92,7 +92,7 @@ typedef struct ArkWeb_WebMessage* ArkWeb_WebMessagePtr; /** * @brief Defines the ArkWeb_JavaScriptValuePtr. * - * @since 14 + * @since 16 */ typedef struct ArkWeb_JavaScriptValue* ArkWeb_JavaScriptValuePtr; @@ -120,7 +120,7 @@ typedef void (*ArkWeb_OnJavaScriptProxyCallback)( * @param arraySize The number of elements in the array. * @param userData The data set by user. * - * @since 14 + * @since 16 */ typedef ArkWeb_JavaScriptValuePtr (*ArkWeb_OnJavaScriptProxyCallbackWithResult)( const char* webTag, const ArkWeb_JavaScriptBridgeData* dataArray, size_t arraySize, void* userData); @@ -185,7 +185,7 @@ typedef struct { /** * @brief Defines the JavaScript proxy method with a return value. * - * @since 14 + * @since 16 */ typedef struct { /** The method of the application side JavaScript object participating in the registration. */ @@ -213,7 +213,7 @@ typedef struct { /** * @brief Defines the JavaScript proxy registered object with methodList that has a return value. * - * @since 14 + * @since 16 */ typedef struct { /** The name of the registered object. */ @@ -294,7 +294,7 @@ typedef struct { * @param permission The JSON string, which defaults to null, is used to configure the permission control for * JSBridge, allowing for the definition of URL whitelists at the object and method levels. * - * @since 14 + * @since 16 */ void (*registerJavaScriptProxyEx)(const char* webTag, const ArkWeb_ProxyObjectWithResult* proxyObject, const char* permission); @@ -307,7 +307,7 @@ typedef struct { * @param permission The JSON string, which defaults to null, is used to configure the permission control * for JSBridge, allowing for the definition of URL whitelists at the object and method levels. * - * @since 14 + * @since 16 */ void (*registerAsyncJavaScriptProxyEx)(const char* webTag, const ArkWeb_ProxyObject* proxyObject, const char* permission); @@ -502,7 +502,7 @@ typedef struct { * whether the function structure has a corresponding function pointer to avoid crash * caused by mismatch between the SDK and the device ROM. * - * @since 14 + * @since 16 */ typedef struct { /** The ArkWeb_JavaScriptValueAPI struct size. */ -- Gitee From df78a27a42fd229b101360c19e4df64c72f6793d Mon Sep 17 00:00:00 2001 From: lwx1281857 Date: Tue, 24 Dec 2024 10:51:18 +0800 Subject: [PATCH 573/620] Description: Code optimization Feature or Bugfix: Bugfix Binary Source:No Signed-off-by: lwx1281857 --- startup/init/syscap/include/syscap_ndk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/startup/init/syscap/include/syscap_ndk.h b/startup/init/syscap/include/syscap_ndk.h index 590e70eab..a52f30603 100644 --- a/startup/init/syscap/include/syscap_ndk.h +++ b/startup/init/syscap/include/syscap_ndk.h @@ -23,7 +23,7 @@ */ /** - * @file deviceinfo.h + * @file syscap_ndk.h * @kit BasicServicesKit * @brief Declares APIs for acquiring the set of system capabilities . * @library NA -- Gitee From 1087ae44b2f6a83a6dbc158e60a29b32d6e2f240 Mon Sep 17 00:00:00 2001 From: peng Date: Tue, 24 Dec 2024 02:56:40 +0000 Subject: [PATCH 574/620] modify comment Signed-off-by: peng --- multimedia/av_codec/native_avcodec_base.h | 2 +- multimedia/av_codec/native_avmuxer.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 547268a0e..07e356e9d 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -978,7 +978,7 @@ extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE; extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR; /** - * @brief Key for creation timestamp of a media file, value type is int64_t. + * @brief Key for creation timestamp of a media file, value type is string. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 14 diff --git a/multimedia/av_codec/native_avmuxer.h b/multimedia/av_codec/native_avmuxer.h index 553bdae56..a2a3fb8e8 100644 --- a/multimedia/av_codec/native_avmuxer.h +++ b/multimedia/av_codec/native_avmuxer.h @@ -82,9 +82,9 @@ OH_AVErrCode OH_AVMuxer_SetRotation(OH_AVMuxer *muxer, int32_t rotation); * @syscap SystemCapability.Multimedia.Media.Muxer * @param muxer Pointer to an OH_AVMuxer instance * @param format OH_AVFormat handle pointer contain format - * @return Returns AV_ERR_OK if the execution is successful, - * otherwise returns a specific error code, refer to {@link OH_AVErrCode} - * {@link AV_ERR_INVALID_VAL}, the muxer or format is invalid. + * @return Returns AV_ERR_OK if the execution is successful + * {@link AV_ERR_INVALID_VAL}, the muxer or format is invalid + * {@link AV_ERR_OPERATE_NOT_PERMIT}, not permit to call the interface, it was called in invalid state * @since 14 */ OH_AVErrCode OH_AVMuxer_SetFormat(OH_AVMuxer *muxer, OH_AVFormat *format); -- Gitee From 804f7aab84a9896cafbf1af5838b844f96b582a7 Mon Sep 17 00:00:00 2001 From: peng Date: Tue, 24 Dec 2024 02:59:21 +0000 Subject: [PATCH 575/620] modify comment Signed-off-by: peng --- multimedia/av_codec/native_avmuxer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avmuxer.h b/multimedia/av_codec/native_avmuxer.h index a2a3fb8e8..559161b19 100644 --- a/multimedia/av_codec/native_avmuxer.h +++ b/multimedia/av_codec/native_avmuxer.h @@ -78,7 +78,7 @@ OH_AVErrCode OH_AVMuxer_SetRotation(OH_AVMuxer *muxer, int32_t rotation); /** * @brief Set format to the muxer. - * + * * @syscap SystemCapability.Multimedia.Media.Muxer * @param muxer Pointer to an OH_AVMuxer instance * @param format OH_AVFormat handle pointer contain format -- Gitee From 1530d10cf9fec3f741aa5864ff0ca4e94c7996be Mon Sep 17 00:00:00 2001 From: peng Date: Tue, 24 Dec 2024 03:39:41 +0000 Subject: [PATCH 576/620] modify comment Signed-off-by: peng --- multimedia/av_codec/native_avmuxer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multimedia/av_codec/native_avmuxer.h b/multimedia/av_codec/native_avmuxer.h index 559161b19..d2b5be3e4 100644 --- a/multimedia/av_codec/native_avmuxer.h +++ b/multimedia/av_codec/native_avmuxer.h @@ -78,13 +78,13 @@ OH_AVErrCode OH_AVMuxer_SetRotation(OH_AVMuxer *muxer, int32_t rotation); /** * @brief Set format to the muxer. - * + * * @syscap SystemCapability.Multimedia.Media.Muxer * @param muxer Pointer to an OH_AVMuxer instance * @param format OH_AVFormat handle pointer contain format * @return Returns AV_ERR_OK if the execution is successful - * {@link AV_ERR_INVALID_VAL}, the muxer or format is invalid - * {@link AV_ERR_OPERATE_NOT_PERMIT}, not permit to call the interface, it was called in invalid state + * {@link AV_ERR_INVALID_VAL}, the muxer or format is invalid + * {@link AV_ERR_OPERATE_NOT_PERMIT}, not permit to call the interface, it was called in invalid state * @since 14 */ OH_AVErrCode OH_AVMuxer_SetFormat(OH_AVMuxer *muxer, OH_AVFormat *format); -- Gitee From ab168934988a7978f28dc89d1a6200264d275479 Mon Sep 17 00:00:00 2001 From: zhangjinyu101 Date: Tue, 24 Dec 2024 13:32:30 +0800 Subject: [PATCH 577/620] =?UTF-8?q?SDK-C=E6=94=AF=E6=8C=81EdgeEffectOption?= =?UTF-8?q?s=E5=AF=B9=E8=B1=A1=E6=96=B0=E5=A2=9E=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangjinyu101 --- arkui/ace_engine/native/native_node.h | 5 +++++ arkui/ace_engine/native/native_type.h | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index f6e7ea1cd..52529f9c9 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -4416,12 +4416,17 @@ typedef enum { * .value[1]?.i32: whether to enable the scroll effect when the component content size is smaller than the * component itself. Optional. The value 1 means to enable the scroll effect, and 0 means the * opposite. The default value is 1. \n + * .value[2]?.i32: direction in which the effect takes effect. The parameter type is {@link ArkUI_EffectEdge}. + * The default value is ARKUI_EFFECT_EDGE_START | ARKUI_EFFECT_EDGE_END. This parameter is supported since + * API version 16. \n * \n * Format of the return value {@link ArkUI_AttributeItem}:\n * .value[0].i32: effect used at the edges of the component when the boundary of the scrollable content is reached. * The parameter type is {@link ArkUI_EdgeEffect}. \n * .value[1].i32: whether to enable the scroll effect when the component content size is smaller than the component * itself. Optional. The value 1 means to enable the scroll effect, and 0 means the opposite. \n + * .value[2].i32: edge for which the effect takes effect when the boundary of the scrollable content is reached. + * The parameter type is {@link ArkUI_EffectEdge}. This parameter is supported since API version 16. \n * */ NODE_SCROLL_EDGE_EFFECT, diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 08542a381..1e989e6ab 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -593,6 +593,18 @@ typedef enum { ARKUI_EDGE_EFFECT_NONE, } ArkUI_EdgeEffect; +/** + * @brief Enumerates the edges for which the effect takes effect when the boundary of the scrollable content is reached. + * + * @since 16 + */ +typedef enum { + /** Start edge. */ + ARKUI_EFFECT_EDGE_START = 1, + /** End edge. */ + ARKUI_EFFECT_EDGE_END = 2, +} ArkUI_EffectEdge; + /** * @brief Enumerates the scroll directions for the component. * -- Gitee From 7f7a81fcb4a4b52551abe6de35f42b993568e9bb Mon Sep 17 00:00:00 2001 From: wangxiuxiu Date: Wed, 18 Dec 2024 10:52:41 +0800 Subject: [PATCH 578/620] add mouse cancel Signed-off-by: wangxiuxiu --- arkui/ace_engine/native/native_interface_xcomponent.h | 4 ++++ arkui/ace_engine/native/ui_input_event.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/arkui/ace_engine/native/native_interface_xcomponent.h b/arkui/ace_engine/native/native_interface_xcomponent.h index c06d6cec6..4b1b3c77a 100644 --- a/arkui/ace_engine/native/native_interface_xcomponent.h +++ b/arkui/ace_engine/native/native_interface_xcomponent.h @@ -151,6 +151,10 @@ typedef enum { OH_NATIVEXCOMPONENT_MOUSE_PRESS, OH_NATIVEXCOMPONENT_MOUSE_RELEASE, OH_NATIVEXCOMPONENT_MOUSE_MOVE, + /** Triggered when the mouse event is canceled. + * @since 16 + */ + OH_NATIVEXCOMPONENT_MOUSE_CANCEL, } OH_NativeXComponent_MouseEventAction; /** diff --git a/arkui/ace_engine/native/ui_input_event.h b/arkui/ace_engine/native/ui_input_event.h index 85a377f12..0cea62d8e 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -158,6 +158,10 @@ enum { UI_MOUSE_EVENT_ACTION_RELEASE = 2, /** Move. */ UI_MOUSE_EVENT_ACTION_MOVE = 3, + /** Cancel. + * @since 16 + */ + UI_MOUSE_EVENT_ACTION_CANCEL = 13, }; /** -- Gitee From 3c9dd5b0e3e07495a2b5c6832b76b15203d5ab18 Mon Sep 17 00:00:00 2001 From: shilei Date: Wed, 18 Dec 2024 22:29:57 +0800 Subject: [PATCH 579/620] modify napi interface notation Signed-off-by: shilei Change-Id: I82fb77c0f7c68aef83d8467dd0a135de30ebae6e --- arkui/napi/common.h | 2 +- arkui/napi/native_api.h | 937 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 918 insertions(+), 21 deletions(-) diff --git a/arkui/napi/common.h b/arkui/napi/common.h index 6e8ac4aa0..50f8ee327 100644 --- a/arkui/napi/common.h +++ b/arkui/napi/common.h @@ -89,5 +89,5 @@ typedef enum { napi_priority_idle = 3, } napi_task_priority; +/** @} */ #endif /* FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H */ -/** @} */ \ No newline at end of file diff --git a/arkui/napi/native_api.h b/arkui/napi/native_api.h index b05497312..69d1cd7c3 100644 --- a/arkui/napi/native_api.h +++ b/arkui/napi/native_api.h @@ -94,7 +94,7 @@ extern "C" { /** * @brief Native detach callback of napi_coerce_to_native_binding_object that can be used to - * detach the js object and the native object. + * detach the ArkTS object and the native object. * * @since 11 */ @@ -102,7 +102,7 @@ typedef void* (*napi_native_binding_detach_callback)(napi_env env, void* native_ /** * @brief Native attach callback of napi_coerce_to_native_binding_object that can be used to - * bind the js object and the native object. + * bind the ArkTS object and the native object. * * @since 11 */ @@ -277,7 +277,7 @@ NAPI_EXTERN napi_status node_api_get_module_file_name(napi_env env, const char** result); /** - * @brief Create JSObject with initial properties given by descriptors, note that property key must be String, and + * @brief Create ArkTS Object with initial properties given by descriptors, note that property key must be String, and * must can not convert to element_index, also all keys must not duplicate. * * @param env Current running virtual machine context. @@ -294,8 +294,8 @@ NAPI_EXTERN napi_status napi_create_object_with_properties(napi_env env, const napi_property_descriptor* properties); /** - * @brief Create JSObject with initial properties given by keys and values, note that property key must be String, and - * must can not convert to element_index, also all keys must not duplicate. + * @brief Create ArkTS Object with initial properties given by keys and values, note that property key must be String, + * and must can not convert to element_index, also all keys must not duplicate. * * @param env Current running virtual machine context. * @param result The absolute path of the location of the loaded addon. @@ -313,12 +313,12 @@ NAPI_EXTERN napi_status napi_create_object_with_named_properties(napi_env env, const napi_value* values); /** - * @brief This API sets native properties to a object and converts this js object to native binding object. + * @brief This API sets native properties to a object and converts this ArkTS object to native binding object. * * @param env Current running virtual machine context. * @param js_object The JavaScript value to coerce. - * @param detach_cb Native callback that can be used to detach the js object and the native object. - * @param attach_cb Native callback that can be used to bind the js object and the native object. + * @param detach_cb Native callback that can be used to detach the ArkTS object and the native object. + * @param attach_cb Native callback that can be used to bind the ArkTS object and the native object. * @param native_object User-provided native instance to pass to thr detach callback and attach callback. * @param hint Optional hint to pass to the detach callback and attach callback. * @@ -604,13 +604,13 @@ NAPI_EXTERN napi_status napi_run_event_loop(napi_env env, NAPI_EXTERN napi_status napi_stop_event_loop(napi_env env); /** - * @brief Serialize a JS object. + * @brief Serialize a ArkTS object. * * @param env Current running virtual machine context. - * @param object The JavaScript value to serialize. + * @param object The ArkTS object to serialize. * @param transfer_list List of data to transfer in transfer mode. * @param clone_list List of Sendable data to transfer in clone mode. - * @param result Serialization result of the JS object. + * @param result Serialization result of the ArkTS object. * * @return Returns the function execution status. * @since 12 @@ -678,8 +678,8 @@ NAPI_EXTERN napi_status napi_fatal_exception(napi_env env, napi_value err); /** - * @brief Allows a JS function to be called in the asynchronous context. The capabilities related to 'async_hook' are - * not supported currently. + * @brief Allows a ArkTS function to be called in the asynchronous context. The capabilities related to 'async_hook' + * are not supported currently. * @param env Current running virtual machine context. * @param async_context The context environment for the async operation. * @param recv The 'this' pointer of the function. @@ -700,13 +700,16 @@ NAPI_EXTERN napi_status napi_make_callback(napi_env env, napi_value* result); /** - * @brief Creates a ArkTS buffer of the specified size. - * @param env Current running virtual machine context. - * @param length The size of the buffer to be created. - * @param data Raw pointer of the ArkTS buffer. - * @param result Result returned by the ArkTS function. + * @brief Creates an ArkTS ArrayBuffer object of the specified size. * + * @param env Current running virtual machine context. + * @param length Bytes size of the underlying arraybuffer. + * @param data Raw pointer to the underlying arraybuffer. + * @param result Created ArkTS ArrayBuffer object. * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, data or result is nullptr, or length is larger than 2097152, + * or length is less than zero.\n * @since 10 */ NAPI_EXTERN napi_status napi_create_buffer(napi_env env, @@ -714,9 +717,903 @@ NAPI_EXTERN napi_status napi_create_buffer(napi_env env, void** data, napi_value* result); +/** + * @brief Creates a deferred object and an ArkTS promise. + * @param env Current running virtual machine context. + * @param deferred The created deferred object which will be passed to 'napi_resolve_deferred()' or + * 'napi_reject_deferred()' to resolve or reject the promise. + * @param promise The ArkTS promise which is associated with the deferred object. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, deferred or resolution is nullptr.\n + * {@link napi_pending_exception } If a ArkTS exception existed when the function was called.\n + * {@link napi_generic_failure } If create promise failed.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_create_promise(napi_env env, + napi_deferred* deferred, + napi_value* promise); + +/** + * @brief Resolves a promise by way of the deferred object associated. + * @param env Current running virtual machine context. + * @param deferred The deferred object which is utilized to resolve the promise. + * @param resolution The resolution value used to resolve the promise. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, deferred or resolution is nullptr.\n + * {@link napi_pending_exception } If a ArkTS exception existed when the function was called.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_resolve_deferred(napi_env env, + napi_deferred deferred, + napi_value resolution); + +/** + * @brief Rejects a promise by way of the deferred object associated. + * @param env Current running virtual machine context. + * @param deferred The deferred object which is utilized to reject the promise. + * @param rejection The rejection value used to reject the promise. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, deferred or rejection is nullptr.\n + * {@link napi_pending_exception } If a ArkTS exception existed when the function was called.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_reject_deferred(napi_env env, + napi_deferred deferred, + napi_value rejection); + +/** + * @brief Checks whether the given 'napi_value' is a promise object. + * @param env Current running virtual machine context. + * @param value The 'napi_value' to be checked. + * @param is_promise Boolean value that is set to true if the 'value' is a promise object, false otherwise. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, value or is_promise is nullptr.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_is_promise(napi_env env, + napi_value value, + bool* is_promise); + +/** + * @brief Obtains the current libuv loop instance. + * @param env Current running virtual machine context. + * @param loop Libuv event loop. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or loop is nullptr.\n + * {@link napi_generic_failure } If env is invalid.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_get_uv_event_loop(napi_env env, + struct uv_loop_s** loop); + +/** + * @brief Creates a thread-safe function. + * @param env Current running virtual machine context. + * @param func ArkTS function to be called. + * @param async_resource An optional Object associated with the async work that will be passed to possible + * 'async_hooks'. + * @param async_resource_name An ArkTS string to provide an identifier for the kind of resource that is being + * provided for diagnostic information exposed by the `async_hooks` interface. + * @param max_queue_size Maximum size of the event queue in the thread-safe function. + * @param initial_thread_count Initial thread count of the thread-safe function. + * @param thread_finalize_data Data passed to the finalize callback. + * @param thread_finalize_cb Finalize callback function which will be triggered when the thread-safe function is + * released. + * @param context Optional data is passed to 'call_js_cb'. + * @param call_js_cb Callback function which will be triggered after 'napi_call_threadsafe_function()' is called. + * @param result The created thread-safe function. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, async_resource_name or result is nullptr; max_queue_size is less than 0;\n + * initial_thread_count is greater than 128 or less than 0; func and call_js_cb are\n + * nullptr at same time.\n + * {@link napi_generic_failure } If create thread-safe function failed.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_create_threadsafe_function(napi_env env, + napi_value func, + napi_value async_resource, + napi_value async_resource_name, + size_t max_queue_size, + size_t initial_thread_count, + void* thread_finalize_data, + napi_finalize thread_finalize_cb, + void* context, + napi_threadsafe_function_call_js call_js_cb, + napi_threadsafe_function* result); + +/** + * @brief Obtains the context of a thread-safe function. + * @param func The created thread-safe function. + * @param result Pointer pointer to the context of the thread-safe function. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If func or result is nullptr.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_get_threadsafe_function_context(napi_threadsafe_function func, + void** result); + +/** + * @brief Calls a thread-safe function. + * @param func The created thread-safe function. + * @param data Data passed to the callback function 'call_js_cb' which is registered by calling + * 'napi_create_threadsafe_function()'. + * @param is_blocking If true, this function blocks until the event queue is not full. If false, return directly. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If func is nullptr.\n + * {@link napi_queue_full } If event queue is full.\n + * {@link napi_closing } If the thread-safe function is closing.\n + * {@link napi_generic_failure } If call thread-safe function failed.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_call_threadsafe_function(napi_threadsafe_function func, + void* data, + napi_threadsafe_function_call_mode is_blocking); + +/** + * @brief Acquires a thread-safe function. + * @param func The created thread-safe function. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If func is nullptr.\n + * {@link napi_generic_failure } If acquire thread-safe function failed.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_acquire_threadsafe_function(napi_threadsafe_function func); + +/** + * @brief Releases a thread-safe function. + * @param func The created thread-safe function. + * @param mode Value of mode can be either 'napi_tsfn_release' to indicate that no more calls should be made + * to the thread-safe function from current thread or 'napi_tsfn_abort' to indicate that the queue + * of the thread-safe function will be closed and 'napi_closing' will be return when calling + * 'napi_call_threadsafe_function()' under the circumstance. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If func is nullptr.\n + * {@link napi_generic_failure } If release thread-safe function failed.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_release_threadsafe_function(napi_threadsafe_function func, + napi_threadsafe_function_release_mode mode); + +/** + * @brief Indicates that the event loop running on the main thread may exit before the thread-safe function + * is destroyed. + * @param env Current running virtual machine context. + * @param func The created thread-safe function. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or func is nullptr.\n + * {@link napi_generic_failure } If unref thread-safe function failed.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_unref_threadsafe_function(napi_env env, + napi_threadsafe_function func); + +/** + * @brief Indicates that the event loop running on the main thread should not exit until the thread-safe + * function is destroyed. + * @param env Current running virtual machine context. + * @param func The created thread-safe function. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or func is nullptr.\n + * {@link napi_generic_failure } If ref thread-safe function failed.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_ref_threadsafe_function(napi_env env, + napi_threadsafe_function func); + +/** + * @brief Creates an ArkTS 'Date' object from C double data + * @param env Current running virtual machine context. + * @param time ArkTS time value in milliseconds format since 01 January, 1970 UTC. + * @param result Created ArkTS data object. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or result is nullptr.\n + * {@link napi_pending_exception } If a ArkTS exception existed when the function was called.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_create_date(napi_env env, + double time, + napi_value* result); + +/** + * @brief Checks whether the given ArkTS value is a 'Date' object. You can use this API to check the type + * of the parameter passed from ArkTS. + * @param env Current running virtual machine context. + * @param value ArkTS data object. + * @param is_date Boolean value that is set to true if the 'value' is a 'Date' object, false otherwise. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, value or is_date is nullptr.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_is_date(napi_env env, + napi_value value, + bool* is_date); + +/** + * @brief Obtains the C equivalent of the given ArkTS 'Date' object. + * + * @param env Current running virtual machine context. + * @param value ArkTS data object. + * @param result C time value in milliseconds format since 01 January, 1970 UTC. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, value or result is nullptr.\n + * {@link napi_pending_exception } If a ArkTS exception existed when the function was called.\n + * {@link napi_date_expected } If the 'value' is not a 'Date' object.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_get_date_value(napi_env env, + napi_value value, + double* result); + +/** + * @brief Creates a ArkTS BigInt from C int64 data. + * + * @param env Current running virtual machine context. + * @param value C int64 data. + * @param result Created ArkTS BigInt object from C int64 data. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or result is nullptr.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_create_bigint_int64(napi_env env, + int64_t value, + napi_value* result); + +/** + * @brief Creates a ArkTS BigInt from C int64 data. + * + * @param env Current running virtual machine context. + * @param value C int64 data. + * @param result Created ArkTS BigInt object from C int64 data. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or result is nullptr.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_create_bigint_uint64(napi_env env, + uint64_t value, + napi_value* result); + +/** + * @brief Creates a single ArkTS BigInt from a C uint64 array. + * + * @param env Current running virtual machine context. + * @param sign_bit Sign bit of the BigInt. If sign_bit is 0, the BigInt is positive, otherwise it is negative. + * @param word_count The size of the words array. + * @param words C uint64 array in little-endian 64-bit format. + * @param result Created ArkTS BigInt object from C int64 array. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, words or result is nullptr or word_count is larger than 2147483647.\n + * {@link napi_pending_exception } If a ArkTS exception existed when the function was called.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_create_bigint_words(napi_env env, + int sign_bit, + size_t word_count, + const uint64_t* words, + napi_value* result); + +/** + * @brief Obtains a signed 64-bit integer from an ArkTS BigInt object. + * + * @param env Current running virtual machine context. + * @param value ArkTS BigInt object. + * @param result Pointer points to the location where store the C signed 64-bit integer value. + * @param lossless Indicates whether the conversion is lossless. If lossless is true, the conversion is lossless, + * false otherwise. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, value, result or lossless is nullptr or word_count is larger than\n + * 2147483647.\n + * {@link napi_bigint_expected } If the 'value' is not an ArkTS bigint object.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_get_value_bigint_int64(napi_env env, + napi_value value, + int64_t* result, + bool* lossless); + +/** + * @brief Obtains an unsigned 64-bit integer from an ArkTS BigInt object. + * + * @param env Current running virtual machine context. + * @param value ArkTS BigInt object. + * @param result Pointer points to the location where store the C unsigned 64-bit integer value. + * @param lossless Indicates whether the conversion is lossless. If lossless is true, the conversion is lossless, + * false otherwise. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, value, result or lossless is nullptr or word_count is larger than\n + * 2147483647.\n + * {@link napi_bigint_expected } If the 'value' is not an ArkTS bigint object.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_get_value_bigint_uint64(napi_env env, + napi_value value, + uint64_t* result, + bool* lossless); + +/** + * @brief Obtains the underlying 64-bit unsigned (uint64) byte data from an ArkTS BigInt object. + * + * @param env Current running virtual machine context. + * @param value ArkTS BigInt object. + * @param sign_bit Sign bit of the BigInt. If sign_bit is 0, the BigInt is positive, otherwise it is negative. + * @param word_count The size of the words array. + * @param words C uint64 array in little-endian 64-bit format. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, value or word_count is nullptr or word_count is larger than 2147483647.\n + * {@link napi_bigint_expected } If the 'value' is not an ArkTS bigint object.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_get_value_bigint_words(napi_env env, + napi_value value, + int* sign_bit, + size_t* word_count, + uint64_t* words); + +/** + * @brief Creates an ArkTS ArrayBuffer object of the specified size and initializes it with the given data. + * + * @param env Current running virtual machine context.n + * @param length Bytes size of the given data. + * @param data Given data. + * @param finalize_cb Optional native callback that can be used to free the given data when the ArkTS ArrayBuffer + * object has been garbage-collected. + * @param finalize_hint Optional contextual hint that is passed to the finalize callback. + * @param result Created ArkTS ArrayBuffer object. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, data or result is nullptr, or length is larger than 2097152, + * or length is less than or equal to zero.\n + * {@link napi_pending_exception } If a ArkTS exception existed when the function was called.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_create_external_buffer(napi_env env, + size_t length, + void* data, + napi_finalize finalize_cb, + void* finalize_hint, + napi_value* result); + +/** + * @brief Creates an ArkTS ArrayBuffer object of the specified size and initializes it with the given data. + * + * @param env Current running virtual machine context. + * @param length Bytes size of the given data. + * @param data Given data. + * @param result_data Raw pointer to the underlying arraybuffer. + * @param result Created ArkTS ArrayBuffer object. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, data or result is nullptr, or length is larger than 2097152, + * or length is less than or equal to zero.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_create_buffer_copy(napi_env env, + size_t length, + const void* data, + void** result_data, + napi_value* result); + +/** + * @brief Checks whether the given ArkTS value is a 'ArrayBuffer' object. + * + * @param env Current running virtual machine context. + * @param value ArkTS ArrayBuffer object. + * @param result Boolean value that is set to true if the 'value' is a 'ArrayBuffer' object, false otherwise. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, value or result is nullptr.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_is_buffer(napi_env env, + napi_value value, + bool* result); + +/** + * @brief Obtains the underlying data of 'ArrayBuffer' and its length. + * + * @param env Current running virtual machine context. + * @param value ArkTS ArrayBuffer object. + * @param data Raw pointer to the underlying arraybuffer. + * @param length Bytes size of the underlying arraybuffer. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, value or result is nullptr.\n + * {@link napi_arraybuffer_expected } If the 'value' is not an ArkTS array buffer object.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_get_buffer_info(napi_env env, + napi_value value, + void** data, + size_t* length); + +/** + * @brief Freezes an ArkTS object. Once an object is frozen, its properties are immutable. + * + * @param env Current running virtual machine context. + * @param object The given ArkTS object. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or object is nullptr.\n + * {@link napi_pending_exception } If a ArkTS exception existed when the function was called.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_object_freeze(napi_env env, + napi_value object); + +/** + * @brief Seals an ArkTS object. Once an object is sealed, its properties cannot be added or deleted, but property + * values can be modified. + * + * @param env Current running virtual machine context. + * @param object The given ArkTS object. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or object is nullptr.\n + * {@link napi_pending_exception } If a ArkTS exception existed when the function was called.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_object_seal(napi_env env, + napi_value object); + +/** + * @brief Detaches the underlying data from an 'ArrayBuffer' object. After the data is detached, you + * can operate the data in C/C++. + * + * @param env Current running virtual machine context. + * @param arraybuffer ArkTS ArrayBuffer object. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or arraybuffer is nullptr, if 'arraybuffer' is not an ArrayBuffer object.\n + * {@link napi_object_expected } If the 'arraybuffer' is not an ArkTS object.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_detach_arraybuffer(napi_env env, + napi_value arraybuffer); + +/** + * @brief Checks whether the given 'ArrayBuffer' has been detached. + * + * @param env Current running virtual machine context. + * @param value ArkTS ArrayBuffer object. + * @param result Boolean value that is set to true if the 'value' has been detached, false otherwise. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, value or result is nullptr.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_is_detached_arraybuffer(napi_env env, + napi_value value, + bool* result); + +/** + * @brief Obtains the names of all properties of an ArkTS object. + * + * @param env Current running virtual machine context. + * @param object ArkTS object. + * @param key_mode Key collection mode. If key_mode is napi_key_include_prototypes, the result includes properties on + * prototypes. If key_mode is napi_key_own_only, the result includes only properties directly on own + * object. + * @param key_filter Which properties to be collected. + * @param key_conversion Key conversion mode. If key_conversion is napi_key_keep_numbers, the numbered property keys + * will keep number type. If key_conversion is napi_key_numbers_to_strings, the numbered property + * keys will be convert to string type. + * @param result An array of ArkTS object that represent the property names of the object. + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, object or result is nullptr;\n + * key_mode is not enumeration value of napi_key_collection_mode;\n + * key_conversion is not enumeration value of napi_key_conversion.\n + * {@link napi_pending_exception } If a ArkTS exception existed when the function was called.\n + * {@link napi_object_expected } If object is not object type and function type.\n + * @since 10 + */ +NAPI_EXTERN napi_status napi_get_all_property_names(napi_env env, + napi_value object, + napi_key_collection_mode key_mode, + napi_key_filter key_filter, + napi_key_conversion key_conversion, + napi_value* result); + +/** + * @brief Registers a native module. + * + * @param mod Native module of type 'napi_module' to be registered. + * @since 10 +*/ +NAPI_EXTERN void napi_module_register(napi_module* mod); + +/** + * @brief Obtains the napi_extended_error_info struct, which contains the latest error information. + * + * @param env Current running virtual machine context. + * @param result The error info about the error. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or result is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_get_last_error_info(napi_env env, + const napi_extended_error_info** result); + +/** + * @brief Throws a ArkTS error. + * @param env Current running virtual machine context. + * @param error The ArkTS error to be thrown. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or error is nullptr, or error is not an error object.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_throw(napi_env env, napi_value error); + +/** + * @brief Throws a ArkTS Error with text information. + * @param env Current running virtual machine context. + * @param code Optional error code to set on the error. + * @param msg C string representing the text to be associated with the error. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or msg is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_throw_error(napi_env env, + const char* code, + const char* msg); + +/** + * @brief Throws a ArkTS TypeError with text information. + * @param env Current running virtual machine context. + * @param code Optional error code to set on the error. + * @param msg C string representing the text to be associated with the error. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or msg is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_throw_type_error(napi_env env, + const char* code, + const char* msg); + +/** + * @brief Throws a ArkTS RangeError with text information. + * @param env Current running virtual machine context. + * @param code Optional error code to set on the error. + * @param msg C string representing the text to be associated with the error. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or msg is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_throw_range_error(napi_env env, + const char* code, + const char* msg); + +/** + * @brief Checks whether a 'napi_value' is an error object. + * @param env Current running virtual machine context. + * @param value The value to check + * @param result Boolean value that is set to true if the value represents an error object, false otherwise. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, value or result is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_is_error(napi_env env, + napi_value value, + bool* result); + +/** + * @brief Creates a ArkTS Error with text information. + * @param env Current running virtual machine context. + * @param code Optional error code to set on the error. + * @param msg napi_value representing the EcmaScript string to be associated with the error. + * @param result napi_value representing the error created. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, msg or result is nullptr, code is not string and number type or msg is + * not a string type.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_create_error(napi_env env, + napi_value code, + napi_value msg, + napi_value* result); + +/** + * @brief Creates a ArkTS TypeError with text information. + * @param env Current running virtual machine context. + * @param code Optional error code to set on the error. + * @param msg napi_value representing the EcmaScript string to be associated with the error. + * @param result napi_value representing the error created. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, msg or result is nullptr, code is not string and number type or msg is + * not a string type.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_create_type_error(napi_env env, + napi_value code, + napi_value msg, + napi_value* result); + +/** + * @brief Creates a ArkTS RangeError with text information. + * @param env Current running virtual machine context. + * @param code Optional error code to set on the error. + * @param msg napi_value representing the EcmaScript string to be associated with the error. + * @param result napi_value representing the error created. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, msg or result is nullptr, code is not string and number type or msg is + * not a string type.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_create_range_error(napi_env env, + napi_value code, + napi_value msg, + napi_value* result); + +/** + * @brief Checks whether an exception occurs. + * @param env Current running virtual machine context. + * @param result Boolean value that is true if there is a pending exception. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or result is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_is_exception_pending(napi_env env, bool* result); + +/** + * @brief Obtains and clears the latest exception. + * @param env Current running virtual machine context. + * @param result The exception if there is a pending exception; otherwise return a null value. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or result is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_get_and_clear_last_exception(napi_env env, + napi_value* result); + +/** + * @brief Raises a fatal error to terminate the process immediately. + * @param location Optional location for the error occurrence. + * @param location_len The byte length of the location, or NAPI_AUTO_LENGTH if it is terminated by a null character. + * @param message The message associated with the error. + * @param message_len The byte length of the message, or NAPI_AUTO_LENGTH if it is terminated by a null character. + * + * @since 10 +*/ +NAPI_EXTERN NAPI_NO_RETURN void napi_fatal_error(const char* location, + size_t location_len, + const char* message, + size_t message_len); + +/** + * @brief Opens a scope. + * @param env Current running virtual machine context. + * @param result napi_value representing the new scope. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or result is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_open_handle_scope(napi_env env, + napi_handle_scope* result); + +/** + * @brief Closes the scope passed in. After the scope is closed, all references declared in it are closed. + * @param env Current running virtual machine context. + * @param scope The scope to close. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or scope is nullptr.\n + * {@link napi_handle_scope_mismatch } If there is no scope still existed.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_close_handle_scope(napi_env env, + napi_handle_scope scope); + +/** + * @brief Opens an escapable handle scope from which the declared values can be returned to the outer scope. + * @param env Current running virtual machine context. + * @param result The new scope. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or result is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_open_escapable_handle_scope(napi_env env, + napi_escapable_handle_scope* result); + +/** + * @brief Closes the escapable handle scope passed in. + * @param env Current running virtual machine context. + * @param scope The scope to close. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or scope is nullptr.\n + * {@link napi_handle_scope_mismatch } If there is no scope still existed.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_close_escapable_handle_scope(napi_env env, + napi_escapable_handle_scope scope); + +/** + * @brief Promotes the handle to the input ArkTS object so that it is valid for the lifespan of its outer scope. + * @param env Current running virtual machine context. + * @param scope Current scope. + * @param escapee The ArkTS object to be escaped. + * @param result The handle to the escaped object in the outer scope. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, scope, escapee or result is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_escape_handle(napi_env env, + napi_escapable_handle_scope scope, + napi_value escapee, + napi_value* result); + +/** + * @brief Creates a reference for an object to extend its lifespan. The caller needs to manage the reference lifespan. + * @param env Current running virtual machine context. + * @param value The napi_value that is being referenced. + * @param initial_refcount The initial count for the new reference. + * @param result napi_ref pointing to the new reference. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, value or result is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_create_reference(napi_env env, + napi_value value, + uint32_t initial_refcount, + napi_ref* result); + +/** + * @brief Deletes the reference passed in. + * @param env Current running virtual machine context. + * @param ref The napi_ref to be deleted. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or ref is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_delete_reference(napi_env env, napi_ref ref); + +/** + * @brief Increments the reference count for the reference passed in and returns the count. + * @param env Current running virtual machine context. + * @param ref The napi_ref whose reference count will be incremented. + * @param result The new reference count. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or ref is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_reference_ref(napi_env env, + napi_ref ref, + uint32_t* result); + +/** + * @brief Decrements the reference count for the reference passed in and returns the count. + * @param env Current running virtual machine context. + * @param ref The napi_ref whose reference count will be decremented. + * @param result The new reference count. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env or ref is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_reference_unref(napi_env env, + napi_ref ref, + uint32_t* result); + +/** + * @brief Obtains the ArkTS Object associated with the reference. + * @param env Current running virtual machine context. + * @param ref The napi_ref of the value being requested. + * @param result The napi_value referenced by the napi_ref. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If env, ref or result is nullptr.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_get_reference_value(napi_env env, + napi_ref ref, + napi_value* result); + +/** + * @brief Check if the given ArkTS Object has the named own property or not. + * @param env Current running virtual machine context. + * @param object The ArkTS object. + * @param key The name of the property to check. + * @param result Whether the own property exists on the object or not. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If the param env, object, key and(or) result is nullptr.\n + * {@link napi_object_expected } If the param object is not an ArkTS Object.\n + * {@link napi_pending_exception } If have uncaught exception, or exception occurs in execution.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_has_own_property(napi_env env, + napi_value object, + napi_value key, + bool* result); + +/** + * @brief Defines an ArkTS class, including constructor function and properties. + * @param env Current running virtual machine context. + * @param utf8name Name of the ArkTS constructor function. + * @param length The length of the utf8name in bytes, or NAPI_AUTO_LENGTH if it is null-terminated. + * @param constructor Callback function that handles constructing instances of the class. + * @param data Optional data to be passed to the constructor callback as the data property of the callback info. + * @param property_count Number of items in the properties array argument. + * @param properties Array of property descriptors. + * @param result A napi_value representing the constructor function for the class. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n execution.\n + * {@link napi_invalid_arg } If the param env, utf8name and(or) result is nullptr. If napi_property_descriptor + * is nullptr but property_count greater than 0.\n + * {@link napi_function_expected } If the param func is not an ArkTS Function.\n + * {@link napi_pending_exception } If have uncaught exception, or exception occurs in execution.\n + * @since 10 +*/ +NAPI_EXTERN napi_status napi_define_class(napi_env env, + const char* utf8name, + size_t length, + napi_callback constructor, + void* data, + size_t property_count, + const napi_property_descriptor* properties, + napi_value* result); #ifdef __cplusplus } #endif - +/** @} */ #endif /* FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H */ -/** @} */ \ No newline at end of file -- Gitee From 746cc66e7c655219d7085e2b1d0362e5ef38b699 Mon Sep 17 00:00:00 2001 From: AnBetter Date: Tue, 24 Dec 2024 17:21:36 +0800 Subject: [PATCH 580/620] =?UTF-8?q?progress=E7=BA=BF=E6=80=A7=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E6=B3=A8=E9=87=8A=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: AnBetter --- arkui/ace_engine/native/native_node.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index f6e7ea1cd..f1bd97fba 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -3398,6 +3398,7 @@ typedef enum { /** * @brief Sets the style of the linear progress indicator. * This attribute can be set, reset, and obtained as required through APIs. + * If the progress indicator type is not linear, it will not take effect. * * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n * .object: Use the {@link ArkUI_ProgressLinearStyleOption} object to set the style. \n -- Gitee From 50c420ca78fcdc3122e3e9380f29bfa7478b3b05 Mon Sep 17 00:00:00 2001 From: wangtao Date: Thu, 19 Dec 2024 15:34:59 +0800 Subject: [PATCH 581/620] add new NODE_IMMUTABLE_FONT_WEIGHT Signed-off-by: wangtao Change-Id: I1b6e2c16dfdeb6f46ff78c11bef91ed406b14e2c --- arkui/ace_engine/native/native_node.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index f6e7ea1cd..b6e8fd6bf 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -2217,6 +2217,21 @@ typedef enum { */ NODE_TEXT_HALF_LEADING = 1029, + /** + * @brief Defines the font weight attribute, which can be set, reset, and obtained as required through APIs. + * The font weight set through this interface does not support adaptive adjustment. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: font weight {@link ArkUI_FontWeight}. The default value is ARKUI_FONT_WEIGHT_NORMAL.\n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: font weight {@link ArkUI_FontWeight}.\n + + * @since 16 + * + */ + NODE_IMMUTABLE_FONT_WEIGHT = 1030, + /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. * -- Gitee From b926e650e83598cb740794f10e3ab2e4e733f8fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E5=86=AC=E5=86=AC=E5=86=AC?= Date: Tue, 24 Dec 2024 19:21:39 +0800 Subject: [PATCH 582/620] Message:fixCodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 郑冬冬冬 --- .../hiappevent/include/hiappevent/hiappevent_event.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h index bfcad3409..6ae0c342a 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h @@ -152,6 +152,14 @@ extern "C" { */ #define EVENT_MAIN_THREAD_JANK "MAIN_THREAD_JANK" +/** + * @brief app hicollie event. + * + * @since 16 + * @version 1.0 + */ +#define EVENT_APP_HICOLLIE "APP_HICOLLIE" + /** * @brief OS domain. * -- Gitee From b3a010e41a2a76c2bf02fca823a4221c73a0eabc Mon Sep 17 00:00:00 2001 From: AnBetter Date: Mon, 23 Dec 2024 20:58:06 +0800 Subject: [PATCH 583/620] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: AnBetter --- arkui/ace_engine/native/native_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 08542a381..8d0fbd78b 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -4020,7 +4020,7 @@ int32_t OH_ArkUI_ActiveChildrenInfo_GetCount(ArkUI_ActiveChildrenInfo* handle); *
If the result returns nullptr, there may be out of memory. * @since 16 */ -ArkUI_ProgressLinearStyleOption* OH_ArkUI_ProgressLinearStyleOption_Create(); +ArkUI_ProgressLinearStyleOption* OH_ArkUI_ProgressLinearStyleOption_Create(void); /** * @brief Destroy linear progress indicator style information. -- Gitee From c5a28f28c4c0e29f74df330223508f4c1ea7910c Mon Sep 17 00:00:00 2001 From: wangxiuxiu96 Date: Mon, 16 Dec 2024 17:52:38 +0800 Subject: [PATCH 584/620] =?UTF-8?q?TextInput/TextArea=E6=94=AF=E6=8C=81hal?= =?UTF-8?q?fLeading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangxiuxiu96 --- arkui/ace_engine/native/native_node.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 6a60ecb13..804b7bf14 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -3013,6 +3013,19 @@ typedef enum { */ NODE_TEXT_INPUT_ENABLE_PREVIEW_TEXT = 7033, + /** + * @brief Sets whether to center text vertically in the textInput component. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: whether to center text vertically. The default value is false. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether to center text vertically. \n + * + * @since 16 + */ + NODE_TEXT_INPUT_HALF_LEADING = 7034, + /** * @brief Defines the default placeholder text for the multi-line text box. * This attribute can be set, reset, and obtained as required through APIs. @@ -3335,6 +3348,19 @@ typedef enum { */ NODE_TEXT_AREA_ENABLE_PREVIEW_TEXT = 8024, + /** + * @brief Sets whether to center text vertically in the textArea component. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: whether to center text vertically. The default value is false. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether to center text vertically. \n + * + * @since 16 + */ + NODE_TEXT_AREA_HALF_LEADING = 8025, + /** * @brief Defines the button text content. This attribute can be set, reset, and obtained as required through APIs. * -- Gitee From 70ed7b7c74cd021849c2955f64b9886190901d76 Mon Sep 17 00:00:00 2001 From: wangtao Date: Wed, 25 Dec 2024 09:28:26 +0800 Subject: [PATCH 585/620] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20NODE=5FIMMUTABLE?= =?UTF-8?q?=5FFONT=5FWEIGHT=20=E8=8B=B1=E6=96=87=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangtao Change-Id: Id0a6c2340a8586307aa8faf772465ae568d78739 --- arkui/ace_engine/native/native_node.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 6a60ecb13..735757dea 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -2219,16 +2219,15 @@ typedef enum { /** * @brief Defines the font weight attribute, which can be set, reset, and obtained as required through APIs. - * The font weight set through this interface does not support adaptive adjustment. + * The font weight specified by this API is not affected by any changes in the system font weight settings. * * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n * .value[0].i32: font weight {@link ArkUI_FontWeight}. The default value is ARKUI_FONT_WEIGHT_NORMAL.\n * \n * Format of the return value {@link ArkUI_AttributeItem}:\n * .value[0].i32: font weight {@link ArkUI_FontWeight}.\n - - * @since 16 * + * @since 16 */ NODE_IMMUTABLE_FONT_WEIGHT = 1030, -- Gitee From 52b901e06e638502ff05f537eb43673ef22220cb Mon Sep 17 00:00:00 2001 From: zoulinken Date: Tue, 24 Dec 2024 20:32:59 +0800 Subject: [PATCH 586/620] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E8=8A=82=E7=82=B9id=E8=8E=B7=E5=8F=96=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zoulinken --- arkui/ace_engine/native/libace.ndk.json | 4 ++++ arkui/ace_engine/native/native_node.h | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index ca090d8b7..024b8be06 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -1347,6 +1347,10 @@ "first_introduced": "14", "name": "OH_ArkUI_ActiveChildrenInfo_GetCount" }, + { + "first_introduced": "16", + "name": "OH_ArkUI_NodeUtils_GetAttachedNodeHandleById" + }, { "first_introduced": "12", "name": "OH_ArkUI_ListChildrenMainSizeOption_Create" diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 6a60ecb13..c5c77065d 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -8133,6 +8133,20 @@ float OH_ArkUI_SystemFontStyleEvent_GetFontSizeScale(const ArkUI_SystemFontStyle */ float OH_ArkUI_SystemFontStyleEvent_GetFontWeightScale(const ArkUI_SystemFontStyleEvent* event); +/** + * @brief Get the node handle by id. This interface only works on the main thread. + * + * @param id The id of the target node handle. + * @param node The handle of target node handle. + * @return Error code. + * {@link ARKUI_ERROR_CODE_NO_ERROR} success. + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function parameter exception. + * {@link ARKUI_ERROR_CODE_CAPI_INIT_ERROR} if the CAPI init error. + * {@link ARKUI_ERROR_CODE_UI_CONTEXT_INVALID} if the uiContext is invalid. + * @since 16 + */ +int32_t OH_ArkUI_NodeUtils_GetAttachedNodeHandleById(const char* id, ArkUI_NodeHandle* node); + #ifdef __cplusplus }; #endif -- Gitee From 54a68c92754bffa99d9df368090ba76fa44fc7f7 Mon Sep 17 00:00:00 2001 From: Tintin9529 Date: Wed, 25 Dec 2024 13:41:39 +0800 Subject: [PATCH 587/620] =?UTF-8?q?TextPicker=E7=BB=84=E4=BB=B6=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=A3=B0=E6=8C=AF=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tintin9529 --- arkui/ace_engine/native/native_node.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 07f56e7da..dfcd5ae7f 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -3895,6 +3895,20 @@ typedef enum { * */ NODE_TEXT_PICKER_DEFAULT_PICKER_ITEM_HEIGHT, + /** + * @brief Defines whether haptic feedback. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: whether to feedback. The value true means to feedback, and + * false means the opposite.\n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * value[0].i32: whether to feedback.\n + * + * @since 16 + */ + NODE_TEXT_PICKER_ENABLE_HAPTIC_FEEDBACK = 15010, /** * @brief Defines the style of the background in the selected state of the calendar picker. * This attribute can be set, reset, and obtained as required through APIs. -- Gitee From c5019b83a09963a7cb0b089dc34f9d58a1202d85 Mon Sep 17 00:00:00 2001 From: wangxiuxiu Date: Wed, 25 Dec 2024 10:15:50 +0800 Subject: [PATCH 588/620] change getPressedKeys note Signed-off-by: wangxiuxiu --- arkui/ace_engine/native/ui_input_event.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/ui_input_event.h b/arkui/ace_engine/native/ui_input_event.h index 1a32d70c3..b45e8b3e8 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -750,7 +750,7 @@ int32_t OH_ArkUI_PointerEvent_SetStopPropagation(const ArkUI_UIInputEvent* event int32_t OH_ArkUI_UIInputEvent_GetDeviceId(const ArkUI_UIInputEvent* event); /** - * @brief Obtains all keys that are pressed from UI input event. + * @brief Obtains all keys that are pressed from UI input event. Only supports key events currently. * * @param event Pointer to an ArkUI_UIInputEvent object. * @param pressedKeyCodes Array of all keys that are pressed. You need to allocate the memory space. -- Gitee From 53d8e8deaf0b3dd2bc7c0b206fbd6f15aa6bfaef Mon Sep 17 00:00:00 2001 From: liumingxiang Date: Wed, 25 Dec 2024 20:03:21 +0800 Subject: [PATCH 589/620] api14to16 Signed-off-by: liumingxiang --- .../graphic_2d/native_drawing/drawing_font.h | 6 +- .../graphic_2d/native_drawing/drawing_rect.h | 8 +- .../native_drawing/drawing_text_declaration.h | 8 +- .../drawing_text_font_descriptor.h | 4 +- .../native_drawing/drawing_text_line.h | 38 +++--- .../drawing_text_lineTypography.h | 8 +- .../native_drawing/drawing_text_run.h | 30 ++--- .../native_drawing/drawing_text_typography.h | 16 +-- .../graphic_2d/native_drawing/drawing_types.h | 2 +- .../native_drawing/libnative_drawing.ndk.json | 108 +++++++++--------- 10 files changed, 114 insertions(+), 114 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index df5d11398..f7e6311de 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -509,7 +509,7 @@ float OH_Drawing_FontGetMetrics(OH_Drawing_Font* font, OH_Drawing_Font_Metrics* * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font, glyphs * and bounds is nullptr or count is 0. - * @since 14 + * @since 16 * @version 1.0 */ OH_Drawing_ErrorCode OH_Drawing_FontGetBounds(const OH_Drawing_Font* font, const uint16_t* glyphs, uint32_t count, @@ -526,7 +526,7 @@ OH_Drawing_ErrorCode OH_Drawing_FontGetBounds(const OH_Drawing_Font* font, const * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font, path * is nullptr or glyph not exist. - * @since 14 + * @since 16 * @version 1.0 */ OH_Drawing_ErrorCode OH_Drawing_FontGetPathForGlyph(const OH_Drawing_Font* font, uint16_t glyph, @@ -547,7 +547,7 @@ OH_Drawing_ErrorCode OH_Drawing_FontGetPathForGlyph(const OH_Drawing_Font* font, * @return Returns the error code. * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font, text or path is nullptr. - * @since 14 + * @since 16 */ OH_Drawing_ErrorCode OH_Drawing_FontGetTextPath(const OH_Drawing_Font* font, const void* text, size_t byteLength, OH_Drawing_TextEncoding encoding, float x, float y, OH_Drawing_Path* path); diff --git a/graphic/graphic_2d/native_drawing/drawing_rect.h b/graphic/graphic_2d/native_drawing/drawing_rect.h index ce02692a2..ecabab963 100644 --- a/graphic/graphic_2d/native_drawing/drawing_rect.h +++ b/graphic/graphic_2d/native_drawing/drawing_rect.h @@ -225,7 +225,7 @@ void OH_Drawing_RectDestroy(OH_Drawing_Rect* rect); * If nullptr is returned, the creation fails. * The possible cause of the failure is that the available memory is empty, * or size is invalid. - * @since 14 + * @since 16 * @version 1.0 */ OH_Drawing_Array* OH_Drawing_RectCreateArray(size_t size); @@ -239,7 +239,7 @@ OH_Drawing_Array* OH_Drawing_RectCreateArray(size_t size); * @return Returns the error code. * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if rectArray or pSize is nullptr. - * @since 14 + * @since 16 * @version 1.0 */ OH_Drawing_ErrorCode OH_Drawing_RectGetArraySize(OH_Drawing_Array* rectArray, size_t* pSize); @@ -255,7 +255,7 @@ OH_Drawing_ErrorCode OH_Drawing_RectGetArraySize(OH_Drawing_Array* rectArray, si * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if rectArray or rect is nullptr, * or index is valid. - * @since 14 + * @since 16 * @version 1.0 */ OH_Drawing_ErrorCode OH_Drawing_RectGetArrayElement(OH_Drawing_Array* rectArray, size_t index, @@ -269,7 +269,7 @@ OH_Drawing_ErrorCode OH_Drawing_RectGetArrayElement(OH_Drawing_Array* rectArray, * @return Returns the error code. * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if rectArray is nullptr. - * @since 14 + * @since 16 * @version 1.0 */ OH_Drawing_ErrorCode OH_Drawing_RectDestroyArray(OH_Drawing_Array* rectArray); diff --git a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h index 505001519..f9650a951 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h @@ -63,7 +63,7 @@ typedef struct OH_Drawing_Typography OH_Drawing_Typography; /** * @brief Defines an OH_Drawing_LineTypography, which is used to perform line layout. * - * @since 14 + * @since 16 * @version 1.0 */ typedef struct OH_Drawing_LineTypography OH_Drawing_LineTypography; @@ -136,7 +136,7 @@ typedef struct OH_Drawing_TextShadow OH_Drawing_TextShadow; /** * @brief Defines an OH_Drawing_TextTab, which is used to to store the tab alignment type and position. * - * @since 14 + * @since 16 * @version 1.0 */ typedef struct OH_Drawing_TextTab OH_Drawing_TextTab; @@ -144,7 +144,7 @@ typedef struct OH_Drawing_TextTab OH_Drawing_TextTab; /** * @brief Defines an OH_Drawing_TextLine, which is used to manage text line. * - * @since 14 + * @since 16 * @version 1.0 */ typedef struct OH_Drawing_TextLine OH_Drawing_TextLine; @@ -152,7 +152,7 @@ typedef struct OH_Drawing_TextLine OH_Drawing_TextLine; /** * @brief Defines an OH_Drawing_Run, which is used to manage run. * - * @since 14 + * @since 16 * @version 1.0 */ typedef struct OH_Drawing_Run OH_Drawing_Run; diff --git a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h index 4ba3ee2e6..23f25a213 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h @@ -78,7 +78,7 @@ typedef enum { * @param num Indicates the count of obtained OH_Drawing_FontDescriptor. * @return Returns an array of OH_Drawing_FontDescriptor. Released through the * OH_Drawing_DestroyFontDescriptors interface after use. - * @since 14 + * @since 16 */ OH_Drawing_FontDescriptor* OH_Drawing_MatchFontDescriptors(OH_Drawing_FontDescriptor* desc, size_t* num); @@ -88,7 +88,7 @@ OH_Drawing_FontDescriptor* OH_Drawing_MatchFontDescriptors(OH_Drawing_FontDescri * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param descriptors OH_Drawing_FontDescriptor object array. * @param num Represents the number of members of the OH_Drawing_FontDescriptor array. - * @since 14 + * @since 16 */ void OH_Drawing_DestroyFontDescriptors(OH_Drawing_FontDescriptor* descriptors, size_t num); diff --git a/graphic/graphic_2d/native_drawing/drawing_text_line.h b/graphic/graphic_2d/native_drawing/drawing_text_line.h index 256251146..d04de9b4c 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_line.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_line.h @@ -53,7 +53,7 @@ extern "C" { * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param typography Indicates the pointer to a typography object OH_Drawing_Typography. * @return Indicates the pointer to a text line array object OH_Drawing_Array. - * @since 14 + * @since 16 */ OH_Drawing_Array* OH_Drawing_TypographyGetTextLines(OH_Drawing_Typography* typography); @@ -62,7 +62,7 @@ OH_Drawing_Array* OH_Drawing_TypographyGetTextLines(OH_Drawing_Typography* typog * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param lines Indicates the pointer to the text line array object OH_Drawing_Array. - * @since 14 + * @since 16 * @version 1.0 */ void OH_Drawing_DestroyTextLines(OH_Drawing_Array* lines); @@ -72,7 +72,7 @@ void OH_Drawing_DestroyTextLines(OH_Drawing_Array* lines); * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param line Indicates the pointer to the text line object OH_Drawing_TextLine. - * @since 14 + * @since 16 * @version 1.0 */ void OH_Drawing_DestroyTextLine(OH_Drawing_TextLine* line); @@ -84,7 +84,7 @@ void OH_Drawing_DestroyTextLine(OH_Drawing_TextLine* line); * @param lines Indicates the pointer to the text line array object OH_Drawing_Array. * @param index The text line object index. * @return Indicates the pointer to a text line object OH_Drawing_TextLine. - * @since 14 + * @since 16 */ OH_Drawing_TextLine* OH_Drawing_GetTextLineByIndex(OH_Drawing_Array* lines, size_t index); @@ -94,7 +94,7 @@ OH_Drawing_TextLine* OH_Drawing_GetTextLineByIndex(OH_Drawing_Array* lines, size * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param line Indicates the pointer to an OH_Drawing_TextLine object. * @return Returns the count of glyphs. - * @since 14 + * @since 16 * @version 1.0 */ double OH_Drawing_TextLineGetGlyphCount(OH_Drawing_TextLine* line); @@ -106,7 +106,7 @@ double OH_Drawing_TextLineGetGlyphCount(OH_Drawing_TextLine* line); * @param line Indicates the pointer to an OH_Drawing_TextLine object. * @param start Indicates the pointer to text line start position. * @param end Indicates the pointer to text line end position. - * @since 14 + * @since 16 * @version 1.0 */ void OH_Drawing_TextLineGetTextRange(OH_Drawing_TextLine* line, size_t* start, size_t* end); @@ -117,7 +117,7 @@ void OH_Drawing_TextLineGetTextRange(OH_Drawing_TextLine* line, size_t* start, s * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param line Indicates the pointer to an OH_Drawing_TextLine object. * @return Indicates the pointer to a glyph runs array object of text line OH_Drawing_Array. - * @since 14 + * @since 16 * @version 1.0 */ OH_Drawing_Array* OH_Drawing_TextLineGetGlyphRuns(OH_Drawing_TextLine* line); @@ -127,7 +127,7 @@ OH_Drawing_Array* OH_Drawing_TextLineGetGlyphRuns(OH_Drawing_TextLine* line); * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param runs Indicates the pointer to the run array object OH_Drawing_Array. - * @since 14 + * @since 16 * @version 1.0 */ void OH_Drawing_DestroyRuns(OH_Drawing_Array* runs); @@ -139,7 +139,7 @@ void OH_Drawing_DestroyRuns(OH_Drawing_Array* runs); * @param runs Indicates the pointer to the run array object OH_Drawing_Array. * @param index The run object index. * @return Indicates the pointer to a run object OH_Drawing_Run. - * @since 14 + * @since 16 */ OH_Drawing_Run* OH_Drawing_GetRunByIndex(OH_Drawing_Array* runs, size_t index); @@ -151,7 +151,7 @@ OH_Drawing_Run* OH_Drawing_GetRunByIndex(OH_Drawing_Array* runs, size_t index); * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. * @param x Represents the X-axis position on the canvas. * @param y Represents the Y-axis position on the canvas. - * @since 14 + * @since 16 * @version 1.0 */ void OH_Drawing_TextLinePaint(OH_Drawing_TextLine* line, OH_Drawing_Canvas* canvas, double x, double y); @@ -166,7 +166,7 @@ void OH_Drawing_TextLinePaint(OH_Drawing_TextLine* line, OH_Drawing_Canvas* canv * For details, see the enum OH_Drawing_EllipsisModal. * @param ellipsis Indicates the ellipsis string to set. * @return Returns the pointer to the OH_Drawing_TextLine object created. - * @since 14 + * @since 16 * @version 1.0 */ OH_Drawing_TextLine* OH_Drawing_TextLineCreateTruncatedLine(OH_Drawing_TextLine* line, double width, int mode, @@ -181,7 +181,7 @@ OH_Drawing_TextLine* OH_Drawing_TextLineCreateTruncatedLine(OH_Drawing_TextLine* * @param descent Indicates the pointer to the distance that remains below the baseline. * @param leading Indicates the pointer to the line Spacing. * @return Returns The total width of the typesetting border. - * @since 14 + * @since 16 * @version 1.0 */ double OH_Drawing_TextLineGetTypographicBounds(OH_Drawing_TextLine* line, double* ascent, double* descent, @@ -193,7 +193,7 @@ double OH_Drawing_TextLineGetTypographicBounds(OH_Drawing_TextLine* line, double * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param line Indicates the pointer to an OH_Drawing_TextLine object. * @return Returns the pointer to the OH_Drawing_Rect struct created. - * @since 14 + * @since 16 * @version 1.0 */ OH_Drawing_Rect* OH_Drawing_TextLineGetImageBounds(OH_Drawing_TextLine* line); @@ -204,7 +204,7 @@ OH_Drawing_Rect* OH_Drawing_TextLineGetImageBounds(OH_Drawing_TextLine* line); * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param line Indicates the pointer to an OH_Drawing_TextLine object. * @return Returns the tail space width. - * @since 14 + * @since 16 * @version 1.0 */ double OH_Drawing_TextLineGetTrailingSpaceWidth(OH_Drawing_TextLine* line); @@ -216,7 +216,7 @@ double OH_Drawing_TextLineGetTrailingSpaceWidth(OH_Drawing_TextLine* line); * @param line Indicates the pointer to an OH_Drawing_TextLine object. * @param point Indicates the pointer to an OH_Drawing_Point object. * @return Returns the string index for a given position. - * @since 14 + * @since 16 */ int32_t OH_Drawing_TextLineGetStringIndexForPosition(OH_Drawing_TextLine* line, OH_Drawing_Point* point); @@ -227,7 +227,7 @@ int32_t OH_Drawing_TextLineGetStringIndexForPosition(OH_Drawing_TextLine* line, * @param line Indicates the pointer to an OH_Drawing_TextLine object. * @param index The given string index. * @return Returns the offset for a given string index. - * @since 14 + * @since 16 */ double OH_Drawing_TextLineGetOffsetForStringIndex(OH_Drawing_TextLine* line, int32_t index); @@ -241,7 +241,7 @@ double OH_Drawing_TextLineGetOffsetForStringIndex(OH_Drawing_TextLine* line, int * @return The return value of the user-defined callback function. * If false is returned, the traversal continues. * If true is returned, the traversal stops. - * @since 14 + * @since 16 * @version 1.0 */ typedef bool (*Drawing_CaretOffsetsCallback)(double offset, int32_t index, bool leadingEdge); @@ -252,7 +252,7 @@ typedef bool (*Drawing_CaretOffsetsCallback)(double offset, int32_t index, bool * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param line Indicates the pointer to an OH_Drawing_TextLine object. * @param callback User-defined callback functions, see Drawing_CaretOffsetsCallback. - * @since 14 + * @since 16 */ void OH_Drawing_TextLineEnumerateCaretOffsets(OH_Drawing_TextLine* line, Drawing_CaretOffsetsCallback callback); @@ -267,7 +267,7 @@ void OH_Drawing_TextLineEnumerateCaretOffsets(OH_Drawing_TextLine* line, Drawing * @param alignmentWidth The width of the text to be aligned. * Returns 0 if it is less than the actual width of the text. * @return Returns the offset of the aligned text. - * @since 14 + * @since 16 * @version 1.0 */ double OH_Drawing_TextLineGetAlignmentOffset(OH_Drawing_TextLine* line, double alignmentFactor, double alignmentWidth); diff --git a/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h b/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h index d37e6e3b2..1184ce909 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h @@ -52,7 +52,7 @@ extern "C" { * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param handler Indicates the pointer to an OH_Drawing_TypographyCreate object. * @return Returns the pointer to the OH_Drawing_LineTypography object created. - * @since 14 + * @since 16 */ OH_Drawing_LineTypography* OH_Drawing_CreateLineTypography(OH_Drawing_TypographyCreate* handler); @@ -61,7 +61,7 @@ OH_Drawing_LineTypography* OH_Drawing_CreateLineTypography(OH_Drawing_Typography * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param lineTypography Indicates the pointer to an OH_Drawing_LineTypography object. - * @since 14 + * @since 16 */ void OH_Drawing_DestroyLineTypography(OH_Drawing_LineTypography* lineTypography); @@ -73,7 +73,7 @@ void OH_Drawing_DestroyLineTypography(OH_Drawing_LineTypography* lineTypography) * @param startIndex Indicates the starting point for the line-break calculations. * @param width Indicates the requested line-break width. * @return Returns the count of the characters from startIndex that would cause the line break. - * @since 14 + * @since 16 */ size_t OH_Drawing_LineTypographyGetLineBreak(OH_Drawing_LineTypography* lineTypography, size_t startIndex, double width); @@ -86,7 +86,7 @@ size_t OH_Drawing_LineTypographyGetLineBreak(OH_Drawing_LineTypography* lineTypo * @param startIndex Indicates the starting index of the text range. * @param count Indicates the characters count of the text range. * @return Returns the pointer to the OH_Drawing_TextLine object created. - * @since 14 + * @since 16 */ OH_Drawing_TextLine* OH_Drawing_LineTypographyCreateLine(OH_Drawing_LineTypography* lineTypography, size_t startIndex, size_t count); diff --git a/graphic/graphic_2d/native_drawing/drawing_text_run.h b/graphic/graphic_2d/native_drawing/drawing_text_run.h index 7237fd88c..d0275044b 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_run.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_run.h @@ -54,7 +54,7 @@ extern "C" { * @param start The run of start index. * @param length The run of length, if start and length are set to 0, then get all of the current run. * @return Run of glyph indices array object OH_Drawing_Array. - * @since 14 + * @since 16 */ OH_Drawing_Array* OH_Drawing_GetRunStringIndices(OH_Drawing_Run* run, int64_t start, int64_t length); @@ -65,7 +65,7 @@ OH_Drawing_Array* OH_Drawing_GetRunStringIndices(OH_Drawing_Run* run, int64_t st * @param stringIndices the run glyph indices array object OH_Drawing_Array. * @param index The run of glyph index. * @return Run of glyph indices element. - * @since 14 + * @since 16 */ uint64_t OH_Drawing_GetRunStringIndicesByIndex(OH_Drawing_Array* stringIndices, size_t index); @@ -74,7 +74,7 @@ uint64_t OH_Drawing_GetRunStringIndicesByIndex(OH_Drawing_Array* stringIndices, * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param stringIndices glyph indices array object OH_Drawing_Array. - * @since 14 + * @since 16 */ void OH_Drawing_DestroyRunStringIndices(OH_Drawing_Array* stringIndices); @@ -85,7 +85,7 @@ void OH_Drawing_DestroyRunStringIndices(OH_Drawing_Array* stringIndices); * @param run Indicates the pointer to an OH_Drawing_Run object. * @param location The run of glyph location. * @param length The run of glyph length. - * @since 14 + * @since 16 */ void OH_Drawing_GetRunStringRange(OH_Drawing_Run* run, uint64_t* location, uint64_t* length); @@ -98,7 +98,7 @@ void OH_Drawing_GetRunStringRange(OH_Drawing_Run* run, uint64_t* location, uint6 * @param descent The run of descent. * @param leading The run of leading. * @return run typographic width. - * @since 14 + * @since 16 */ float OH_Drawing_GetRunTypographicBounds(OH_Drawing_Run* run, float* ascent, float* descent, float* leading); @@ -110,7 +110,7 @@ float OH_Drawing_GetRunTypographicBounds(OH_Drawing_Run* run, float* ascent, flo * @param run Indicates the pointer to an OH_Drawing_Run object. * @param x Indicates the x coordinate. * @param y Indicates the y coordinate. - * @since 14 + * @since 16 */ void OH_Drawing_RunPaint(OH_Drawing_Canvas* canvas, OH_Drawing_Run* run, double x, double y); @@ -120,7 +120,7 @@ void OH_Drawing_RunPaint(OH_Drawing_Canvas* canvas, OH_Drawing_Run* run, double * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param run Indicates the pointer to an OH_Drawing_Run object. * @return The run image bounds to an OH_Drawing_Rect object. - * @since 14 + * @since 16 */ OH_Drawing_Rect* OH_Drawing_GetRunImageBounds(OH_Drawing_Run* run); @@ -129,7 +129,7 @@ OH_Drawing_Rect* OH_Drawing_GetRunImageBounds(OH_Drawing_Run* run); * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param rect Run image bounds to an OH_Drawing_Rect object. - * @since 14 + * @since 16 */ void OH_Drawing_DestroyRunImageBounds(OH_Drawing_Rect* rect); @@ -141,7 +141,7 @@ void OH_Drawing_DestroyRunImageBounds(OH_Drawing_Rect* rect); * @param start The run of start index. * @param length The run of length, if start and length are set to 0, then get all of the current run. * @return Run of glyph array object OH_Drawing_ArrayOH_Drawing_Array. * @param index The run of glyph index. * @return Run of glyph element. - * @since 14 + * @since 16 * @version 1.0 */ uint16_t OH_Drawing_GetRunGlyphsByIndex(OH_Drawing_Array* glyphs, size_t index); @@ -162,7 +162,7 @@ uint16_t OH_Drawing_GetRunGlyphsByIndex(OH_Drawing_Array* glyphs, size_t index); * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param glyphs The run of glyph array object OH_Drawing_Array. - * @since 14 + * @since 16 */ void OH_Drawing_DestroyRunGlyphs(OH_Drawing_Array* glyphs); @@ -174,7 +174,7 @@ void OH_Drawing_DestroyRunGlyphs(OH_Drawing_Array* glyphs); * @param start The run of start index. * @param length The run of length, if start and length are set to 0, then get all of the current run. * @return Run of position array object OH_Drawing_Array. - * @since 14 + * @since 16 */ OH_Drawing_Array* OH_Drawing_GetRunPositions(OH_Drawing_Run* run, int64_t start, int64_t length); @@ -185,7 +185,7 @@ OH_Drawing_Array* OH_Drawing_GetRunPositions(OH_Drawing_Run* run, int64_t start, * @param positions The run of position array object OH_Drawing_Array. * @param index The run of glyph index. * @return Run of glyph position pointer to an OH_Drawing_Point object. - * @since 14 + * @since 16 * @version 1.0 */ OH_Drawing_Point* OH_Drawing_GetRunPositionsByIndex(OH_Drawing_Array* positions, size_t index); @@ -195,7 +195,7 @@ OH_Drawing_Point* OH_Drawing_GetRunPositionsByIndex(OH_Drawing_Array* positions, * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param positions The run of position array object OH_Drawing_Array. - * @since 14 + * @since 16 */ void OH_Drawing_DestroyRunPositions(OH_Drawing_Array* positions); @@ -205,7 +205,7 @@ void OH_Drawing_DestroyRunPositions(OH_Drawing_Array* positions); * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param run Indicates the pointer to an OH_Drawing_Run object. * @return The number of glyph. - * @since 14 + * @since 16 */ uint32_t OH_Drawing_GetRunGlyphCount(OH_Drawing_Run* run); #ifdef __cplusplus diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 998932c6a..94dd59675 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -765,7 +765,7 @@ void OH_Drawing_SetTextStyleDecoration(OH_Drawing_TextStyle* style, int decorati * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @param decoration Indicates the text decoration to add. For details, see the enum OH_Drawing_TextDecoration. - * @since 14 + * @since 16 * @version 1.0 */ void OH_Drawing_AddTextStyleDecoration(OH_Drawing_TextStyle* style, int decoration); @@ -777,7 +777,7 @@ void OH_Drawing_AddTextStyleDecoration(OH_Drawing_TextStyle* style, int decorati * @param style Indicates the pointer to an OH_Drawing_TextStyle object. * @param decoration Indicates the text decoration to remove, shoud be match existing text decorations. * For details, see the enum OH_Drawing_TextDecoration. - * @since 14 + * @since 16 * @version 1.0 */ void OH_Drawing_RemoveTextStyleDecoration(OH_Drawing_TextStyle* style, int decoration); @@ -2834,7 +2834,7 @@ void OH_Drawing_SetTextShadow(OH_Drawing_TextShadow* shadow, uint32_t color, OH_ * @return Returns the pointer to the OH_Drawing_TextTab object created. If the object returns NULL, * the creation failed. The possible cause of the failure is that the application address space is used up. * As a result, space cannot be allocated. - * @since 14 + * @since 16 * @version 1.0 */ OH_Drawing_TextTab* OH_Drawing_CreateTextTab(OH_Drawing_TextAlign alignment, float location); @@ -2844,7 +2844,7 @@ OH_Drawing_TextTab* OH_Drawing_CreateTextTab(OH_Drawing_TextAlign alignment, flo * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param tab Indicates the pointer to an OH_Drawing_TextTab object. - * @since 14 + * @since 16 * @version 1.0 */ void OH_Drawing_DestroyTextTab(OH_Drawing_TextTab* tab); @@ -2855,7 +2855,7 @@ void OH_Drawing_DestroyTextTab(OH_Drawing_TextTab* tab); * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param tab Indicates the pointer to an OH_Drawing_TextTab object. * @return Returns align of an OH_Drawing_TextTab object. - * @since 14 + * @since 16 * @version 1.0 */ OH_Drawing_TextAlign OH_Drawing_GetTextTabAlignment(OH_Drawing_TextTab* tab); @@ -2866,7 +2866,7 @@ OH_Drawing_TextAlign OH_Drawing_GetTextTabAlignment(OH_Drawing_TextTab* tab); * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param tab Indicates the pointer to an OH_Drawing_TextTab object. * @return Returns location of an OH_Drawing_TextTab object. - * @since 14 + * @since 16 * @version 1.0 */ float OH_Drawing_GetTextTabLocation(OH_Drawing_TextTab* tab); @@ -2880,7 +2880,7 @@ float OH_Drawing_GetTextTabLocation(OH_Drawing_TextTab* tab); * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. * @param tab Indicates the pointer to an OH_Drawing_TextTab object. - * @since 14 + * @since 16 * @version 1.0 */ void OH_Drawing_SetTypographyTextTab(OH_Drawing_TypographyStyle* style, OH_Drawing_TextTab* tab); @@ -2891,7 +2891,7 @@ void OH_Drawing_SetTypographyTextTab(OH_Drawing_TypographyStyle* style, OH_Drawi * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param drawingArray Indicates the pointer to the array object OH_Drawing_Array. * @return Size of array. - * @since 14 + * @since 16 * @version 1.0 */ size_t OH_Drawing_GetDrawingArraySize(OH_Drawing_Array* drawingArray); diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h index 65a39f672..e84488f7a 100644 --- a/graphic/graphic_2d/native_drawing/drawing_types.h +++ b/graphic/graphic_2d/native_drawing/drawing_types.h @@ -543,7 +543,7 @@ typedef struct OH_Drawing_RecordCmd OH_Drawing_RecordCmd; /** * @brief Defines an array object, which is used to store multiple NDK object. * - * @since 14 + * @since 16 * @version 1.0 */ typedef struct OH_Drawing_Array OH_Drawing_Array; diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index c33c60140..9951b7fdd 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -636,11 +636,11 @@ { "name": "OH_Drawing_SetTextStyleBaseLine" }, { "name": "OH_Drawing_SetTextStyleDecoration" }, { - "first_introduced": "14", + "first_introduced": "16", "name": "OH_Drawing_AddTextStyleDecoration" }, { - "first_introduced": "14", + "first_introduced": "16", "name": "OH_Drawing_RemoveTextStyleDecoration" }, { "name": "OH_Drawing_SetTextStyleDecorationColor" }, @@ -943,11 +943,11 @@ "name": "OH_Drawing_DestroyFontDescriptor" }, { - "first_introduced": "14", + "first_introduced": "16", "name": "OH_Drawing_MatchFontDescriptors" }, { - "first_introduced": "14", + "first_introduced": "16", "name": "OH_Drawing_DestroyFontDescriptors" }, { @@ -1531,203 +1531,203 @@ "name":"OH_Drawing_RecordCmdDestroy" }, { - "first_introduced": "14", + "first_introduced": "16", "name": "OH_Drawing_CreateLineTypography" }, { - "first_introduced": "14", + "first_introduced": "16", "name": "OH_Drawing_DestroyLineTypography" }, { - "first_introduced": "14", + "first_introduced": "16", "name": "OH_Drawing_LineTypographyGetLineBreak" }, { - "first_introduced": "14", + "first_introduced": "16", "name": "OH_Drawing_LineTypographyCreateLine" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_FontGetBounds" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_FontGetPathForGlyph" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_RectCreateArray" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_RectGetArraySize" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_RectGetArrayElement" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_RectDestroyArray" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_CreateTextTab" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_DestroyTextTab" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetTextTabAlignment" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetTextTabLocation" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_SetTypographyTextTab" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_FontGetTextPath" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetDrawingArraySize" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_TypographyGetTextLines" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_DestroyTextLines" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_DestroyTextLine" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetTextLineByIndex" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_TextLineGetGlyphCount" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_TextLineGetTextRange" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_TextLineGetGlyphRuns" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_DestroyRuns" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetRunByIndex" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_TextLinePaint" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_TextLineCreateTruncatedLine" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_TextLineGetTypographicBounds" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_TextLineGetImageBounds" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_TextLineGetTrailingSpaceWidth" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_TextLineGetStringIndexForPosition" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_TextLineGetOffsetForStringIndex" }, { - "first_introduced": "14", + "first_introduced": "16", "name": "OH_Drawing_TextLineEnumerateCaretOffsets" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_TextLineGetAlignmentOffset" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetRunStringIndices" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetRunStringIndicesByIndex" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_DestroyRunStringIndices" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetRunStringRange" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetRunTypographicBounds" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_RunPaint" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetRunImageBounds" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_DestroyRunImageBounds" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetRunGlyphs" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetRunGlyphsByIndex" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_DestroyRunGlyphs" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetRunPositions" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetRunPositionsByIndex" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_DestroyRunPositions" }, { - "first_introduced": "14", + "first_introduced": "16", "name":"OH_Drawing_GetRunGlyphCount" }, { -- Gitee From 8633feecf3fe6d2e027c26e42e8cdf5ab683c6a3 Mon Sep 17 00:00:00 2001 From: liumingxiang Date: Wed, 25 Dec 2024 20:05:47 +0800 Subject: [PATCH 590/620] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liumingxiang --- .../graphic_2d/native_drawing/drawing_text_font_descriptor.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h index 23f25a213..0fd243680 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h @@ -60,8 +60,6 @@ typedef enum { STYLISH = 1 << 2, /** Installed font types */ INSTALLED = 1 << 3, - /** Customized font types */ - CUSTOMIZED = 1 << 4; } OH_Drawing_SystemFontType; /** -- Gitee From 22fe479df4aab46998e81d2df0a7741fd16e45fe Mon Sep 17 00:00:00 2001 From: liumingxiang Date: Wed, 25 Dec 2024 20:07:31 +0800 Subject: [PATCH 591/620] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liumingxiang --- graphic/graphic_2d/native_drawing/drawing_text_typography.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 94dd59675..a0d488ad2 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -279,8 +279,6 @@ typedef enum { WORD_BREAK_TYPE_BREAK_ALL = 1, /** Break Word type */ WORD_BREAK_TYPE_BREAK_WORD = 2, - /** Attempt break word with hyphens */ - WORD_BREAK_TYPE_HYPHEN = 3, } OH_Drawing_WordBreakType; /** -- Gitee From 5ee76b28f0d059aa063e972d0b8b339ad042bcdd Mon Sep 17 00:00:00 2001 From: liumingxiang Date: Wed, 25 Dec 2024 20:45:11 +0800 Subject: [PATCH 592/620] =?UTF-8?q?=E6=95=B4=E6=94=B9=E9=81=97=E6=BC=8F?= =?UTF-8?q?=E7=9A=84api14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liumingxiang --- graphic/graphic_2d/native_drawing/drawing_text_line.h | 4 ++-- .../graphic_2d/native_drawing/drawing_text_lineTypography.h | 4 ++-- graphic/graphic_2d/native_drawing/drawing_text_run.h | 4 ++-- graphic/graphic_2d/native_drawing/drawing_text_typography.h | 2 +- graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_line.h b/graphic/graphic_2d/native_drawing/drawing_text_line.h index d04de9b4c..2d69ae963 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_line.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_line.h @@ -21,7 +21,7 @@ * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * - * @since 14 + * @since 16 * @version 1.0 */ @@ -33,7 +33,7 @@ * @kit ArkGraphics2D * @library libnative_drawing.so * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @since 14 + * @since 16 * @version 1.0 */ diff --git a/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h b/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h index 1184ce909..0ab0b3a1f 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_lineTypography.h @@ -21,7 +21,7 @@ * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * - * @since 14 + * @since 16 * @version 1.0 */ @@ -33,7 +33,7 @@ * @kit ArkGraphics2D * @library libnative_drawing.so * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @since 14 + * @since 16 * @version 1.0 */ diff --git a/graphic/graphic_2d/native_drawing/drawing_text_run.h b/graphic/graphic_2d/native_drawing/drawing_text_run.h index d0275044b..f37f6afad 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_run.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_run.h @@ -21,7 +21,7 @@ * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * - * @since 14 + * @since 16 * @version 1.0 */ @@ -33,7 +33,7 @@ * @kit ArkGraphics2D * @library libnative_drawing.so * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @since 14 + * @since 16 * @version 1.0 */ diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index a0d488ad2..292a26f06 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -2889,7 +2889,7 @@ void OH_Drawing_SetTypographyTextTab(OH_Drawing_TypographyStyle* style, OH_Drawi * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param drawingArray Indicates the pointer to the array object OH_Drawing_Array. * @return Size of array. - * @since 16 + * @since 14 * @version 1.0 */ size_t OH_Drawing_GetDrawingArraySize(OH_Drawing_Array* drawingArray); diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 9951b7fdd..88b5ef39f 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1595,7 +1595,7 @@ "name":"OH_Drawing_FontGetTextPath" }, { - "first_introduced": "16", + "first_introduced": "14", "name":"OH_Drawing_GetDrawingArraySize" }, { -- Gitee From 6053c3ff5cd5ab9a11e54c69479bf76ad008b1e2 Mon Sep 17 00:00:00 2001 From: liumingxiang Date: Wed, 25 Dec 2024 21:51:53 +0800 Subject: [PATCH 593/620] =?UTF-8?q?=E5=9B=9E=E9=80=80drawingArray?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liumingxiang --- graphic/graphic_2d/native_drawing/drawing_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h index e84488f7a..65a39f672 100644 --- a/graphic/graphic_2d/native_drawing/drawing_types.h +++ b/graphic/graphic_2d/native_drawing/drawing_types.h @@ -543,7 +543,7 @@ typedef struct OH_Drawing_RecordCmd OH_Drawing_RecordCmd; /** * @brief Defines an array object, which is used to store multiple NDK object. * - * @since 16 + * @since 14 * @version 1.0 */ typedef struct OH_Drawing_Array OH_Drawing_Array; -- Gitee From a2ef1a6c6412f979fbe0edb24578869e5011afc3 Mon Sep 17 00:00:00 2001 From: fandongyu Date: Thu, 26 Dec 2024 12:07:48 +0800 Subject: [PATCH 594/620] Signed-off-by:fandongyu Signed-off-by: fandongyu --- multimedia/image_framework/include/image_source_mdk.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multimedia/image_framework/include/image_source_mdk.h b/multimedia/image_framework/include/image_source_mdk.h index aa5014037..35278f5aa 100644 --- a/multimedia/image_framework/include/image_source_mdk.h +++ b/multimedia/image_framework/include/image_source_mdk.h @@ -310,7 +310,7 @@ struct OhosImageSourceInfo { * @brief Defines the input resource of the image source. It is obtained by calling {@link OH_ImageSource_Create}. * Only one type of resource is accepted at a time. * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 * @deprecated since 11 @@ -437,7 +437,7 @@ struct OhosImageSourceUpdateData { * returns {@link IRNdkErrCode} IMAGE_RESULT_FREAD_FAILED - if read file failed. * @see {@link OhosImageSource}, {@link OhosImageSourceOps} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 * @deprecated since 11 @@ -569,7 +569,7 @@ int32_t OH_ImageSource_CreateFromRawFile(napi_env env, RawFileDescriptor rawFile * returns {@link IRNdkErrCode} IMAGE_RESULT_FREAD_FAILED - if read file failed. * @see {@link OhosImageSource}, {@link OhosImageSourceOps}, {@link OH_ImageSource_UpdateData} * - * @Syscap SystemCapability.Multimedia.Image + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 * @deprecated since 11 -- Gitee From 7d06cc508d269f893052898cb66a82583c40afd9 Mon Sep 17 00:00:00 2001 From: Zhang Jinyu Date: Thu, 26 Dec 2024 17:15:17 +0800 Subject: [PATCH 595/620] =?UTF-8?q?TimePicker=E7=BB=84=E4=BB=B6=E6=94=AF?= =?UTF-8?q?=E6=8C=8112=E5=B0=8F=E6=97=B6=E5=88=B6=E6=97=B6=E4=B8=8A?= =?UTF-8?q?=E5=8D=88=E4=B8=8B=E5=8D=88=E8=B7=9F=E9=9A=8F=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zhang Jinyu --- arkui/ace_engine/native/native_node.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index e008614e1..6fab0769e 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -3735,6 +3735,19 @@ typedef enum { * */ NODE_TIME_PICKER_SELECTED_TEXT_STYLE, + /** + * @brief Defines whether the AM/PM option is cascaded with the time in 12-hour mode. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: whether to enable cascade. The default value is false.\n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether to enable cascade.\n + * + * @since 16 + */ + NODE_TIME_PICKER_ENABLE_CASCADE = 14007, /** * @brief Defines the data selection range of the text picker. -- Gitee From 9ee4928fd3e92270d597f3892e2260f7ee399639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=80=E9=B8=A3?= Date: Thu, 26 Dec 2024 20:26:08 +0800 Subject: [PATCH 596/620] add showCursor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李一鸣 --- .../player_framework/native_avscreen_capture.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index a58f46164..c508cae4f 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -431,6 +431,21 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SkipPrivacyMode(struct OH_AVScree */ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetMaxVideoFrameRate(struct OH_AVScreenCapture *capture, int32_t frameRate); + +/** + * @brief determines whether the cursor is visible in the session + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @param capture Pointer to an OH_AVScreenCapture instance + * @param showCursor The switch of the cursor + * @return Function result code. + * {@link AV_SCREEN_CAPTURE_ERR_OK} if the execution is successful. + * {@link AV_SCREEN_CAPTURE_ERR_INVALID_VAL} input capture is nullptr. + * {@link AV_SCREEN_CAPTURE_ERR_OPERATE_NOT_PERMIT} opertation not be permitted, show cursor failed. + * @since 15 + * @version 1.0 + */ +OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ShowCursor(struct OH_AVScreenCapture *capture, + bool showCursor); #ifdef __cplusplus } #endif -- Gitee From 9439ce7abebadaec128edc21d081c5eb6ee21977 Mon Sep 17 00:00:00 2001 From: Tintin9529 Date: Fri, 27 Dec 2024 13:26:01 +0800 Subject: [PATCH 597/620] checkboxgroup capi Signed-off-by: Tintin9529 --- arkui/ace_engine/native/native_node.h | 135 +++++++++++++++++++++++++- 1 file changed, 134 insertions(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index e9f10a7c8..9c8ecd92e 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -96,6 +96,10 @@ typedef enum { * @since 16 */ ARKUI_NODE_XCOMPONENT_TEXTURE, + /** Check box group. + * @since 16 + */ + ARKUI_NODE_CHECKBOX_GROUP = 21, /** Stack container. */ ARKUI_NODE_STACK = MAX_NODE_SCOPE_NUM, /** Swiper. */ @@ -3520,6 +3524,34 @@ typedef enum { */ NODE_CHECKBOX_SHAPE, + /** + * @brief Defines the name of the checkbox. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .string: component name. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .string: component name. \n + * + * @since 16 + */ + NODE_CHECKBOX_NAME, + + /** + * @brief Defines the name of the checkbox. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .string: component name. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .string: component name. \n + * + * @since 16 + */ + NODE_CHECKBOX_GROUP, + /** * @brief Defines the ID of the component. * This attribute can be set and obtained as required through APIs. @@ -4399,6 +4431,95 @@ typedef enum { */ NODE_IMAGE_ANIMATOR_ITERATION = 19006, + /** + * @brief Defines the name of the checkboxgroup. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .string: component name. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .string: component name. \n + * + * @since 16 + */ + NODE_CHECKBOX_GROUP_NAME = MAX_NODE_SCOPE_NUM * ARKUI_NODE_CHECKBOX_GROUP, + + /** + * @brief Defines whether the checkboxgroup is selected. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: whether the checkboxgroup is selected. + * The value 1 means that the checkboxgroup is selected, and 0 means the opposite. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: The value 1 means that the checkboxgroup is selected, and 0 means the opposite. \n + * + * @since 16 + */ + NODE_CHECKBOX_GROUP_SELECT_ALL, + + /** + * @brief Defines the color of the checkboxgroup when it is selected. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].u32: color of the checkboxgroup when it is selected, in 0xARGB format, + * for example, 0xFF1122FF. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].u32: color of the checkboxgroup when it is selected, in 0xARGB format, for example, 0xFF1122FF. + * + * @since 16 + */ + NODE_CHECKBOX_GROUP_SELECTED_COLOR, + /** + * @brief Defines the border color of the checkboxgroup when it is not selected. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].u32: border color, in 0xARGB format, for example, 0xFF1122FF. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].u32: border color, in 0xARGB format, for example, 0xFF1122FF. + * + * @since 16 + */ + NODE_CHECKBOX_GROUP_UNSELECTED_COLOR, + + /** + * @brief Defines the internal icon style of the checkboxgroup. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].u32: border color, in 0xARGB format, for example, 0xFF1122FF.\n + * .value[1]?.f32: size of the internal mark, in vp. Optional.\n + * .value[2]?.f32: stroke width of the internal mark, in vp. Optional. The default value is 2. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].u32: border color, in 0xARGB format, for example, 0xFF1122FF.\n + * .value[1].f32: size of the internal mark, in vp. \n + * .value[2].f32: stroke width of the internal mark, in vp. The default value is 2. \n + * + * @since 16 + */ + NODE_CHECKBOX_GROUP_MARK, + + /** + * @brief Defines the shape of the checkboxgroup. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: component shape. The parameter type is {@link ArkUI_CheckboxShape}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: component shape. The parameter type is {@link ArkUI_CheckboxShape}. + * + * @since 16 + */ + NODE_CHECKBOX_GROUP_SHAPE, + /** * @brief Defines the alignment mode of the child components in the container. This attribute can be set, reset, * and obtained as required through APIs. @@ -6464,7 +6585,19 @@ typedef enum { * */ NODE_IMAGE_ANIMATOR_EVENT_ON_FINISH = 19004, - + + /** + * @brief Defines the event triggered when the selected status of the ARKUI_NODE_CHECKBOX_GROOUP + * component changes. + * + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * ArkUI_NodeComponentEvent.data[0].i321: selected; 0: not selected.\n + * + * @since 16 + */ + NODE_CHECKBOX_GROUP_EVENT_ON_CHANGE = MAX_NODE_SCOPE_NUM * ARKUI_NODE_CHECKBOX_GROUP, + /** * @brief Defines the event triggered when the index of the currently displayed element of this * ARKUI_NODE_SWIPER instance changes. -- Gitee From ffbcba607916f6e08cf8545b4603d24e6bb1874f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=9E=97=E8=82=AF?= <735001321@qq.com> Date: Fri, 27 Dec 2024 07:32:11 +0000 Subject: [PATCH 598/620] update arkui/ace_engine/native/native_node.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邹林肯 <735001321@qq.com> --- arkui/ace_engine/native/native_node.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index c5c77065d..f416bffc8 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -8142,7 +8142,6 @@ float OH_ArkUI_SystemFontStyleEvent_GetFontWeightScale(const ArkUI_SystemFontSty * {@link ARKUI_ERROR_CODE_NO_ERROR} success. * {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function parameter exception. * {@link ARKUI_ERROR_CODE_CAPI_INIT_ERROR} if the CAPI init error. - * {@link ARKUI_ERROR_CODE_UI_CONTEXT_INVALID} if the uiContext is invalid. * @since 16 */ int32_t OH_ArkUI_NodeUtils_GetAttachedNodeHandleById(const char* id, ArkUI_NodeHandle* node); -- Gitee From 199b93fbc39faee4b0751effd1649f650c8ad261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A6=E5=9B=BD=E5=AE=81?= Date: Wed, 11 Dec 2024 22:22:34 +0800 Subject: [PATCH 599/620] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=9B=91=E5=90=AC=E9=BC=A0=E6=A0=87=E4=BA=8B=E4=BB=B6=E7=9A=84?= =?UTF-8?q?ndk=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 韦国宁 --- arkui/window_manager/libwm.ndk.json | 16 +++++ arkui/window_manager/oh_window_event_filter.h | 70 +++++++++++++++++++ 2 files changed, 86 insertions(+) diff --git a/arkui/window_manager/libwm.ndk.json b/arkui/window_manager/libwm.ndk.json index 3ed362ce4..eef5bc066 100644 --- a/arkui/window_manager/libwm.ndk.json +++ b/arkui/window_manager/libwm.ndk.json @@ -6,5 +6,21 @@ { "first_instroduced":"12", "name":"OH_NativeWindowManager_UnregisterKeyEventFilter" + }, + { + "first_instroduced":"15", + "name":"OH_NativeWindowManager_RegisterMouseEventFilter" + }, + { + "first_instroduced":"15", + "name":"OH_NativeWindowManager_UnregisterMouseEventFilter" + }, + { + "first_instroduced":"15", + "name":"OH_NativeWindowManager_RegisterTouchEventFilter" + }, + { + "first_instroduced":"15", + "name":"OH_NativeWindowManager_UnregisterTouchEventFilter" } ] \ No newline at end of file diff --git a/arkui/window_manager/oh_window_event_filter.h b/arkui/window_manager/oh_window_event_filter.h index e4651cd59..56a726525 100644 --- a/arkui/window_manager/oh_window_event_filter.h +++ b/arkui/window_manager/oh_window_event_filter.h @@ -75,6 +75,76 @@ WindowManager_ErrorCode OH_NativeWindowManager_RegisterKeyEventFilter(int32_t wi */ WindowManager_ErrorCode OH_NativeWindowManager_UnregisterKeyEventFilter(int32_t windowId); +/** + * @brief the callback function type when mouseEvent was filter + * @param mouseEvent multimodal mouseEvent + * @since 15 + */ +typedef bool (*OH_NativeWindowManager_MouseEventFilter)(Input_MouseEvent* mouseEvent); + +/** + * @brief Registers a filter callback for the window, the callback is called when the + * window is dispatched to the event + * + * @param windowId windowId when window is created + * @param mouseEventFilter mouse event callback, called when the window is dispatched + * to the event + * @return Returns the status code of the execution. + * Returns {@link OK} if the operation is successful. + * Returns {@link INVAILD_WINDOW_ID} if the window id is invalid. + * Returns {@link SERVICE_ERROR} if the window manager service error occurs. + * @since 15 + */ +WindowManager_ErrorCode OH_NativeWindowManager_RegisterMouseEventFilter(int32_t windowId, + OH_NativeWindowManager_MouseEventFilter mouseEventFilter); + +/** + * @brief clear callback for the window + * + * @param windowId windowId when window is created + * @return Returns the status code of the execution. + * Returns {@link OK} if the operation is successful. + * Returns {@link INVAILD_WINDOW_ID} if the window id is invalid. + * Returns {@link SERVICE_ERROR} if the window manager service error occurs. + * @since 15 + */ +WindowManager_ErrorCode OH_NativeWindowManager_UnregisterMouseEventFilter(int32_t windowId); + +/** + * @brief the callback function type when touchEvent was filter + * @param touchEvent multimodal touchEvent + * @since 15 + */ +typedef bool (*OH_NativeWindowManager_TouchEventFilter)(Input_TouchEvent* touchEvent); + +/** + * @brief Registers a filter callback for the window, the callback is called when the + * window is dispatched to the event + * + * @param windowId windowId when window is created + * @param touchEventFilter touch event callback, called when the window is dispatched + * to the event + * @return Returns the status code of the execution. + * Returns {@link OK} if the operation is successful. + * Returns {@link INVAILD_WINDOW_ID} if the window id is invalid. + * Returns {@link SERVICE_ERROR} if the window manager service error occurs. + * @since 15 + */ +WindowManager_ErrorCode OH_NativeWindowManager_RegisterTouchEventFilter(int32_t windowId, + OH_NativeWindowManager_TouchEventFilter touchEventFilter); + +/** + * @brief clear callback for the window + * + * @param windowId windowId when window is created + * @return Returns the status code of the execution. + * Returns {@link OK} if the operation is successful. + * Returns {@link INVAILD_WINDOW_ID} if the window id is invalid. + * Returns {@link SERVICE_ERROR} if the window manager service error occurs. + * @since 15 + */ +WindowManager_ErrorCode OH_NativeWindowManager_UnregisterTouchEventFilter(int32_t windowId); + #ifdef __cplusplus } #endif -- Gitee From d3660e27f45ea1b8831ec75c13ec07912579deb2 Mon Sep 17 00:00:00 2001 From: yangqirun Date: Sat, 28 Dec 2024 09:08:47 +0800 Subject: [PATCH 600/620] fix interface error Signed-off-by: yangqirun Change-Id: I9008a4df756625aa42618e30ca06f16a5cc9266c --- hiviewdfx/hiappevent/include/hiappevent/hiappevent.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h index a159aae9b..a71e1d86e 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h @@ -732,7 +732,7 @@ int OH_HiAppEvent_SetCustomConfig(HiAppEvent_Processor* processor, const char* k * @param configId The configId of processor. * @return set result. * {@link HIAPPEVENT_SUCCESS} The operation is successful. - * {@link HIAPPEVENT_INVALID_PROCESSOR} The processor is nullptr. + * {@link HIAPPEVENT_PROCESSOR_IS_NULL} The processor is nullptr. * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. * {@link HIAPPEVENT_INVALID_UID} Invalid uid. * @since 16 @@ -747,7 +747,7 @@ int OH_HiAppEvent_SetConfigId(HiAppEvent_Processor* processor, int configId); * @param size The size of userIdNames array. * @return set result. * {@link HIAPPEVENT_SUCCESS} The operation is successful. - * {@link HIAPPEVENT_INVALID_PROCESSOR} The processor is nullptr. + * {@link HIAPPEVENT_PROCESSOR_IS_NULL} The processor is nullptr. * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. * {@link HIAPPEVENT_INVALID_UID} Invalid uid. * {@link HIAPPEVENT_INVALID_PARAM_VALUE_LENGTH} Invalid param value length. @@ -763,7 +763,7 @@ int OH_HiAppEvent_SetReportUserId(HiAppEvent_Processor* processor, const char* c * @param size The size of userPropertyNames array. * @return set result. * {@link HIAPPEVENT_SUCCESS} The operation is successful. - * {@link HIAPPEVENT_INVALID_PROCESSOR} The processor is nullptr. + * {@link HIAPPEVENT_PROCESSOR_IS_NULL} The processor is nullptr. * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. * {@link HIAPPEVENT_INVALID_UID} Invalid uid. * {@link HIAPPEVENT_INVALID_PARAM_VALUE_LENGTH} Invalid param value length. @@ -777,7 +777,7 @@ int OH_HiAppEvent_SetReportUserProperty(HiAppEvent_Processor* processor, const c * * @param processor The pointer to the HiAppEvent_Processor instance. * @return process id if set is successful. - * {@link HIAPPEVENT_INVALID_PROCESSOR} The processor is nullptr. + * {@link HIAPPEVENT_PROCESSOR_IS_NULL} The processor is nullptr. * {@link HIAPPEVENT_INVALID_PARAM_VALUE} Invalid Param value. * {@link HIAPPEVENT_OPERATE_FAILED} Name not found or register processor error. * {@link HIAPPEVENT_INVALID_UID} Invalid uid. @@ -791,7 +791,7 @@ int64_t OH_HiAppEvent_AddProcessor(HiAppEvent_Processor* processor); * @param processor The pointer to the HiAppEvent_Processor instance. * @since 16 */ -void OH_HiAppEvent_DestoryProcessor(HiAppEvent_Processor* processor); +void OH_HiAppEvent_DestroyProcessor(HiAppEvent_Processor* processor); /** * @brief The interface to remove processor. -- Gitee From d7281c7968ed7f9523c9006a9cdf76e2187904f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E6=97=AD?= Date: Sat, 28 Dec 2024 01:34:18 +0000 Subject: [PATCH 601/620] update multimodalinput/kits/c/input/oh_input_manager.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 郭旭 --- multimodalinput/kits/c/input/oh_input_manager.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 38470f93d..0969d87e1 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -249,6 +249,8 @@ typedef enum Input_Result { INPUT_NOT_SYSTEM_APPLICATION = 202, /** @error Parameter check failed */ INPUT_PARAMETER_ERROR = 401, + /** @error Device not support */ + INPUT_DEVICE_NOT_SUPPORTED = 801, /** @error Service error */ INPUT_SERVICE_EXCEPTION = 3800001, /** @error Interceptor repeatedly created for an application */ @@ -1328,7 +1330,8 @@ void OH_Input_SetPreKeys(Input_Hotkey *hotkey, int32_t *preKeys, int32_t size); * @return OH_Input_GetPreKeys status code, specifically, * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} The hotkey is NULL or the pressedKeys is NULL or the pressedKeyCount - * is NULL.\n + * is NULL;\n + * {@Link INPUT_DEVICE_NOT_SUPPORTED} Capability not supported.\n * @syscap SystemCapability.MultimodalInput.Input.Core * @since 14 */ @@ -1351,7 +1354,8 @@ void OH_Input_SetFinalKey(Input_Hotkey *hotkey, int32_t finalKey); * @param finalKeyCode Returns the key value of the decorated key. * @return OH_Input_GetfinalKey status code, specifically, * {@link INPUT_SUCCESS} if the operation is successful;\n - * {@link INPUT_PARAMETER_ERROR} The hotkey is NULL or the finalKeyCode is NULL.\n + * {@link INPUT_PARAMETER_ERROR} The hotkey is NULL or the finalKeyCode is NULL;\n + * {@Link INPUT_DEVICE_NOT_SUPPORTED} Capability not supported.\n * @syscap SystemCapability.MultimodalInput.Input.Core * @since 14 */ @@ -1390,7 +1394,8 @@ void OH_Input_DestroyAllSystemHotkeys(Input_Hotkey **hotkeys, int32_t count); * @return OH_Input_GetAllSystemHotkeys status code, specifically, * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} The hotkey or count is NULL, or the value of count does not match the number - * of system shortcut keys supported by the system. + * of system shortcut keys supported by the system; + * {@Link INPUT_DEVICE_NOT_SUPPORTED} Capability not supported.\n * @syscap SystemCapability.MultimodalInput.Input.Core * @since 14 */ @@ -1414,7 +1419,8 @@ void OH_Input_SetRepeat(Input_Hotkey* hotkey, bool isRepeat); * @param isRepeat Whether a key event is repeated. * @return OH_Input_GetIsRepeat status code, specifically, * {@link INPUT_SUCCESS} if the operation is successful;\n - * {@link INPUT_PARAMETER_ERROR} otherwise.\n + * {@link INPUT_PARAMETER_ERROR} otherwise;\n + * {@Link INPUT_DEVICE_NOT_SUPPORTED} Capability not supported.\n * @syscap SystemCapability.MultimodalInput.Input.Core * @since 14 */ @@ -1428,6 +1434,7 @@ Input_Result OH_Input_GetRepeat(const Input_Hotkey* hotkey, bool *isRepeat); * @return OH_Input_AddHotkeyMonitor status code, specifically, * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} if hotkey or callback is NULL;\n + * {@Link INPUT_DEVICE_NOT_SUPPORTED} Capability not supported;\n * {@Link INPUT_OCCUPIED_BY_SYSTEM} The hotkey has been used by the system. You can call the {@Link * GetAllSystemHotkeys} interface to query all system shortcut keys.\n * {@Link INPUT_OCCUPIED_BY_OTHER} The hotkey has been subscribed to by another.\n @@ -1444,6 +1451,7 @@ Input_Result OH_Input_AddHotkeyMonitor(const Input_Hotkey* hotkey, Input_HotkeyC * @return OH_Input_RemoveHotkeyMonitor status code, specifically, * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} if hotkey or callback is NULL;\n + * {@Link INPUT_DEVICE_NOT_SUPPORTED} Capability not supported.\n * @syscap SystemCapability.MultimodalInput.Input.Core * @since 14 */ -- Gitee From 07954853457091c6e33e140cb73c80d0a8ec2cf0 Mon Sep 17 00:00:00 2001 From: zhangjinyu101 Date: Thu, 12 Dec 2024 16:20:59 +0800 Subject: [PATCH 602/620] =?UTF-8?q?TimePicker=E7=BB=84=E4=BB=B6=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=85=8D=E7=BD=AE=E5=BC=80=E5=A7=8B=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=92=8C=E7=BB=93=E6=9D=9F=E6=97=B6=E9=97=B4C=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangjinyu101 --- arkui/ace_engine/native/native_node.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index bf7955e8f..01b682059 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -3808,6 +3808,32 @@ typedef enum { * */ NODE_TIME_PICKER_SELECTED_TEXT_STYLE, + /** + * @brief Defines the start time of the time picker. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .string: time. The default value is "00:00:00".\n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .string: time. The default value is "00:00:00".\n + * + * @since 16 + */ + NODE_TIME_PICKER_START = 14005, + /** + * @brief Defines the end time of the time picker. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .string: time. The default value is "23:59:59".\n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .string: time. The default value is "23:59:59".\n + * + * @since 16 + */ + NODE_TIME_PICKER_END = 14006, /** * @brief Defines whether the AM/PM option is cascaded with the time in 12-hour mode. * This attribute can be set, reset, and obtained as required through APIs. -- Gitee From c9bede39ec19288f70dadbd36c88c3b2435e2d76 Mon Sep 17 00:00:00 2001 From: yangxuguang-huawei Date: Sun, 15 Dec 2024 16:06:58 +0800 Subject: [PATCH 603/620] feat: add StartSelfUIAbility Signed-off-by: yangxuguang-huawei --- .../ability_runtime/ability_runtime_common.h | 65 +++++++++++++++++++ .../ability_runtime/application_context.h | 27 ++++++++ .../libability_runtime.ndk.json | 4 ++ 3 files changed, 96 insertions(+) diff --git a/AbilityKit/ability_runtime/ability_runtime_common.h b/AbilityKit/ability_runtime/ability_runtime_common.h index e4cf556e4..228ae33b0 100644 --- a/AbilityKit/ability_runtime/ability_runtime_common.h +++ b/AbilityKit/ability_runtime/ability_runtime_common.h @@ -49,10 +49,75 @@ extern "C" { typedef enum { /** @error No error. */ ABILITY_RUNTIME_ERROR_CODE_NO_ERROR = 0, + /** + * @error permission denied. + * @since 15 + */ + ABILITY_RUNTIME_ERROR_CODE_PERMISSION_DENIED = 201, /** @error Invalid parameters. */ ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID = 401, + /** + * @error StartSelfUIAbility is not supported. + * @since 15 + */ + ABILITY_RUNTIME_ERROR_CODE_NOT_SUPPORTED = 801, + /** + * @error No such ability. + * @since 15 + */ + ABILITY_RUNTIME_ERROR_CODE_NO_SUCH_ABILITY = 16000001, + /** + * @error Incorrect ability type. + * @since 15 + */ + ABILITY_RUNTIME_ERROR_CODE_INCORRECT_ABILITY_TYPE = 16000002, + /** + * @error Starting invisible ability is not allowed. + * @since 15 + */ + ABILITY_RUNTIME_ERROR_CODE_INVISIBLE = 16000004, + /** + * @error Cross-user start app is not allowed. + * @since 15 + */ + ABILITY_RUNTIME_ERROR_CODE_CROSS_USER = 16000006, + /** + * @error The crowdtesting application expires. + * @since 15 + */ + ABILITY_RUNTIME_ERROR_CODE_CROWDTEST_EXPIRED = 16000008, + /** + * @error The ability cannot be started in Wukong Mode. + * @since 15 + */ + ABILITY_RUNTIME_ERROR_CODE_WUKONG_MODE = 16000009, /** @error The context does not exist. */ ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST = 16000011, + /** + * @error The app is controlled. + * @since 15 + */ + ABILITY_RUNTIME_ERROR_CODE_CONTROLLED = 16000012, + /** + * @error The app is controlled by EDM. + * @since 15 + */ + ABILITY_RUNTIME_ERROR_CODE_EDM_CONTROLLED = 16000013, + /** + * @error Cross-app start is not allowed. + * @since 15 + */ + ABILITY_RUNTIME_ERROR_CODE_CROSS_APP = 16000018, + /** + * @error Internal error. + * @since 15 + */ + ABILITY_RUNTIME_ERROR_CODE_INTERNAL = 16000050, + /** + * @error Not top ability. + * @since 15 + */ + ABILITY_RUNTIME_ERROR_CODE_NOT_TOP_ABILITY = 16000053, } AbilityRuntime_ErrorCode; #ifdef __cplusplus diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index 4ac78aa5a..41b340af9 100644 --- a/AbilityKit/ability_runtime/application_context.h +++ b/AbilityKit/ability_runtime/application_context.h @@ -39,6 +39,7 @@ #include #include +#include #include "ability_runtime_common.h" #include "context_constant.h" @@ -211,6 +212,32 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetDistributedFiles AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetCloudFileDir( char* buffer, const int32_t bufferSize, int32_t* writeLength); +/** + * @brief Starts self UIAbility. + * + * @permission {@code ohos.permission.NDK_START_SELF_UI_ABILITY} + * @param want The arguments passed to start self UIAbility. + * For details, see {@link AbilityRuntime_Want}. + * @return Returns {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the call is successful.\n + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_PERMISSION_DENIED} if the caller has no correct permission.\n + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_INVALID_PARAM} if the arguments provided is invalid.\n + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_NOT_SUPPORTED} if the device does not support starting self uiability.\n + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_NO_SUCH_ABILITY} if the target ability does not exist.\n + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_INCORRECT_ABILITY_TYPE} if the ability type is incorrect.\n + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_INVISIBLE} if the target ability is invisible.\n + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_CROSS_USER} if the caller tries to start cross-user ability.\n + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_CROWDTEST_EXPIRED} if the crowdtesting application expires.\n + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_WUKONG_MODE} if the ability cannot be started in Wukong mode.\n + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_CONTROLLED} if the app is controlled.\n + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_EDM_CONTROLLED} if the app is controlled by EDM.\n + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_CROSS_APP} if the caller tries to start a different application.\n + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_INTERNAL} if internal error occurs.\n + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_NOT_TOP_ABILITY} if the caller is not top ability.\n + * For details, see {@link AbilityRuntime_ErrorCode}. + * @since 15 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbility(AbilityRuntime_Want *want); + #ifdef __cplusplus } // extern "C" #endif diff --git a/AbilityKit/ability_runtime/libability_runtime.ndk.json b/AbilityKit/ability_runtime/libability_runtime.ndk.json index fcde96f6c..4ef2c9800 100644 --- a/AbilityKit/ability_runtime/libability_runtime.ndk.json +++ b/AbilityKit/ability_runtime/libability_runtime.ndk.json @@ -11,6 +11,10 @@ "first_introduced": "13", "name": "OH_AbilityRuntime_ApplicationContextGetBundleName" }, + { + "first_introduced": "15", + "name": "OH_AbilityRuntime_StartSelfUIAbility" + }, { "first_introduced": "16", "name": "OH_AbilityRuntime_ApplicationContextGetTempDir" -- Gitee From 142ba68a0fe4706606736c21872c5562f0374ef8 Mon Sep 17 00:00:00 2001 From: liumingxiang Date: Sat, 28 Dec 2024 20:13:30 +0800 Subject: [PATCH 604/620] =?UTF-8?q?=E6=B7=BB=E5=8A=A0since?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liumingxiang --- .../graphic_2d/native_drawing/drawing_text_font_descriptor.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h index adf1c2cde..40efcb930 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h @@ -60,7 +60,10 @@ typedef enum { STYLISH = 1 << 2, /** Installed font types */ INSTALLED = 1 << 3, - /** Customized font types */ + /** + * Customized font types + * @since 16 + */ CUSTOMIZED = 1 << 4, } OH_Drawing_SystemFontType; -- Gitee From 1ea4a87a12bcb11b86f80f32a81e6a861d3ac14b Mon Sep 17 00:00:00 2001 From: liumingxiang Date: Sat, 28 Dec 2024 21:25:16 +0800 Subject: [PATCH 605/620] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liumingxiang --- .../graphic_2d/native_drawing/drawing_text_font_descriptor.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h index 40efcb930..fbd6b51eb 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_font_descriptor.h @@ -60,10 +60,7 @@ typedef enum { STYLISH = 1 << 2, /** Installed font types */ INSTALLED = 1 << 3, - /** - * Customized font types - * @since 16 - */ + /** Customized font types */ CUSTOMIZED = 1 << 4, } OH_Drawing_SystemFontType; -- Gitee From 7e21a936d3663cfc6185bf411d1bad6705f3a7b1 Mon Sep 17 00:00:00 2001 From: yangxuguang-huawei Date: Sun, 29 Dec 2024 11:08:23 +0800 Subject: [PATCH 606/620] feat: change AbilityRuntime_Want to AbilityBase_Want Signed-off-by: yangxuguang-huawei Change-Id: I429d9add58a8aa545a65e4f306258d5dbd2ef61c --- AbilityKit/ability_runtime/application_context.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index 41b340af9..c42fee6ca 100644 --- a/AbilityKit/ability_runtime/application_context.h +++ b/AbilityKit/ability_runtime/application_context.h @@ -217,7 +217,7 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetCloudFileDir( * * @permission {@code ohos.permission.NDK_START_SELF_UI_ABILITY} * @param want The arguments passed to start self UIAbility. - * For details, see {@link AbilityRuntime_Want}. + * For details, see {@link AbilityBase_Want}. * @return Returns {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the call is successful.\n * Returns {@link ABILITY_RUNTIME_ERROR_CODE_PERMISSION_DENIED} if the caller has no correct permission.\n * Returns {@link ABILITY_RUNTIME_ERROR_CODE_INVALID_PARAM} if the arguments provided is invalid.\n @@ -236,7 +236,7 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetCloudFileDir( * For details, see {@link AbilityRuntime_ErrorCode}. * @since 15 */ -AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbility(AbilityRuntime_Want *want); +AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbility(AbilityBase_Want *want); #ifdef __cplusplus } // extern "C" -- Gitee From a3287b166ff8a7bd3449a009432e8e6309b0cc1a Mon Sep 17 00:00:00 2001 From: liujiaxing19 Date: Mon, 30 Dec 2024 11:38:55 +0800 Subject: [PATCH 607/620] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liujiaxing19 Change-Id: I1e94cdb053ee400bf5f265fd0486e2a509f7c8f3 --- hiviewdfx/hiappevent/include/hiappevent/hiappevent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h index a159aae9b..05e13e7e7 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h @@ -812,7 +812,7 @@ int OH_HiAppEvent_RemoveProcessor(int64_t processorId); * @return Returns a pointer to the HiAppEvent_Config instance. * @since 16 */ -HiAppEvent_Config* OH_HiAppEvent_CreateConfig(); +HiAppEvent_Config* OH_HiAppEvent_CreateConfig(void); /** * @brief Destroy the specified HiAppEvent_Config handle resource. -- Gitee From 6fdef2e400550fe5b7c89d5bf741697a901f2393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=9E=97=E8=82=AF?= <735001321@qq.com> Date: Mon, 30 Dec 2024 07:46:14 +0000 Subject: [PATCH 608/620] update arkui/ace_engine/native/native_node.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邹林肯 <735001321@qq.com> --- arkui/ace_engine/native/native_node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index f416bffc8..51a0c93f2 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -8134,7 +8134,7 @@ float OH_ArkUI_SystemFontStyleEvent_GetFontSizeScale(const ArkUI_SystemFontStyle float OH_ArkUI_SystemFontStyleEvent_GetFontWeightScale(const ArkUI_SystemFontStyleEvent* event); /** - * @brief Get the node handle by id. This interface only works on the main thread. + * @brief Get the node handle by id. * * @param id The id of the target node handle. * @param node The handle of target node handle. -- Gitee From 06dfdd7978322a8027ac3b57d293bb1e174641a6 Mon Sep 17 00:00:00 2001 From: liumingxiang1 Date: Wed, 11 Dec 2024 20:45:28 +0800 Subject: [PATCH 609/620] =?UTF-8?q?word=20break=E6=96=B0=E5=A2=9E=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=EF=BC=9AWORD=5FBREAK=5FTYPE=5FBREAK=5FHYPHEN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liumingxiang1 --- graphic/graphic_2d/native_drawing/drawing_text_typography.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 275f0af37..ecac4517d 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -279,6 +279,11 @@ typedef enum { WORD_BREAK_TYPE_BREAK_ALL = 1, /** Break Word type */ WORD_BREAK_TYPE_BREAK_WORD = 2, + /** + * Break word with hyphens + * @since 16 + */ + WORD_BREAK_TYPE_BREAK_HYPHEN = 3, } OH_Drawing_WordBreakType; /** -- Gitee From ded35781108b12cd9eb0d28fd4eca3eb757a64d6 Mon Sep 17 00:00:00 2001 From: zhuhan Date: Tue, 17 Dec 2024 10:45:42 +0800 Subject: [PATCH 610/620] cwant Signed-off-by: zhuhan Change-Id: I9a4f52097d5d76fd51339b621c030aa149fed5f4 --- AbilityKit/ability_base/BUILD.gn | 34 ++++ AbilityKit/ability_base/ability_base_common.h | 61 +++++++ .../ability_base/libability_base_want.json | 34 ++++ AbilityKit/ability_base/want.h | 169 ++++++++++++++++++ ndk_targets.gni | 2 + 5 files changed, 300 insertions(+) create mode 100644 AbilityKit/ability_base/BUILD.gn create mode 100644 AbilityKit/ability_base/ability_base_common.h create mode 100644 AbilityKit/ability_base/libability_base_want.json create mode 100644 AbilityKit/ability_base/want.h diff --git a/AbilityKit/ability_base/BUILD.gn b/AbilityKit/ability_base/BUILD.gn new file mode 100644 index 000000000..7965528f8 --- /dev/null +++ b/AbilityKit/ability_base/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") +ohos_ndk_headers("ability_base_want_ndk_header") { + dest_dir = "$ndk_headers_out_dir/AbilityKit/ability_base" + sources = [ + "./ability_base_common.h", + "./want.h", + ] +} + +ohos_ndk_library("libability_base_want") { + output_name = "ability_base_want" + output_extension = "so" + system_capability = "SystemCapability.Ability.AbilityBase" + ndk_description_file = "./libability_base_want.json" + min_compact_version = "15" + system_capability_headers = [ + "AbilityKit/ability_base/ability_base_common.h", + "AbilityKit/ability_base/want.h", + ] +} diff --git a/AbilityKit/ability_base/ability_base_common.h b/AbilityKit/ability_base/ability_base_common.h new file mode 100644 index 000000000..382f72910 --- /dev/null +++ b/AbilityKit/ability_base/ability_base_common.h @@ -0,0 +1,61 @@ +/* +* Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup AbilityBase + * @{ + * + * @brief Provide the definition of the C interface for the native AbilityBase + * + * @syscap SystemCapability.Ability.AbilityBase + * @since 15 + */ + +/** + * @file ability_base_common.h + * + * @brief Declare the common types for the native AbilityBase. + * + * @library libability_base_want.so + * @kit AbilityKit + * @syscap SystemCapability.Ability.AbilityBase + * @since 15 + */ + +#ifndef ABILITY_BASE_COMMON_H +#define ABILITY_BASE_COMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the error codes. + * + * @since 15 + */ +typedef enum { + /** @error No error. */ + ABILITY_BASE_ERROR_CODE_NO_ERROR = 0, + /** @error Invalid parameters. */ + ABILITY_BASE_ERROR_CODE_PARAM_INVALID = 401, +} AbilityBase_ErrorCode; + +#ifdef __cplusplus +} +#endif + +/** @} */ +#endif // ABILITY_BASE_COMMON_H diff --git a/AbilityKit/ability_base/libability_base_want.json b/AbilityKit/ability_base/libability_base_want.json new file mode 100644 index 000000000..efde6fe47 --- /dev/null +++ b/AbilityKit/ability_base/libability_base_want.json @@ -0,0 +1,34 @@ +[ + { + "first_introduced": "15", + "name": "OH_AbilityBase_CreateWant" + }, + { + "first_introduced": "15", + "name": "OH_AbilityBase_DestroyWant" + }, + { + "first_introduced": "15", + "name": "OH_AbilityBase_SetWantElement" + }, + { + "first_introduced": "15", + "name": "OH_AbilityBase_GetWantElement" + }, + { + "first_introduced": "15", + "name": "OH_AbilityBase_SetWantCharParam" + }, + { + "first_introduced": "15", + "name": "OH_AbilityBase_GetWantCharParam" + }, + { + "first_introduced": "15", + "name": "OH_AbilityBase_AddWantFd" + }, + { + "first_introduced": "15", + "name": "OH_AbilityBase_GetWantFd" + } +] \ No newline at end of file diff --git a/AbilityKit/ability_base/want.h b/AbilityKit/ability_base/want.h new file mode 100644 index 000000000..49110a541 --- /dev/null +++ b/AbilityKit/ability_base/want.h @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup AbilityBase + * @{ + * + * @brief Describe the functions of want. + * + * @syscap SystemCapability.Ability.AbilityBase + * @since 15 + */ + +/** + * @file want.h + * + * @brief Defines the want APIs. + * + * @library libability_base_want.so + * @kit AbilityKit + * @syscap SystemCapability.Ability.AbilityBase + * @since 15 + */ + +#ifndef ABILITY_BASE_WANT_H +#define ABILITY_BASE_WANT_H + +#include +#include +#include "ability_base_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Indicates information of element. + * + * @since 15 + */ +typedef struct AbilityBase_Element { + /** Indicates the name of application. */ + char* bundleName; + /** Indicates the name of module. */ + char* moduleName; + /** Indicates the name of ability. */ + char* abilityName; +} AbilityBase_Element; + +struct AbilityBase_Want; +typedef struct AbilityBase_Want AbilityBase_Want; + +/** + * @brief Create want. + * + * @param element Information of element. + * @return Returns the newly created AbilityBase_Want object. + * + * @since 15 + */ +AbilityBase_Want* OH_AbilityBase_CreateWant(AbilityBase_Element element); + +/** + * @brief Destroy input want. + * + * @param want The want to be deleted. + * @return The error code. + * {@link ABILITY_BASE_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_BASE_ERROR_CODE_PARAM_INVALID} if the want is invalid. + * @since 15 + */ +AbilityBase_ErrorCode OH_AbilityBase_DestroyWant(AbilityBase_Want* want); + +/** + * @brief Set want element. + * + * @param want The want that needs to be set element. + * @param element Information of element. + * @return The error code. + * {@link ABILITY_BASE_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_BASE_ERROR_CODE_PARAM_INVALID} if the want is invalid. + * @since 15 + */ +AbilityBase_ErrorCode OH_AbilityBase_SetWantElement(AbilityBase_Want* want, AbilityBase_Element element); + +/** + * @brief Get want element. + * + * @param want The want for the element that has been obtained. + * @param element The element obtained from want. + * @return The error code. + * {@link ABILITY_BASE_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_BASE_ERROR_CODE_PARAM_INVALID} if the want or element is invalid. + * @since 15 + */ +AbilityBase_ErrorCode OH_AbilityBase_GetWantElement(AbilityBase_Want* want, AbilityBase_Element* element); + +/** + * @brief Set want char param. + * + * @param want The want needs to be set char param. + * @param key The key of char param. + * @param value The value of char param. + * @return The error code. + * {@link ABILITY_BASE_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_BASE_ERROR_CODE_PARAM_INVALID} if the input parameters are invalid. + * @since 15 + */ +AbilityBase_ErrorCode OH_AbilityBase_SetWantCharParam(AbilityBase_Want* want, const char* key, const char* value); + +/** + * @brief Get want char param. + * + * @param want The want for the char param that has been obtained. + * @param key The key of char param. + * @param value The value of char param. + * @param valueSize Size of the value. + * @return The error code. + * {@link ABILITY_BASE_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_BASE_ERROR_CODE_PARAM_INVALID} if the input parameters are invalid. + * @since 15 + */ +AbilityBase_ErrorCode OH_AbilityBase_GetWantCharParam(AbilityBase_Want* want, const char* key, + char* value, size_t valueSize); + +/** + * @brief Add fd to want. + * + * @param want The want needs to be add fd. + * @param key The key of the fd. + * @param fd File Descriptor. + * @return The error code. + * {@link ABILITY_BASE_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_BASE_ERROR_CODE_PARAM_INVALID} if the input parameters are invalid. + * @since 15 + */ +AbilityBase_ErrorCode OH_AbilityBase_AddWantFd(AbilityBase_Want* want, const char* key, int32_t fd); + +/** + * @brief Get fd from want. + * + * @param want The want that includes fd. + * @param key The key of the fd. + * @param fd File Descriptor. + * @return The error code. + * {@link ABILITY_BASE_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_BASE_ERROR_CODE_PARAM_INVALID} if the input parameters are invalid. + * @since 15 + */ +AbilityBase_ErrorCode OH_AbilityBase_GetWantFd(AbilityBase_Want* want, const char* key, int32_t* fd); + +#ifdef __cplusplus +} // extern "C" +#endif + +/** @} */ +#endif // ABILITY_BASE_WANT_H diff --git a/ndk_targets.gni b/ndk_targets.gni index a97312222..aaccc9a7d 100644 --- a/ndk_targets.gni +++ b/ndk_targets.gni @@ -55,6 +55,8 @@ _ndk_library_targets = [ "//interface/sdk_c/ability/ability_runtime/child_process:libchild_process", "//interface/sdk_c/AbilityKit/ability_runtime:ability_runtime_ndk_header", "//interface/sdk_c/AbilityKit/ability_runtime:libability_runtime", + "//interface/sdk_c/AbilityKit/ability_base:ability_base_want_ndk_header", + "//interface/sdk_c/AbilityKit/ability_base:libability_base_want", "//interface/sdk_c/arkui/ace_engine/native:ace_header", "//interface/sdk_c/arkui/ace_engine/native:arkui_header", "//interface/sdk_c/arkui/ace_engine/native:libace_ndk", -- Gitee From 30fd7d11107dfe84e29ce7c72e17d20fd61520a4 Mon Sep 17 00:00:00 2001 From: Zhang Jinyu Date: Wed, 1 Jan 2025 14:47:48 +0800 Subject: [PATCH 611/620] =?UTF-8?q?DatePicker=E7=BB=84=E4=BB=B6=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=85=8D=E7=BD=AE=E8=A6=81=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E5=88=97C=E6=8E=A5=E5=8F=A3=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zhang Jinyu --- arkui/ace_engine/native/native_node.h | 13 +++++++++++++ arkui/ace_engine/native/native_type.h | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index d62a76a0a..5d7afe068 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -3711,6 +3711,19 @@ typedef enum { * */ NODE_DATE_PICKER_SELECTED_TEXT_STYLE, + /** + * @brief Defines the mode of the date picker. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * value[0].i32: the mode. The value is and enum of {@link ArkUI_DatePickerMode}.\n. + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * value[0].i32: the mode. The value is and enum of {@link ArkUI_DatePickerMode}.\n. + * + * @since 16 + */ + NODE_DATE_PICKER_MODE = 13007, /** * @brief Defines the time of the selected item. in the timer picker. * This attribute can be set, reset, and obtained as required through APIs. diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 18f28994e..05352dd08 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -535,6 +535,20 @@ typedef enum { ARKUI_SHADOW_TYPE_BLUR } ArkUI_ShadowType; +/** + * @brief Enumerates the modes of the date picker. + * + * @since 16 + */ +typedef enum { + /** A mode that displays the date in months, days of month, and years. */ + ARKUI_DATEPICKER_MODE_DATE = 0, + /** A mode that displays the date in months and years. */ + ARKUI_DATEPICKER_YEAR_AND_MONTH = 1, + /** A mode that displays the date in months and days of the month. */ + ARKUI_DATEPICKER_MONTH_AND_DAY = 2, +} ArkUI_DatePickerMode; + /** * @brief Enumerates the types of the text picker. * -- Gitee From 48f8f4e563ca68b13102664545b0a877f1f0747d Mon Sep 17 00:00:00 2001 From: sunxuejiao Date: Thu, 12 Dec 2024 16:52:02 +0800 Subject: [PATCH 612/620] feat: add pasteboard progress interface Signed-off-by: sunxuejiao --- .../pasteboard/include/oh_pasteboard.h | 128 ++++++++++++++++++ .../include/oh_pasteboard_err_code.h | 20 +++ .../pasteboard/libpasteboard.ndk.json | 4 + 3 files changed, 152 insertions(+) diff --git a/distributeddatamgr/pasteboard/include/oh_pasteboard.h b/distributeddatamgr/pasteboard/include/oh_pasteboard.h index 15d489623..9b68da156 100644 --- a/distributeddatamgr/pasteboard/include/oh_pasteboard.h +++ b/distributeddatamgr/pasteboard/include/oh_pasteboard.h @@ -63,6 +63,120 @@ typedef enum Pasteboard_NotifyType { NOTIFY_REMOTE_DATA_CHANGE = 2 } Pasteboard_NotifyType; +/** + * @brief Enumerates the types of file confilct options when getting data from the Pastedboard. + * + * @since 15 + */ +typedef enum Pasteboard_FileConflictOption { + /** + * @brief Overwrite when destUir has file with same name. + */ + OH_PASTEBOARD_OVERWRITE = 0, + /** + * @brief Skip when destUir has file with same name. + */ + OH_PASTEBOARD_SKIP = 1 +} Pasteboard_FileConflictOption; + +/** + * @brief Enumerates the types of progress indicator when getting data from the Pastedboard. + * + * @since 15 + */ +typedef enum Pasteboard_ProgressIndicator { + /** + * @brief Getting data without system default progress indicator. + */ + OH_PASTEBOARD_NONE = 0, + /** + * @brief Getting data with system default progress indicator. + */ + OH_PASTEBOARD_DEFAULT = 1 +} Pasteboard_ProgressIndicator; + +/** + * @brief Represents the Pasteboard progress information. + * + * @since 15 + */ +typedef struct Pasteboard_ProgressInfo { + /** Percentage of progress when getting PasteData without using default system progress. + */ + int progress; +} Pasteboard_ProgressInfo; + +/** + * @brief Defines the callback function used to return the progress information when getting OH_UdmfData. + * + * @param progressInfo The progress information notified to Application. + * @since 15 + */ +typedef void (*Pasteboard_ProgressNotify)(Pasteboard_ProgressInfo progressInfo); + +/** + * @brief Represents the Pasteboard progress listener when getting OH_UdmfData. + * + * @since 15 + */ +typedef struct Pasteboard_ProgressListener { + /** + * Indicates the callback function used to return the progress information. + */ + Pasteboard_ProgressNotify callback; +} Pasteboard_ProgressListener; + +/** + * @brief Defines the cancel function used to cancel the progress when getting OH_PasteData. + * + * @since 15 + */ +typedef void (*Pasteboard_ProgressCancel)(void); + +/** + * brief Represents the Pasteboard progress signal when getting data. + * + * @since 15 + */ +typedef struct Pasteboard_ProgressSignal { + /** + * Indicates the signal function used to cancel the progress process. + */ + Pasteboard_ProgressCancel cancel; +} Pasteboard_ProgressSignal; + +/** + * @brief Represents the pasteboard get data parameters when getting data from Pasteboard. + * + * @param destUri Indicates the uri of dest path where copy file will be copied to in sandbox of Application. + * @param destUriLen Indicates the length of destUir. + * @param fileConflictOption Indicates fileConflictOption when dest path has file with same name. + * @param progressIndicator Indicates whether to use default system progress indacator. + * @param progressListener Indicates the progress listener when getting PasteData without using default system progress. + * @param progressSignal Indicates progress signal when getting PasteData with system progress indacator. + * @since 15 + */ +typedef struct OH_Pasteboard_GetDataParams { + /** Indicates the uri of dest path where copy files will be copied to sandbox of Application. + */ + char *destUri; + /** Indicates the length of destUir. + */ + unsigned int destUriLen; + /** Indicates fileConflictOptions when dest path has file with same name. + */ + Pasteboard_FileConflictOption fileConflictOption; + /** Indicates whether to use default system progress indicator. + */ + Pasteboard_ProgressIndicator progressIndicator; + /** Indicates the progress listener when getting PasteData without using default system progress. + */ + Pasteboard_ProgressListener progressListener; + /** Indicates progress signal when getting PasteData with system progress indacator. + */ + Pasteboard_ProgressSignal progressSignal; +} OH_Pasteboard_GetDataParams; + /** * @brief Defines the callback function used to return the Pasteboard data changed. * @@ -279,6 +393,20 @@ int OH_Pasteboard_ClearData(OH_Pasteboard* pasteboard); * @since 14 */ char **OH_Pasteboard_GetMimeTypes(OH_Pasteboard *pasteboard, unsigned int *count); + +/** + * @brief Obtains data from the Pasteboard with system progress indicator. + * + * @permission ohos.permission.READ_PASTEBOARD + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param params Pointer to indicates the {@link OH_Pasteboard_GetDataParams}. + * @param status The status code of the execution. For details, see {@link PASTEBOARD_Errcode}. + * @return Returns the pointer to the {@link OH_PasteData} instance. + * @see OH_Pasteboard OH_PasteData PASTEBOARD_ErrCode. + * @since 15 + */ +OH_UdmfData *OH_Pasteboard_GetDataWithProgress(OH_Pasteboard *pasteboard, OH_Pasteboard_GetDataParams *params, + int *status); #ifdef __cplusplus }; #endif diff --git a/distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h b/distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h index 36f30f1a9..aafcb849d 100644 --- a/distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h +++ b/distributeddatamgr/pasteboard/include/oh_pasteboard_err_code.h @@ -74,6 +74,26 @@ typedef enum PASTEBOARD_ErrCode { * @error Another copy is in progress. */ ERR_BUSY = 12900003, + /** + * @error Copy file failed. + * @since 15 + */ + OH_PASTEBOARD_COPY_FILE_ERROR = 12900007, + /** + * @error Failed to start progress. + * @since 15 + */ + OH_PASTEBOARD_PROGRESS_START_ERROR = 12900008, + /** + * @error Progress exits abnormally. + * @since 15 + */ + OH_PASTEBOARD_PROGRESS_ABNORMAL = 12900009, + /** + * @error Get Data failed. + * @since 15 + */ + OH_PASTEBOARD_GET_DATA_FAILED = 12900010, } PASTEBOARD_ErrCode; #ifdef __cplusplus }; diff --git a/distributeddatamgr/pasteboard/libpasteboard.ndk.json b/distributeddatamgr/pasteboard/libpasteboard.ndk.json index c47c8a475..3e66a29f4 100644 --- a/distributeddatamgr/pasteboard/libpasteboard.ndk.json +++ b/distributeddatamgr/pasteboard/libpasteboard.ndk.json @@ -58,5 +58,9 @@ { "first_introduced": "14", "name": "OH_Pasteboard_GetMimeTypes" + }, + { + "first_introduced": "15", + "name": "OH_Pasteboard_GetDataWithProgress" } ] \ No newline at end of file -- Gitee From 6024adeffa40b84ab006a04b344d7e8a2026cde6 Mon Sep 17 00:00:00 2001 From: yangxuguang-huawei Date: Thu, 2 Jan 2025 11:23:04 +0800 Subject: [PATCH 613/620] feat: update include Signed-off-by: yangxuguang-huawei Change-Id: Ib2ffabfda630039bbecc3b353a1d0ed57e31f95b --- AbilityKit/ability_runtime/application_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index c42fee6ca..b6813877a 100644 --- a/AbilityKit/ability_runtime/application_context.h +++ b/AbilityKit/ability_runtime/application_context.h @@ -39,7 +39,7 @@ #include #include -#include +#include #include "ability_runtime_common.h" #include "context_constant.h" -- Gitee From c83b0b1c936d6af8e49748131fdba8aaba0d02a3 Mon Sep 17 00:00:00 2001 From: yangxiaodong Date: Mon, 30 Dec 2024 20:54:17 +0800 Subject: [PATCH 614/620] modify comment Signed-off-by: yangxiaodong --- distributeddatamgr/pasteboard/include/oh_pasteboard.h | 10 ++++++++++ distributeddatamgr/pasteboard/libpasteboard.ndk.json | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/distributeddatamgr/pasteboard/include/oh_pasteboard.h b/distributeddatamgr/pasteboard/include/oh_pasteboard.h index 15d489623..9619d07c0 100644 --- a/distributeddatamgr/pasteboard/include/oh_pasteboard.h +++ b/distributeddatamgr/pasteboard/include/oh_pasteboard.h @@ -279,6 +279,16 @@ int OH_Pasteboard_ClearData(OH_Pasteboard* pasteboard); * @since 14 */ char **OH_Pasteboard_GetMimeTypes(OH_Pasteboard *pasteboard, unsigned int *count); + +/** + * @brief Gets the number of Pasteboard data changes. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @return the number of Pasteboard data changes. + * Returns 0 means initial value or invalid value.In this case, no action is required. + * @since 16 + */ +uint32_t OH_Pasteboard_GetChangeCount(OH_Pasteboard *pasteboard); #ifdef __cplusplus }; #endif diff --git a/distributeddatamgr/pasteboard/libpasteboard.ndk.json b/distributeddatamgr/pasteboard/libpasteboard.ndk.json index c47c8a475..f271cbd4a 100644 --- a/distributeddatamgr/pasteboard/libpasteboard.ndk.json +++ b/distributeddatamgr/pasteboard/libpasteboard.ndk.json @@ -58,5 +58,9 @@ { "first_introduced": "14", "name": "OH_Pasteboard_GetMimeTypes" + }, + { + "first_introduced": "16", + "name": "OH_Pasteboard_GetChangeCount" } ] \ No newline at end of file -- Gitee From 307bac5f4c46e9e99ac5610f99ae60dc89ed5bf3 Mon Sep 17 00:00:00 2001 From: peng Date: Thu, 2 Jan 2025 07:58:35 +0000 Subject: [PATCH 615/620] add muxer ndk json Signed-off-by: peng --- multimedia/av_codec/avmuxer/libnative_media_avmuxer.ndk.json | 4 ++++ .../av_codec/codec_base/libnative_media_codecbase.ndk.json | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/multimedia/av_codec/avmuxer/libnative_media_avmuxer.ndk.json b/multimedia/av_codec/avmuxer/libnative_media_avmuxer.ndk.json index 097dd37d0..bd99200d2 100644 --- a/multimedia/av_codec/avmuxer/libnative_media_avmuxer.ndk.json +++ b/multimedia/av_codec/avmuxer/libnative_media_avmuxer.ndk.json @@ -7,6 +7,10 @@ "first_introduced": "10", "name": "OH_AVMuxer_SetRotation" }, + { + "first_introduced": "14", + "name": "OH_AVMuxer_SetFormat" + }, { "first_introduced": "10", "name": "OH_AVMuxer_AddTrack" diff --git a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json index 715c18d86..5ddaeb1a0 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -395,6 +395,10 @@ "first_introduced": "14", "name": "OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR" }, + { + "first_introduced": "14", + "name": "OH_MD_KEY_CREATION_TIME" + }, { "first_introduced": "10", "name": "OH_AVCodec_GetCapability" -- Gitee From b4b24548a45bc263176f8a57cc3b7af3f24450cf Mon Sep 17 00:00:00 2001 From: z00544238 Date: Sat, 21 Dec 2024 20:07:56 +0800 Subject: [PATCH 616/620] rdb transaction ndk interface Signed-off-by: z00544238 --- distributeddatamgr/relational_store/BUILD.gn | 14 +- .../relational_store/include/oh_cursor.h | 41 +- .../relational_store/include/oh_data_value.h | 452 +++++++++++++ .../relational_store/include/oh_data_values.h | 443 +++++++++++++ .../include/oh_data_values_buckets.h | 117 ++++ .../include/oh_rdb_transaction.h | 347 ++++++++++ .../include/oh_values_bucket.h | 31 + .../include/relational_store.h | 28 + .../include/relational_store_error_code.h | 107 ++- .../relational_store/libnative_rdb.ndk.json | 622 ++++++++++++++---- 10 files changed, 2041 insertions(+), 161 deletions(-) create mode 100644 distributeddatamgr/relational_store/include/oh_data_value.h create mode 100644 distributeddatamgr/relational_store/include/oh_data_values.h create mode 100644 distributeddatamgr/relational_store/include/oh_data_values_buckets.h create mode 100644 distributeddatamgr/relational_store/include/oh_rdb_transaction.h diff --git a/distributeddatamgr/relational_store/BUILD.gn b/distributeddatamgr/relational_store/BUILD.gn index a720869f7..203e78f46 100644 --- a/distributeddatamgr/relational_store/BUILD.gn +++ b/distributeddatamgr/relational_store/BUILD.gn @@ -20,6 +20,7 @@ ohos_ndk_headers("native_rdb_ndk_header") { sources = [ "./include/oh_cursor.h", "./include/oh_predicates.h", + "./include/oh_rdb_transaction.h", "./include/oh_value_object.h", "./include/oh_values_bucket.h", "./include/relational_store.h", @@ -29,7 +30,12 @@ ohos_ndk_headers("native_rdb_ndk_header") { ohos_ndk_headers("data_ndk_header") { dest_dir = "$ndk_headers_out_dir/database/data/" - sources = [ "./include/data_asset.h" ] + sources = [ + "./include/data_asset.h", + "./include/oh_data_value.h", + "./include/oh_data_values.h", + "./include/oh_data_values_buckets.h", + ] } ohos_ndk_library("libnative_rdb_ndk") { @@ -40,11 +46,15 @@ ohos_ndk_library("libnative_rdb_ndk") { min_compact_version = "11" system_capability_headers = [ "$ndk_headers_out_dir/database/data/data_asset.h", + "$ndk_headers_out_dir/database/data/oh_data_value.h", + "$ndk_headers_out_dir/database/data/oh_data_values.h", + "$ndk_headers_out_dir/database/data/oh_data_values_buckets.h", "$ndk_headers_out_dir/database/rdb/oh_cursor.h", "$ndk_headers_out_dir/database/rdb/oh_predicates.h", + "$ndk_headers_out_dir/database/rdb/oh_rdb_transaction.h", "$ndk_headers_out_dir/database/rdb/oh_value_object.h", "$ndk_headers_out_dir/database/rdb/oh_values_bucket.h", "$ndk_headers_out_dir/database/rdb/relational_store.h", "$ndk_headers_out_dir/database/rdb/relational_store_error_code.h", ] -} +} \ No newline at end of file diff --git a/distributeddatamgr/relational_store/include/oh_cursor.h b/distributeddatamgr/relational_store/include/oh_cursor.h index 0785f850e..2f8c2a5ae 100644 --- a/distributeddatamgr/relational_store/include/oh_cursor.h +++ b/distributeddatamgr/relational_store/include/oh_cursor.h @@ -48,50 +48,11 @@ #include #include #include "database/data/data_asset.h" +#include "database/data/oh_data_value.h" #ifdef __cplusplus extern "C" { #endif -/** - * @brief Indicates the column type. - * - * @since 10 - */ -typedef enum OH_ColumnType { - /** - * Indicates the column type is NULL. - */ - TYPE_NULL = 0, - /** - * Indicates the column type is INT64. - */ - TYPE_INT64, - /** - * Indicates the column type is REAL. - */ - TYPE_REAL, - /** - * Indicates the column type is TEXT. - */ - TYPE_TEXT, - /** - * Indicates the column type is BLOB. - */ - TYPE_BLOB, - /** - * Indicates the column type is {@link Data_Asset}. - * - * @since 11 - */ - TYPE_ASSET, - /** - * Indicates the column type is array of {@link Data_Asset}. - * - * @since 11 - */ - TYPE_ASSETS -} OH_ColumnType; - /** * @brief Define the OH_Cursor structure type. * diff --git a/distributeddatamgr/relational_store/include/oh_data_value.h b/distributeddatamgr/relational_store/include/oh_data_value.h new file mode 100644 index 000000000..efdd3a2f5 --- /dev/null +++ b/distributeddatamgr/relational_store/include/oh_data_value.h @@ -0,0 +1,452 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup RDB + * @{ + * + * @brief The relational database (RDB) store manages data based on relational models. + * With the underlying SQLite database, the RDB store provides a complete mechanism for managing local databases. + * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations + * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. + * + * @since 10 + */ + +/** + * @file oh_data_value.h + * + * @brief Provides functions and enumerations related to the data value. + * + * @kit ArkData + * @library libnative_rdb_ndk.z.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * + * @since 16 + */ + +#ifndef OH_DATA_VALUE_H +#define OH_DATA_VALUE_H + +#include +#include "database/data/data_asset.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Indicates the column type. + * + * @since 10 + */ +typedef enum OH_ColumnType { + /** + * @brief Indicates the column type is NULL. + * + * @since 10 Moved from oh_cursor.h file. + */ + TYPE_NULL = 0, + /** + * @brief Indicates the column type is INT64. + * + * @since 10 Moved from oh_cursor.h file. + */ + TYPE_INT64, + /** + * @brief Indicates the column type is REAL. + * + * @since 10 Moved from oh_cursor.h file. + */ + TYPE_REAL, + /** + * @brief Indicates the column type is TEXT. + * + * @since 10 Moved from oh_cursor.h file. + */ + TYPE_TEXT, + /** + * @brief Indicates the column type is BLOB. + * + * @since 10 Moved from oh_cursor.h file. + */ + TYPE_BLOB, + /** + * @brief Indicates the column type is {@link Data_Asset}. + * + * @since 11 Moved from oh_cursor.h file. + */ + TYPE_ASSET, + /** + * @brief Indicates the column type is array of {@link Data_Asset}. + * + * @since 11 Moved from oh_cursor.h file. + */ + TYPE_ASSETS, + /** + * @brief Indicates the column type is FLOAT VECTOR. + * + * @since 16 + */ + TYPE_FLOAT_VECTOR, + /** + * @brief Indicates that the column type is a number whose length is greater than 64 bits. + * + * @since 16 + */ + TYPE_UNLIMITED_INT, +} OH_ColumnType; + +/** + * @brief Define the OH_Data_Value structure type. + * + * @since 16 + */ +typedef struct OH_Data_Value OH_Data_Value; + +/** + * @brief Creates an OH_Data_Value instance object. + * + * @return Returns a pointer to OH_Data_Value instance when the execution is successful. + * Otherwise, nullptr is returned. The memory must be released through the OH_Value_Destroy + * interface after the use is complete. + * @see OH_Value_Destroy. + * @since 16 + */ +OH_Data_Value *OH_Value_Create(); + +/** + * @brief Destroys an OH_Data_Value instance object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Value_Destroy(OH_Data_Value *value); + +/** + * @brief Set empty data to the OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Value_PutNull(OH_Data_Value *value); + +/** + * @brief Set integer data to the OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents a integer data. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Value_PutInt(OH_Data_Value *value, int64_t val); + +/** + * @brief Set decimal data to the OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents a decimal data. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Value_PutReal(OH_Data_Value *value, double val); + +/** + * @brief Set string data to the OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents a string data. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Value_PutText(OH_Data_Value *value, const char *val); + +/** + * @brief Set binary data to the OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents a binary data. + * @param length Represents the size of binary data. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Value_PutBlob(OH_Data_Value *value, const unsigned char *val, size_t length); + +/** + * @brief Set Data_Asset data to the OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents a pointer to an instance of Data_Asset. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Value_PutAsset(OH_Data_Value *value, const Data_Asset *val); + +/** + * @brief Set multiple Data_Asset data to the OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents a pointer to multiple Data_Asset. + * @param length Represents the count of multiple data. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Value_PutAssets(OH_Data_Value *value, const Data_Asset * const * val, size_t length); + +/** + * @brief Set float array data to the OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents a pointer to float array. + * @param length Represents the size of float array. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Value_PutFloatVector(OH_Data_Value *value, const float *val, size_t length); + +/** + * @brief Set an integer of any length data to the OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param sign Represents 0 is positive integer, 1 is negative integer. + * @param trueForm Represents a pointer to integer array. + * @param length Represents the size of integer array. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Value_PutUnlimitedInt(OH_Data_Value *value, int sign, const uint64_t *trueForm, size_t length); + +/** + * @brief Get data type from OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param type Represents the parameter of the data type. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Value_GetType(OH_Data_Value *value, OH_ColumnType *type); + +/** + * @brief Check whether the data is empty from OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents empty data flag. It is an output parameter. Ture is empty, false is not empty. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Value_IsNull(OH_Data_Value *value, bool *val); + +/** + * @brief Get integer data from OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents a pointer to an integer data. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Value_GetInt(OH_Data_Value *value, int64_t *val); + +/** + * @brief Get decimal data from OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents a pointer to an decimal data. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Value_GetReal(OH_Data_Value *value, double *val); + +/** + * @brief Get string data from OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents a pointer to a string data. It is an output parameter. + * The caller does not need to apply for memory and release memory. The life cycle of val follows value. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Value_GetText(OH_Data_Value *value, const char **val); + +/** + * @brief Get binary data from OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents a pointer to a binary data. It is an output parameter. + * The caller does not need to apply for memory and release memory. The life cycle of val follows value. + * @param length Represents the size of binary array. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Value_GetBlob(OH_Data_Value *value, const uint8_t **val, size_t *length); + +/** + * @brief Get Data_Asset data from OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents a pointer to an instance of Data_Asset. The caller needs to apply for data memory. + * This function only fills data. Otherwise, the execution fails. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Value_GetAsset(OH_Data_Value *value, Data_Asset *val); + +/** + * @brief Get multiple Data_Asset size from OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param length Represents the size of Data_Asset array. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Value_GetAssetsCount(OH_Data_Value *value, size_t *length); + +/** + * @brief Get multiple Data_Asset data from OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents a pointer to Data_Asset array. The caller needs to apply for data memory. + * This function only fills data. Otherwise, the execution fails. + * @param inLen Represents the size of val. It can be obtained through the OH_Value_GetAssetsCount function. + * @param outLen Represents the actual amount of data obtained. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @see OH_Value_GetAssetsCount. + * @since 16 + */ +int OH_Value_GetAssets(OH_Data_Value *value, Data_Asset **val, size_t inLen, size_t *outLen); + +/** + * @brief Get float array data size from OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param length Represents the size of float array. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Value_GetFloatVectorCount(OH_Data_Value *value, size_t *length); + +/** + * @brief Get float array from OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param val Represents a pointer to float array. The caller needs to apply for data memory. + * This function only fills data. Otherwise, the execution fails. + * @param inLen Represents the size of val. It can be obtained through the OH_Value_GetFloatVectorCount function. + * @param outLen Represents the actual amount of data obtained. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @see OH_Value_GetFloatVectorCount. + * @since 16 + */ +int OH_Value_GetFloatVector(OH_Data_Value *value, float *val, size_t inLen, size_t *outLen); + +/** + * @brief Get an integer of any length data size from OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param length Represents the size of integer array. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Value_GetUnlimitedIntBand(OH_Data_Value *value, size_t *length); + +/** + * @brief Get an integer of any length data from OH_Data_Value object. + * + * @param value Represents a pointer to an instance of OH_Data_Value. + * @param sign Represents 0 is positive integer, 1 is negative integer. It is an output parameter. + * @param trueForm Represents a pointer to integer array. The caller needs to apply for data memory. + * This function only fills data. Otherwise, the execution fails. + * @param inLen Represents the size of trueForm. It can be obtained through the OH_Value_GetUnlimitedIntBand function. + * @param outLen Represents the actual amount of data obtained. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @see OH_Value_GetUnlimitedIntBand. + * @since 16 + */ +int OH_Value_GetUnlimitedInt(OH_Data_Value *value, int *sign, uint64_t *trueForm, size_t inLen, size_t *outLen); + +#ifdef __cplusplus +}; +#endif +#endif +/** @} */ \ No newline at end of file diff --git a/distributeddatamgr/relational_store/include/oh_data_values.h b/distributeddatamgr/relational_store/include/oh_data_values.h new file mode 100644 index 000000000..791c7d0f8 --- /dev/null +++ b/distributeddatamgr/relational_store/include/oh_data_values.h @@ -0,0 +1,443 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup RDB + * @{ + * + * @brief The relational database (RDB) store manages data based on relational models. + * With the underlying SQLite database, the RDB store provides a complete mechanism for managing local databases. + * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations + * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. + * + * @since 10 + */ + +/** + * @file oh_data_values.h + * + * @brief Provides functions and enumerations related to the data values. + * + * @kit ArkData + * @library libnative_rdb_ndk.z.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * + * @since 16 + */ +#ifndef OH_DATA_VALUES_H +#define OH_DATA_VALUES_H +#include + +#include "database/data/data_asset.h" +#include "database/data/oh_data_value.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Define the OH_Data_Values structure type. + * + * @since 16 + */ +typedef struct OH_Data_Values OH_Data_Values; + +/** + * @brief Creates an OH_Data_Values instance object. + * + * @return Returns a pointer to OH_Data_Values instance when the execution is successful. + * Otherwise, nullptr is returned. The memory must be released through the OH_Values_Destroy + * interface after the use is complete. + * @see OH_Values_Destroy. + * @since 16 + */ +OH_Data_Values *OH_Values_Create(); + +/** + * @brief Destroys an OH_Data_Values instance object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_Destroy(OH_Data_Values *values); + +/** + * @brief Add OH_Data_Value data to the OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param val Represents a pointer to an instance of OH_Data_Value. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_Put(OH_Data_Values *values, const OH_Data_Value *val); + +/** + * @brief Add empty data to the OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_PutNull(OH_Data_Values *values); + +/** + * @brief Add integer data to the OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param val Represents a integer data. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_PutInt(OH_Data_Values *values, int64_t val); + +/** + * @brief Add decimal data to the OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param val Represents a decimal data. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_PutReal(OH_Data_Values *values, double val); + +/** + * @brief Add string data to the OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param val Represents a string data. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_PutText(OH_Data_Values *values, const char *val); + +/** + * @brief Add binary data to the OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param val Represents a binary data. + * @param length Represents the size of binary data. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_PutBlob(OH_Data_Values *values, const unsigned char *val, size_t length); + +/** + * @brief Add Data_Asset data to the OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param val Represents a pointer to an instance of Data_Asset. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_PutAsset(OH_Data_Values *values, const Data_Asset *val); + +/** + * @brief Add multiple Data_Asset data to the OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param val Represents a pointer to multiple Data_Asset. + * @param length Represents the count of multiple data. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_PutAssets(OH_Data_Values *values, const Data_Asset * const * val, size_t length); + +/** + * @brief Add float array data to the OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param val Represents a pointer to float array. + * @param length Represents the size of float array. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_PutFloatVector(OH_Data_Values *values, const float *val, size_t length); + +/** + * @brief Add an integer of any length data to the OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param sign Represents 0 is positive integer, 1 is negative integer. + * @param trueForm Represents a pointer to integer array. + * @param length Represents the size of integer array. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_PutUnlimitedInt(OH_Data_Values *values, int sign, const uint64_t *trueForm, size_t length); + +/** + * @brief Get data count from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param count Represents the count of data in values. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_Count(OH_Data_Values *values, size_t *count); + +/** + * @brief Get data type from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param index Represents the zero-based index of target data in values. + * @param type Represents the parameter of the data type. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_GetType(OH_Data_Values *values, int index, OH_ColumnType *type); + +/** + * @brief Get OH_Data_Value data from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param index Represents the zero-based index of target data in values. + * @param val Represents a pointer to an instance of OH_Data_Value. It is an output parameter. + * The caller does not need to apply for memory and release memory. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_Get(OH_Data_Values *values, int index, OH_Data_Value **val); + +/** + * @brief Check whether the data is empty from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param index Represents the zero-based index of target data in values. + * @param val Represents empty data flag. It is an output parameter. Ture is empty, false is not empty. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_Values_IsNull(OH_Data_Values *values, int index, bool *val); + +/** + * @brief Get integer data from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param index Represents the zero-based index of target data in values. + * @param val Represents a pointer to an integer data. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Values_GetInt(OH_Data_Values *values, int index, int64_t *val); + +/** + * @brief Get decimal data from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param index Represents the zero-based index of target data in values. + * @param val Represents a pointer to an decimal data. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Values_GetReal(OH_Data_Values *values, int index, double *val); + +/** + * @brief Get string data from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param index Represents the zero-based index of target data in values. + * @param val Represents a pointer to a string data. It is an output parameter. + * The caller does not need to apply for memory and release memory. + * The life cycle of val follows the value of index in values. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Values_GetText(OH_Data_Values *values, int index, const char **val); + +/** + * @brief Get binary data from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param index Represents the zero-based index of target data in values. + * @param val Represents a pointer to a binary data. It is an output parameter. + * The caller does not need to apply for memory and release memory. + * The life cycle of val follows the value of index in values. + * @param length Represents the size of binary array. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Values_GetBlob(OH_Data_Values *values, int index, const uint8_t **val, size_t *length); + +/** + * @brief Get Data_Asset data from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param index Represents the zero-based index of target data in values. + * @param val Represents a pointer to an instance of Data_Asset. The caller needs to apply for data memory. + * This function only fills data. Otherwise, the execution fails. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Values_GetAsset(OH_Data_Values *values, int index, Data_Asset *val); + +/** + * @brief Get multiple Data_Asset size from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param index Represents the zero-based index of target data in values. + * @param length Represents the size of Data_Asset array. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Values_GetAssetsCount(OH_Data_Values *values, int index, size_t *length); + +/** + * @brief Get multiple Data_Asset data from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param index Represents the zero-based index of target data in values. + * @param val Represents a pointer to Data_Asset array. The caller needs to apply for data memory. + * This function only fills data. Otherwise, the execution fails. + * @param inLen Represents the size of val. It can be obtained through the OH_Values_GetAssetsCount function. + * @param outLen Represents the actual amount of data obtained. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @see OH_Values_GetAssetsCount. + * @since 16 + */ +int OH_Values_GetAssets(OH_Data_Values *values, int index, Data_Asset **val, size_t inLen, size_t *outLen); + +/** + * @brief Get float array data size from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param index Represents the zero-based index of target data in values. + * @param length Represents the size of float array. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Values_GetFloatVectorCount(OH_Data_Values *values, int index, size_t *length); + +/** + * @brief Get float array from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param index Represents the zero-based index of target data in values. + * @param val Represents a pointer to float array. The caller needs to apply for data memory. + * This function only fills data. Otherwise, the execution fails. + * @param inLen Represents the size of val. It can be obtained through the OH_Values_GetFloatVectorCount function. + * @param outLen Represents the actual amount of data obtained. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @see OH_Values_GetFloatVectorCount. + * @since 16 + */ +int OH_Values_GetFloatVector(OH_Data_Values *values, int index, float *val, size_t inLen, size_t *outLen); + +/** + * @brief Get an integer of any length data size from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param index Represents the zero-based index of target data in values. + * @param length Represents the size of integer array. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @since 16 + */ +int OH_Values_GetUnlimitedIntBand(OH_Data_Values *values, int index, size_t *length); + +/** + * @brief Get an integer of any length data from OH_Data_Values object. + * + * @param values Represents a pointer to an instance of OH_Data_Values. + * @param index Represents the zero-based index of target data in values. + * @param sign Represents 0 is positive integer, 1 is negative integer. It is an output parameter. + * @param trueForm Represents a pointer to integer array. The caller needs to apply for data memory. + * This function only fills data. Otherwise, the execution fails. + * @param inLen Represents the size of trueForm. It can be obtained through the OH_Values_GetUnlimitedIntBand function. + * @param outLen Represents the actual amount of data obtained. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_DATA_TYPE_NULL} the content stored in parameter value is null. + * Returns {@link RDB_E_TYPE_MISMATCH} storage data type mismatch. + * @see OH_Values_GetUnlimitedIntBand. + * @since 16 + */ +int OH_Values_GetUnlimitedInt(OH_Data_Values *values, int index, int *sign, uint64_t *trueForm, size_t inLen, + size_t *outLen); + +#ifdef __cplusplus +}; +#endif +#endif +/** @} */ \ No newline at end of file diff --git a/distributeddatamgr/relational_store/include/oh_data_values_buckets.h b/distributeddatamgr/relational_store/include/oh_data_values_buckets.h new file mode 100644 index 000000000..46cfc4b8d --- /dev/null +++ b/distributeddatamgr/relational_store/include/oh_data_values_buckets.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup RDB + * @{ + * + * @brief The relational database (RDB) store manages data based on relational models. + * With the underlying SQLite database, the RDB store provides a complete mechanism for managing local databases. + * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations + * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. + * + * @since 10 + */ + +/** + * @file oh_data_values_buckets.h + * + * @brief Provides functions and enumerations related to the data value buckets. + * + * @kit ArkData + * @library libnative_rdb_ndk.z.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * + * @since 16 + */ + + +#ifndef OH_VALUES_BUCKETS_H +#define OH_VALUES_BUCKETS_H +#include "database/rdb/oh_values_bucket.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Define the OH_Data_VBuckets structure type. + * + * @since 16 + */ +typedef struct OH_Data_VBuckets OH_Data_VBuckets; + +/** + * @brief Creates an OH_Data_VBuckets instance object. + * + * @return Returns a pointer to OH_Data_VBuckets instance when the execution is successful. + * Otherwise, nullptr is returned. The memory must be released through the OH_VBuckets_Destroy + * interface after the use is complete. + * @see OH_VBuckets_Destroy. + * @since 16 + */ +OH_Data_VBuckets *OH_VBuckets_Create(); + +/** + * @brief Destroys an OH_Data_VBuckets instance object. + * + * @param buckets Represents a pointer to an instance of OH_Data_VBuckets. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_VBuckets_Destroy(OH_Data_VBuckets *buckets); + +/** + * @brief Add an OH_VBucket to OH_Data_VBuckets object. + * + * @param buckets Represents a pointer to an instance of OH_Data_VBuckets. + * @param row Represents a pointer to an instance of OH_VBucket. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_VBuckets_PutRow(OH_Data_VBuckets *buckets, const OH_VBucket *row); + +/** + * @brief Add an OH_Data_VBuckets to OH_Data_VBuckets object. + * + * @param buckets Represents a pointer to an instance of OH_Data_VBuckets. + * @param rows Represents a pointer to an instance of OH_Data_VBuckets. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_VBuckets_PutRows(OH_Data_VBuckets *buckets, const OH_Data_VBuckets *rows); + +/** + * @brief Add an OH_Data_VBuckets to OH_Data_VBuckets object. + * + * @param buckets Represents a pointer to an instance of OH_Data_VBuckets. + * @param count Represents the count of OH_VBucket in OH_Data_VBuckets. It is an output parameter. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_VBuckets_RowCount(OH_Data_VBuckets *buckets, size_t *count); + +#ifdef __cplusplus +}; +#endif +#endif +/** @} */ diff --git a/distributeddatamgr/relational_store/include/oh_rdb_transaction.h b/distributeddatamgr/relational_store/include/oh_rdb_transaction.h new file mode 100644 index 000000000..e302f677d --- /dev/null +++ b/distributeddatamgr/relational_store/include/oh_rdb_transaction.h @@ -0,0 +1,347 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup RDB + * @{ + * + * @brief The relational database (RDB) store manages data based on relational models. + * With the underlying SQLite database, the RDB store provides a complete mechanism for managing local databases. + * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations + * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. + * + * @since 10 + */ + +/** + * @file oh_rdb_transaction.h + * + * @brief Provides database transaction related functions and enumerations. + * + * @kit ArkData + * @library libnative_rdb_ndk.z.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * + * @since 16 + */ + +#ifndef OH_RDB_TRANSACTION_H +#define OH_RDB_TRANSACTION_H + +#include "database/rdb/oh_cursor.h" +#include "database/rdb/oh_predicates.h" +#include "database/rdb/oh_values_bucket.h" +#include "database/data/oh_data_values.h" +#include "database/data/oh_data_values_buckets.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Indicates relation database transaction type. + * + * @since 16 + */ +typedef enum OH_RDB_TransType { + /** + * @brief Indicates the transaction does not actually start until the database is first accessed. It's a default. + */ + RDB_TRANS_DEFERRED = 0, + /** + * @brief Indicates the database connection to start a new write immediately, without waiting for a write statement. + */ + RDB_TRANS_IMMEDIATE, + /** + * @brief Indicates it is similar to RDB_TRANS_IMMEDIATE in that a write transaction is started immediately. + * RDB_TRANS_EXCLUSIVE and RDB_TRANS_IMMEDIATE are the same in WAL mode, but in other journaling modes, + * EXCLUSIVE prevents other database connections from reading the database while the transaction is underway. + */ + RDB_TRANS_EXCLUSIVE, + /** + * The largest value for rdb transaction type. + */ + RDB_TRANS_BUTT, +} OH_RDB_TransType; + +/** + * @brief Define the OH_RDB_TransOptions structure type. + * + * @since 16 + */ +typedef struct OH_RDB_TransOptions OH_RDB_TransOptions; + +/** + * @brief Define the OH_Rdb_Transaction structure type. + * + * @since 16 + */ +typedef struct OH_Rdb_Transaction OH_Rdb_Transaction; + +/** + * @brief Creates an OH_RDB_TransOptions instance object. + * + * @return Returns a pointer to OH_RDB_TransOptions instance when the execution is successful. + * Otherwise, nullptr is returned. The memory must be released through the OH_RdbTrans_DestroyOptions + * interface after the use is complete. + * @see OH_RdbTrans_DestroyOptions. + * @since 16 + */ +OH_RDB_TransOptions *OH_RdbTrans_CreateOptions(); + +/** + * @brief Destroys an OH_RDB_TransOptions instance object. + * + * @param opitons Represents a pointer to an instance of OH_RDB_TransOptions. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_RdbTrans_DestroyOptions(OH_RDB_TransOptions *opitons); + +/** + * @brief Sets integer data to the opitons object. + * + * @param opitons Represents a pointer to an instance of OH_RDB_TransOptions. + * @param type Represents relation database transaction type. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_RdbTransOption_SetType(OH_RDB_TransOptions *opitons, OH_RDB_TransType type); + +/** + * @brief Commits a transaction of a relational database. + * + * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * @since 16 + */ +int OH_RdbTrans_Commit(OH_Rdb_Transaction *trans); + +/** + * @brief Roll back a transaction of a relational database. + * + * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * @since 16 + */ +int OH_RdbTrans_Rollback(OH_Rdb_Transaction *trans); + +/** + * @brief Inserts a row of data into the target table. + * + * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @param table Represents the target table. + * @param row Represents the row data to be inserted into the table. + * @param rowId Represents row line number when insert successfully. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_WAL_SIZE_OVER_LIMIT} the WAL file size over default limit. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. + * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. + + * @since 16 + */ +int OH_RdbTrans_Insert(OH_Rdb_Transaction *trans, const char *table, const OH_VBucket *row, int64_t *rowId); + +/** + * @brief Inserts a batch of data into the target table. + * + * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @param table Represents the target table. + * @param rows Represents the rows data to be inserted into the table. + * @param changes Represents the number of successful insertions. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_WAL_SIZE_OVER_LIMIT} the WAL file size over default limit. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. + * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. + * @since 16 + */ +int OH_RdbTrans_BatchInsert(OH_Rdb_Transaction *trans, const char *table, const OH_Data_VBuckets *rows, + int64_t *changes); + +/** + * @brief Updates data in the database based on specified conditions. + * + * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @param row Represents the row data to be updated into the table. + * @param predicates Represents the specified update condition by the instance object of OH_Predicates. + * @param changes Represents the number of successful insertions. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_WAL_SIZE_OVER_LIMIT} the WAL file size over default limit. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. + * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. + * @since 16 + */ +int OH_RdbTrans_Update(OH_Rdb_Transaction *trans, const OH_VBucket *row, const OH_Predicates *predicates, + int64_t *changes); + +/** + * @brief Deletes data from the database based on specified conditions + * + * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @param predicates Represents the specified update condition by the instance object of OH_Predicates. + * @param changes Represents the number of successfully Deleted. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_WAL_SIZE_OVER_LIMIT} the WAL file size over default limit. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. + * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. + * @since 16 + */ +int OH_RdbTrans_Delete(OH_Rdb_Transaction *trans, const OH_Predicates *predicates, int64_t *changes); + +/** + * @brief Queries data in the database based on specified conditions. + * + * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @param predicates Represents the specified update condition by the instance object of OH_Predicates. + * @param columns Represents the columns to query. If the value is empty array, the query applies to all columns. + * @param len Represents the number of columns elements. + * @return If the operation is successful, a pointer to the instance of the OH_Cursor structure is returned. + * If database has closed or the database does not respond, nullptr is returned. + * @since 16 + */ +OH_Cursor *OH_RdbTrans_Query(OH_Rdb_Transaction *trans, const OH_Predicates *predicates, const char *columns[], + int len); + +/** + * @brief Queries data in the database based on SQL statement. + * + * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @param sql Represents the SQL statement to execute. + * @param args Represents a pointer to an instance of OH_Data_Values and it is the selection arguments. + * @return If the operation is successful, a pointer to the instance of the OH_Cursor structure is returned. + * If database has closed or the database does not respond, nullptr is returned. + * @since 16 + */ +OH_Cursor *OH_RdbTrans_QuerySql(OH_Rdb_Transaction *trans, const char *sql, const OH_Data_Values *args); + +/** + * @brief Executes an SQL statement that contains specified parameters. + * + * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @param sql Represents the SQL statement to execute. + * @param args Represents the values of the parameters in the SQL statement. + * @param result Represents a pointer to OH_Data_Value instance when the execution is successful. + * The memory must be released through the OH_Value_Destroy interface after the use is complete. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_WAL_SIZE_OVER_LIMIT} the WAL file size over default limit. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. + * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. + * @see OH_Value_Destroy. + * @since 16 + */ +int OH_RdbTrans_Execute(OH_Rdb_Transaction *trans, const char *sql, const OH_Data_Values *args, OH_Data_Value **result); + +/** + * @brief Destroys an OH_Rdb_Transaction instance object. + * + * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * @since 16 + */ +int OH_RdbTrans_Destroy(OH_Rdb_Transaction *trans); + +#ifdef __cplusplus +}; +#endif +#endif // OH_RDB_TRANSACTION_H +/** @} */ diff --git a/distributeddatamgr/relational_store/include/oh_values_bucket.h b/distributeddatamgr/relational_store/include/oh_values_bucket.h index 99794efbb..87c90608f 100644 --- a/distributeddatamgr/relational_store/include/oh_values_bucket.h +++ b/distributeddatamgr/relational_store/include/oh_values_bucket.h @@ -183,6 +183,37 @@ int OH_VBucket_PutAsset(OH_VBucket *bucket, const char *field, Data_Asset *value * @since 11 */ int OH_VBucket_PutAssets(OH_VBucket *bucket, const char *field, Data_Asset **value, uint32_t count); + +/** + * @brief Put the float vector to the OH_VBucket object. + * + * @param bucket Represents a pointer to an {@link OH_VBucket} instance. + * @param field Represents the name of the column. + * @param vec Represents a pointer to float array. + * @param len Represents the size of float array. + * @return Returns the status code of the execution. + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * @see OH_VBucket. + * @since 16 + */ +int OH_VBucket_PutFloatVector(OH_VBucket *bucket, const char *field, const float *vec, size_t len); + +/** + * @brief Put the an integer of any length to the OH_VBucket object. + * + * @param bucket Represents a pointer to an {@link OH_VBucket} instance. + * @param field Represents the name of the column. + * @param sign Represents 0 is positive integer, 1 is negative integer. + * @param trueForm Represents a pointer to integer array. + * @param len Represents the size of integer array. + * @return Returns the status code of the execution. + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * @see OH_VBucket. + * @since 16 + */ +int OH_VBucket_PutUnlimitedInt(OH_VBucket *bucket, const char *field, int sign, const uint64_t *trueForm, size_t len); #ifdef __cplusplus }; #endif diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index 8f4d63962..8f64decb2 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -43,6 +43,7 @@ #include "database/rdb/oh_predicates.h" #include "database/rdb/oh_value_object.h" #include "database/rdb/oh_values_bucket.h" +#include "database/rdb/oh_rdb_transaction.h" #ifdef __cplusplus extern "C" { @@ -1247,6 +1248,33 @@ int OH_Rdb_UnlockRow(OH_Rdb_Store *store, OH_Predicates *predicates); */ OH_Cursor *OH_Rdb_QueryLockedRow( OH_Rdb_Store *store, OH_Predicates *predicates, const char *const *columnNames, int length); + +/** + * @brief Creates an OH_Rdb_Transaction instance object. + * + * @param store Represents a pointer to an instance of OH_Rdb_Store. + * @param options Represents a pointer to an instance of OH_RDB_TransOptions. + * @param trans Represents a pointer to OH_Rdb_Transaction instance when the execution is successful. + * Otherwise, nullptr is returned. The memory must be released through the OH_RdbTrans_Destroy + * interface after the use is complete. + * @return Returns the error code. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_DATABASE_BUSY} database does not respond. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * Returns {@link RDB_E_SQLITE_CANT_OPEN} SQLite: Unable to open the database file. + * @see OH_RdbTrans_Destroy. + * @since 16 + */ +int OH_Rdb_CreateTransaction(OH_Rdb_Store *store, const OH_RDB_TransOptions *options, OH_Rdb_Transaction **trans); + #ifdef __cplusplus }; #endif diff --git a/distributeddatamgr/relational_store/include/relational_store_error_code.h b/distributeddatamgr/relational_store/include/relational_store_error_code.h index 83b18cc8f..fb9a20805 100644 --- a/distributeddatamgr/relational_store/include/relational_store_error_code.h +++ b/distributeddatamgr/relational_store/include/relational_store_error_code.h @@ -307,7 +307,112 @@ typedef enum OH_Rdb_ErrCode { /** * @brief The error when the connection count is used up. */ - RDB_E_CON_OVER_LIMIT = (E_BASE + 48) + RDB_E_CON_OVER_LIMIT = (E_BASE + 48), + + /** + * @brief Database already closed. + * + * @since 16 + */ + RDB_E_ALREADY_CLOSED = (E_BASE + 50), + + /** + * @brief The database does not respond. + * + * @since 16 + */ + RDB_E_DATABASE_BUSY = (E_BASE + 51), + + /** + * @brief Database corrupted. + * + * @since 16 + */ + RDB_E_SQLITE_CORRUPT = (E_BASE + 52), + + /** + * @brief SQLite: Access permission denied. + * + * @since 16 + */ + RDB_E_SQLITE_PERM = (E_BASE + 53), + + /** + * @brief SQLite: The database file is locked. + * + * @since 16 + */ + RDB_E_SQLITE_BUSY = (E_BASE + 54), + + /** + * @brief SQLite: A table in the database is locked. + * + * @since 16 + */ + RDB_E_SQLITE_LOCKED = (E_BASE + 55), + + /** + * @brief SQLite: The database is out of memory. + * + * @since 16 + */ + RDB_E_SQLITE_NOMEM = (E_BASE + 56), + + /** + * @brief SQLite: Attempt to write a readonly database. + * + * @since 16 + */ + RDB_E_SQLITE_READONLY = (E_BASE + 57), + + /** + * @brief SQLite: Some kind of disk I/O error occurred. + * + * @since 16 + */ + RDB_E_SQLITE_IOERR = (E_BASE + 58), + + /** + * @brief SQLite: The database is full. + * + * @since 16 + */ + RDB_E_SQLITE_FULL = (E_BASE + 59), + + /** + * @brief SQLite: Unable to open the database file. + * + * @since 16 + */ + RDB_E_SQLITE_CANT_OPEN = (E_BASE + 60), + + /** + * @brief SQLite: TEXT or BLOB exceeds size limit. + * + * @since 16 + */ + RDB_E_SQLITE_TOO_BIG = (E_BASE + 61), + + /** + * @brief SQLite: Data type mismatch. + * + * @since 16 + */ + RDB_E_SQLITE_MISMATCH = (E_BASE + 62), + + /** + * @brief Data value type is null. + * + * @since 16 + */ + RDB_E_DATA_TYPE_NULL = (E_BASE + 63), + + /** + * @brief Data value type mismatch. + * + * @since 16 + */ + RDB_E_TYPE_MISMATCH = (E_BASE + 64), } OH_Rdb_ErrCode; #ifdef __cplusplus diff --git a/distributeddatamgr/relational_store/libnative_rdb.ndk.json b/distributeddatamgr/relational_store/libnative_rdb.ndk.json index 5e0681865..abd77163e 100644 --- a/distributeddatamgr/relational_store/libnative_rdb.ndk.json +++ b/distributeddatamgr/relational_store/libnative_rdb.ndk.json @@ -1,120 +1,506 @@ [ - {"name":"OH_Rdb_CreatePredicates" }, - {"name":"OH_Rdb_CreateValueObject" }, - {"name":"OH_Rdb_CreateValuesBucket" }, - { - "first_introduced":"14", - "name":"OH_Rdb_CreateConfig" - }, - { - "first_introduced": "14", - "name":"OH_Rdb_SetDatabaseDir" - }, - { - "first_introduced": "14", - "name":"OH_Rdb_SetStoreName" - }, - { - "first_introduced": "14", - "name":"OH_Rdb_SetBundleName" - }, - { - "first_introduced": "14", - "name":"OH_Rdb_SetModuleName" - }, - { - "first_introduced": "14", - "name":"OH_Rdb_SetEncrypted" - }, - { - "first_introduced": "14", - "name":"OH_Rdb_SetSecurityLevel" - }, - { - "first_introduced": "14", - "name":"OH_Rdb_SetArea" - }, - { - "first_introduced": "14", - "name":"OH_Rdb_SetDbType" - }, - { - "first_introduced": "14", - "name":"OH_Rdb_GetSupportedDbType" - }, - { - "first_introduced": "14", - "name":"OH_Rdb_DestroyConfig" - }, - {"name":"OH_Rdb_GetOrOpen" }, - { - "first_introduced": "14", - "name":"OH_Rdb_CreateOrOpen" - }, - {"name":"OH_Rdb_CloseStore" }, - {"name":"OH_Rdb_DeleteStore" }, - { - "first_introduced": "14", - "name":"OH_Rdb_DeleteStoreV2" - }, - {"name":"OH_Rdb_Insert" }, - {"name":"OH_Rdb_Update" }, - {"name":"OH_Rdb_Delete" }, - {"name":"OH_Rdb_Query" }, - {"name":"OH_Rdb_Execute" }, - { - "first_introduced": "14", - "name":"OH_Rdb_ExecuteByTrxId" - }, - {"name":"OH_Rdb_ExecuteQuery" }, - {"name":"OH_Rdb_BeginTransaction" }, - {"name":"OH_Rdb_RollBack" }, - {"name":"OH_Rdb_Commit" }, - { - "first_introduced": "14", - "name":"OH_Rdb_BeginTransWithTrxId" - }, - { - "first_introduced": "14", - "name":"OH_Rdb_RollBackByTrxId" - }, - { - "first_introduced": "14", - "name":"OH_Rdb_CommitByTrxId" - }, - {"name":"OH_Rdb_Backup" }, - {"name":"OH_Rdb_Restore"}, - {"name":"OH_Rdb_GetVersion"}, - {"name":"OH_Rdb_SetVersion"}, - {"name":"OH_Rdb_SetDistributedTables"}, - {"name":"OH_Rdb_FindModifyTime"}, - {"name":"OH_Rdb_GetTableDetails"}, - {"name":"OH_Rdb_CloudSync"}, - {"name":"OH_VBucket_PutAsset"}, - {"name":"OH_VBucket_PutAssets"}, - {"name":"OH_Data_Asset_SetName"}, - {"name":"OH_Data_Asset_SetUri"}, - {"name":"OH_Data_Asset_SetPath"}, - {"name":"OH_Data_Asset_SetCreateTime"}, - {"name":"OH_Data_Asset_SetModifyTime"}, - {"name":"OH_Data_Asset_SetSize"}, - {"name":"OH_Data_Asset_SetStatus"}, - {"name":"OH_Data_Asset_GetName"}, - {"name":"OH_Data_Asset_GetUri"}, - {"name":"OH_Data_Asset_GetPath"}, - {"name":"OH_Data_Asset_GetCreateTime"}, - {"name":"OH_Data_Asset_GetModifyTime"}, - {"name":"OH_Data_Asset_GetSize"}, - {"name":"OH_Data_Asset_GetStatus"}, - {"name":"OH_Data_Asset_CreateOne"}, - {"name":"OH_Data_Asset_DestroyOne"}, - {"name":"OH_Data_Asset_CreateMultiple"}, - {"name":"OH_Data_Asset_DestroyMultiple"}, - {"name":"OH_Rdb_Subscribe"}, - {"name":"OH_Rdb_Unsubscribe"}, - {"name":"OH_Rdb_SubscribeAutoSyncProgress"}, - {"name":"OH_Rdb_UnsubscribeAutoSyncProgress"}, - {"name":"OH_Rdb_LockRow"}, - {"name":"OH_Rdb_UnlockRow"}, - {"name":"OH_Rdb_QueryLockedRow"} + { + "name":"OH_Rdb_CreatePredicates" + }, + { + "name":"OH_Rdb_CreateValueObject" + }, + { + "name":"OH_Rdb_CreateValuesBucket" + }, + { + "first_introduced":"14", + "name":"OH_Rdb_CreateConfig" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_SetDatabaseDir" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_SetStoreName" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_SetBundleName" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_SetModuleName" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_SetEncrypted" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_SetSecurityLevel" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_SetArea" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_SetDbType" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_GetSupportedDbType" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_DestroyConfig" + }, + {"name":"OH_Rdb_GetOrOpen" }, + { + "first_introduced": "14", + "name":"OH_Rdb_CreateOrOpen" + }, + { + "name":"OH_Rdb_CloseStore" + }, + { + "name":"OH_Rdb_DeleteStore" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_DeleteStoreV2" + }, + { + "name":"OH_Rdb_Insert" + }, + { + "name":"OH_Rdb_Update" + }, + { + "name":"OH_Rdb_Delete" + }, + { + "name":"OH_Rdb_Query" + }, + { + "name":"OH_Rdb_Execute" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_ExecuteByTrxId" + }, + { + "name":"OH_Rdb_ExecuteQuery" + }, + { + "name":"OH_Rdb_BeginTransaction" + }, + { + "name":"OH_Rdb_RollBack" + }, + { + "name":"OH_Rdb_Commit" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_BeginTransWithTrxId" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_RollBackByTrxId" + }, + { + "first_introduced": "14", + "name":"OH_Rdb_CommitByTrxId" + }, + { + "name":"OH_Rdb_Backup" + }, + { + "name":"OH_Rdb_Restore" + }, + { + "name":"OH_Rdb_GetVersion" + }, + { + "name":"OH_Rdb_SetVersion" + }, + { + "name":"OH_Rdb_SetDistributedTables" + }, + { + "name":"OH_Rdb_FindModifyTime" + }, + { + "name":"OH_Rdb_GetTableDetails" + }, + { + "name":"OH_Rdb_CloudSync" + }, + { + "name":"OH_VBucket_PutAsset" + }, + { + "name":"OH_VBucket_PutAssets" + }, + { + "name":"OH_Data_Asset_SetName" + }, + { + "name":"OH_Data_Asset_SetUri" + }, + { + "name":"OH_Data_Asset_SetPath" + }, + { + "name":"OH_Data_Asset_SetCreateTime" + }, + { + "name":"OH_Data_Asset_SetModifyTime" + }, + { + "name":"OH_Data_Asset_SetSize" + }, + { + "name":"OH_Data_Asset_SetStatus" + }, + { + "name":"OH_Data_Asset_GetName" + }, + { + "name":"OH_Data_Asset_GetUri" + }, + { + "name":"OH_Data_Asset_GetPath" + }, + { + "name":"OH_Data_Asset_GetCreateTime" + }, + { + "name":"OH_Data_Asset_GetModifyTime" + }, + { + "name":"OH_Data_Asset_GetSize" + }, + { + "name":"OH_Data_Asset_GetStatus" + }, + { + "name":"OH_Data_Asset_CreateOne" + }, + { + "name":"OH_Data_Asset_DestroyOne" + }, + { + "name":"OH_Data_Asset_CreateMultiple" + }, + { + "name":"OH_Data_Asset_DestroyMultiple" + }, + { + "name":"OH_Rdb_Subscribe" + }, + { + "name":"OH_Rdb_Unsubscribe" + }, + { + "name":"OH_Rdb_SubscribeAutoSyncProgress" + }, + { + "name":"OH_Rdb_UnsubscribeAutoSyncProgress" + }, + { + "name":"OH_Rdb_LockRow" + }, + { + "name":"OH_Rdb_UnlockRow" + }, + { + "name":"OH_Rdb_QueryLockedRow" + }, + { + "first_introduced": "16", + "name":"OH_Value_Create" + }, + { + "first_introduced": "16", + "name":"OH_Value_Destroy" + }, + { + "first_introduced": "16", + "name":"OH_Value_PutNull" + }, + { + "first_introduced": "16", + "name":"OH_Value_PutInt" + }, + { + "first_introduced": "16", + "name":"OH_Value_PutReal" + }, + { + "first_introduced": "16", + "name":"OH_Value_PutText" + }, + { + "first_introduced": "16", + "name":"OH_Value_PutBlob" + }, + { + "first_introduced": "16", + "name":"OH_Value_PutAsset" + }, + { + "first_introduced": "16", + "name":"OH_Value_PutAssets" + }, + { + "first_introduced": "16", + "name":"OH_Value_PutFloatVector" + }, + { + "first_introduced": "16", + "name":"OH_Value_PutUnlimitedInt" + }, + { + "first_introduced": "16", + "name":"OH_Value_GetType" + }, + { + "first_introduced": "16", + "name":"OH_Value_IsNull" + }, + { + "first_introduced": "16", + "name":"OH_Value_GetInt" + }, + { + "first_introduced": "16", + "name":"OH_Value_GetReal" + }, + { + "first_introduced": "16", + "name":"OH_Value_GetText" + }, + { + "first_introduced": "16", + "name":"OH_Value_GetBlob" + }, + { + "first_introduced": "16", + "name":"OH_Value_GetAsset" + }, + { + "first_introduced": "16", + "name":"OH_Value_GetAssetsCount" + }, + { + "first_introduced": "16", + "name":"OH_Value_GetAssets" + }, + { + "first_introduced": "16", + "name":"OH_Value_GetFloatVectorCount" + }, + { + "first_introduced": "16", + "name":"OH_Value_GetFloatVector" + }, + { + "first_introduced": "16", + "name":"OH_Value_GetUnlimitedIntBand" + }, + { + "first_introduced": "16", + "name":"OH_Value_GetUnlimitedInt" + }, + { + "first_introduced": "16", + "name":"OH_VBuckets_Create" + }, + { + "first_introduced": "16", + "name":"OH_VBuckets_Destroy" + }, + { + "first_introduced": "16", + "name":"OH_VBuckets_PutRow" + }, + { + "first_introduced": "16", + "name":"OH_VBuckets_PutRows" + }, + { + "first_introduced": "16", + "name":"OH_VBuckets_RowCount" + }, + { + "first_introduced": "16", + "name":"OH_Values_Create" + }, + { + "first_introduced": "16", + "name":"OH_Values_Destroy" + }, + { + "first_introduced": "16", + "name":"OH_Values_Put" + }, + { + "first_introduced": "16", + "name":"OH_Values_PutNull" + }, + { + "first_introduced": "16", + "name":"OH_Values_PutInt" + }, + { + "first_introduced": "16", + "name":"OH_Values_PutReal" + }, + { + "first_introduced": "16", + "name":"OH_Values_PutText" + }, + { + "first_introduced": "16", + "name":"OH_Values_PutBlob" + }, + { + "first_introduced": "16", + "name":"OH_Values_PutAsset" + }, + { + "first_introduced": "16", + "name":"OH_Values_PutAssets" + }, + { + "first_introduced": "16", + "name":"OH_Values_PutFloatVector" + }, + { + "first_introduced": "16", + "name":"OH_Values_PutUnlimitedInt" + }, + { + "first_introduced": "16", + "name":"OH_Values_Count" + }, + { + "first_introduced": "16", + "name":"OH_Values_GetType" + }, + { + "first_introduced": "16", + "name":"OH_Values_Get" + }, + { + "first_introduced": "16", + "name":"OH_Values_IsNull" + }, + { + "first_introduced": "16", + "name":"OH_Values_GetInt" + }, + { + "first_introduced": "16", + "name":"OH_Values_GetReal" + }, + { + "first_introduced": "16", + "name":"OH_Values_GetText" + }, + { + "first_introduced": "16", + "name":"OH_Values_GetBlob" + }, + { + "first_introduced": "16", + "name":"OH_Values_GetAsset" + }, + { + "first_introduced": "16", + "name":"OH_Values_GetAssetsCount" + }, + { + "first_introduced": "16", + "name":"OH_Values_GetAssets" + }, + { + "first_introduced": "16", + "name":"OH_Values_GetFloatVectorCount" + }, + { + "first_introduced": "16", + "name":"OH_Values_GetFloatVector" + }, + { + "first_introduced": "16", + "name":"OH_Values_GetUnlimitedIntBand" + }, + { + "first_introduced": "16", + "name":"OH_Values_GetUnlimitedInt" + }, + { + "first_introduced": "16", + "name":"OH_RdbTrans_CreateOptions" + }, + { + "first_introduced": "16", + "name":"OH_RdbTrans_DestroyOptions" + }, + { + "first_introduced": "16", + "name":"OH_RdbTransOption_SetType" + }, + { + "first_introduced": "16", + "name":"OH_RdbTrans_Commit" + }, + { + "first_introduced": "16", + "name":"OH_RdbTrans_Rollback" + }, + { + "first_introduced": "16", + "name":"OH_RdbTrans_Insert" + }, + { + "first_introduced": "16", + "name":"OH_RdbTrans_BatchInsert" + }, + { + "first_introduced": "16", + "name":"OH_RdbTrans_Update" + }, + { + "first_introduced": "16", + "name":"OH_RdbTrans_Delete" + }, + { + "first_introduced": "16", + "name":"OH_RdbTrans_Query" + }, + { + "first_introduced": "16", + "name":"OH_RdbTrans_QuerySql" + }, + { + "first_introduced": "16", + "name":"OH_RdbTrans_Execute" + }, + { + "first_introduced": "16", + "name":"OH_RdbTrans_Destroy" + }, + { + "first_introduced": "16", + "name":"OH_Rdb_CreateTransaction" + }, + { + "first_introduced": "16", + "name":"OH_VBucket_PutFloatVector" + }, + { + "first_introduced": "16", + "name":"OH_VBucket_PutUnlimitedInt" + } ] \ No newline at end of file -- Gitee From ea0a8ca11e9c4e2359167b3db3f0ca6b072cb409 Mon Sep 17 00:00:00 2001 From: zwtmichael Date: Tue, 31 Dec 2024 14:31:37 +0800 Subject: [PATCH 617/620] add tokenizer interface Signed-off-by: zwtmichael --- .../include/relational_store.h | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index 8f4d63962..0ed341f7d 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -185,6 +185,26 @@ typedef enum Rdb_DBType { DBTYPE_BUTT = 64, } Rdb_DBType; +/** + * @brief Define Rdb_Tokenizer type. + * + * @since 16 + */ +typedef enum Rdb_Tokenizer { + /** + * @brief Means not using tokenizer. + */ + RDB_NONE_TOKENIZER = 1, + /** + * @brief Means using native icu tokenizer. + */ + RDB_ICU_TOKENIZER = 2, + /** + * @brief Means using self-developed enhance tokenizer. + */ + RDB_CUSTOM_TOKENIZER = 3, +} Rdb_Tokenizer; + /** * @brief Create OH_Rdb_ConfigV2 which is used to open store * @@ -311,6 +331,18 @@ int OH_Rdb_SetArea(OH_Rdb_ConfigV2 *config, int area); */ int OH_Rdb_SetDbType(OH_Rdb_ConfigV2 *config, int dbType); +/** + * @brief Set property tokenizer into config + * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. + * @param tokenizer Indicates the tokenizer {@link Rdb_Tokenizer} of the database + * @return Returns the status code of the execution. Successful execution returns RDB_OK, + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * {@link RDB_E_NOT_SUPPORTED} - The error code for not support tokenizer. + * @since 16 + */ +int OH_Rdb_SetTokenizer(OH_Rdb_ConfigV2 *config, Rdb_Tokenizer tokenizer); + /** * @brief Get support db type list * @param typeCount The output parameter, which is used to recieve the length of the support db type array. -- Gitee From 71fd0015e4c2d5a294f39d30168dd6bd58674dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=80=E9=B8=A3?= Date: Fri, 3 Jan 2025 16:21:38 +0800 Subject: [PATCH 618/620] add json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李一鸣 --- .../avscreen_capture/libnative_avscreen_capture.ndk.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json b/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json index 8464ce4fd..8b135b291 100644 --- a/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json +++ b/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json @@ -102,5 +102,9 @@ { "first_introduced": "14", "name": "OH_AVScreenCapture_SetMaxVideoFrameRate" + }, + { + "first_introduced": "15", + "name": "OH_AVScreenCapture_ShowCursor" } ] \ No newline at end of file -- Gitee From ea15427ea6c99c277c5d3a7d5a6f8e28289e12ee Mon Sep 17 00:00:00 2001 From: Zhang Jinyu Date: Fri, 3 Jan 2025 17:48:44 +0800 Subject: [PATCH 619/620] =?UTF-8?q?Button=E6=94=AF=E6=8C=81=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=A4=A7=E5=AD=97=E4=BD=93=E7=9A=84=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E6=94=BE=E5=A4=A7=E7=BC=A9=E5=B0=8F=E5=80=8D=E6=95=B0=E8=8C=83?= =?UTF-8?q?=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zhang Jinyu --- arkui/ace_engine/native/native_node.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 122967c2c..f0d609295 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -3390,6 +3390,32 @@ typedef enum { */ NODE_BUTTON_TYPE, + /** + * @brief Defines the minimum font scale attribute, which can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: minimum font scale, in fp. + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: minimum font scale, in fp. + * + * @since 16 + */ + NODE_BUTTON_MIN_FONT_SCALE, + + /** + * @brief Defines the maximum font scale attribute, which can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: maximum font scale, in fp. + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: maximum font scale, in fp. + * + * @since 16 + */ + NODE_BUTTON_MAX_FONT_SCALE, + /** * @brief Defines the current value of the progress indicator. * This attribute can be set, reset, and obtained as required through APIs. -- Gitee From 5e14fd7535106713ade98df445b4fddd41716c11 Mon Sep 17 00:00:00 2001 From: pengzhiwen Date: Fri, 22 Nov 2024 17:42:47 +0800 Subject: [PATCH 620/620] =?UTF-8?q?=E9=9C=80=E8=A6=81capi=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E7=9A=84=E5=B8=83=E5=B1=80=E7=BB=98=E5=88=B6=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: pengzhiwen --- arkui/ace_engine/native/libace.ndk.json | 16 ++++++ arkui/ace_engine/native/native_node.h | 66 +++++++++++++++++++++++++ 2 files changed, 82 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index f72f7e8f1..93b14a1c3 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2558,5 +2558,21 @@ { "first_introduced": "16", "name": "OH_ArkUI_PostFrameCallback" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_RegisterLayoutCallbackOnNodeHandle" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_RegisterDrawCallbackOnNodeHandle" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_UnregisterLayoutCallbackOnNodeHandle" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_UnregisterDrawCallbackOnNodeHandle" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 122967c2c..2daab8f56 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -8057,6 +8057,21 @@ typedef enum { NODE_CONTENT_EVENT_ON_DETACH_FROM_WINDOW = 1, } ArkUI_NodeContentEventType; +/** + * @brief Enumerates the inspector error codes. + * @since 16 + */ +typedef enum { + /** + * @error Success. + */ + ARKUI_INSPECTOR_NATIVE_RESULT_SUCCESSFUL = 0, + /** + * @error Invalid parameter. + */ + ARKUI_INSPECTOR_NATIVE_RESULT_BAD_PARAMETER = -1, +} ArkUI_InspectorErrorCode; + /** * @brief Defines the general structure of a node content event. * @since 12 @@ -8420,6 +8435,57 @@ float OH_ArkUI_SystemFontStyleEvent_GetFontWeightScale(const ArkUI_SystemFontSty */ int32_t OH_ArkUI_NodeUtils_GetAttachedNodeHandleById(const char* id, ArkUI_NodeHandle* node); +/** + * @brief Registers a callback for node when layout is completed. + * + * @param node Indicates the target node. + * @param userData Indicates the custom data used in onLayoutCompleted callback function. + * @param onLayoutCompleted Indicates the function when layout completed is callback. + * @return error code + {@link ARKUI_INSPECTOR_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. + * {@link ARKUI_INSPECTOR_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. + * @since 16 + */ +int32_t OH_ArkUI_RegisterLayoutCallbackOnNodeHandle(ArkUI_NodeHandle node, + void* userData, void (*onLayoutCompleted)(void* userData)); + + +/** + * @brief Registers a callback for node when draw is completed. + * + * @param node Indicates the target node. + * @param userData Indicates the custom data used in onDrawCompleted callback function. + * @param onDrawCompleted Indicates the function when draw completed is callback. + * @return error code + {@link ARKUI_INSPECTOR_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. + * {@link ARKUI_INSPECTOR_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. + * @since 16 + */ +int32_t OH_ArkUI_RegisterDrawCallbackOnNodeHandle(ArkUI_NodeHandle node, + void* userData, void (*onDrawCompleted)(void* userData)); + +/** + * @brief Unregisters the layout completed callback for node. + * + * @param node Indicates the target node. + * @return error code + {@link ARKUI_INSPECTOR_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. + * {@link ARKUI_INSPECTOR_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. + * @since 16 + */ +int32_t OH_ArkUI_UnregisterLayoutCallbackOnNodeHandle(ArkUI_NodeHandle node); + +/** + * @brief Unregisters the draw completed callback for node. + * + * @param node Indicates the target node. + * @return error code + {@link ARKUI_INSPECTOR_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. + * {@link ARKUI_INSPECTOR_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. + * @since 16 + */ +int32_t OH_ArkUI_UnregisterDrawCallbackOnNodeHandle(ArkUI_NodeHandle node); + #ifdef __cplusplus }; #endif -- Gitee