diff --git a/AbilityKit/ability_runtime/ability_runtime_common.h b/AbilityKit/ability_runtime/ability_runtime_common.h index 704d6c80fb98a2a918510be289f3a1c486635144..bf7361552810d6d6618e79d71c486b7f23071234 100644 --- a/AbilityKit/ability_runtime/ability_runtime_common.h +++ b/AbilityKit/ability_runtime/ability_runtime_common.h @@ -138,6 +138,21 @@ typedef enum { * @since 17 */ ABILITY_RUNTIME_ERROR_CODE_APP_INSTANCE_KEY_NOT_SUPPORTED = 16000079, + /** + * @error Failed to obtain the target application information. + * @since 21 + */ + ABILITY_RUNTIME_ERROR_CODE_GET_APPLICATION_INFO_FAILED = 16000081, + /** + * @error Start UIAbility timeout. + * @since 21 + */ + ABILITY_RUNTIME_ERROR_CODE_START_TIMEOUT = 16000133, + /** + * @error The API does not support being called in the main thread. + * @since 21 + */ + ABILITY_RUNTIME_ERROR_CODE_MAIN_THREAD_NOT_SUPPORTED = 16000134, } AbilityRuntime_ErrorCode; #ifdef __cplusplus diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index 00c5d579d453d5a8c0619d9712f438f26a18565d..af2d128fc67c5467b51f5d2c6536364fdbc54692 100644 --- a/AbilityKit/ability_runtime/application_context.h +++ b/AbilityKit/ability_runtime/application_context.h @@ -294,7 +294,7 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbility(AbilityBase_Want * AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbilityWithStartOptions(AbilityBase_Want *want, AbilityRuntime_StartOptions *options); - /** +/** * @brief Obtain the version code of the application. * * @param versionCode The version code of the application. @@ -307,6 +307,79 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbilityWithStartOptions(Ab */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetVersionCode(int64_t* versionCode); +/** + * @brief Obtain the launch parameter of starting UIAbility. + * + * @param buffer A pointer to a buffer that receives the launch parameter of starting UIAbility. + * @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 21 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetLaunchParameter( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief Obtain the latest parameter of starting UIAbility. + * + * @param buffer A pointer to a buffer that receives the latest parameter of starting UIAbility. + * @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 21 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetLatestParameter( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief Starts self UIAbility with start options and receives the process ID. + * + * @permission ohos.permission.NDK_START_SELF_UI_ABILITY + * @param want The arguments passed to start self UIAbility. + * For details, see {@link AbilityBase_Want}. + * @param options The start options passed to start self UIAbility. + * For details, see {@link AbilityRuntime_StartOptions}. + * @param targetPid The process ID of the started UIAbility. + * @return Returns {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the call is successful. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_PERMISSION_DENIED} if the caller has no correct permission. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the arguments provided is invalid. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_NOT_SUPPORTED} if the device does not support starting self uiability. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_NO_SUCH_ABILITY} if the target ability does not exist. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_INCORRECT_ABILITY_TYPE} if the ability type is incorrect. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_CROWDTEST_EXPIRED} if the crowdtesting application expires. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_WUKONG_MODE} if the ability cannot be started in Wukong mode. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_CONTROLLED} if the app is controlled. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_EDM_CONTROLLED} if the app is controlled by EDM. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_CROSS_APP} if the caller tries to start a different application. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_INTERNAL} if internal error occurs. such as connect system service failed. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_NOT_TOP_ABILITY} if the caller is not foreground process. + * Returns {@link ABILITY_RUNTIME_ERROR_VISIBILITY_SETTING_DISABLED} if setting visibility is disabled. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_MULTI_APP_NOT_SUPPORTED} + * if the app clone or multi-instance is not supported. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_INVALID_APP_INSTANCE_KEY} if the app instance key is invalid. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_UPPER_LIMIT_REACHED} if the number of app instances reached the limit. + * Returns {@link ABILITY_RUNTIME_ERROR_MULTI_INSTANCE_NOT_SUPPORTED} if the multi-instance is not supported. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_APP_INSTANCE_KEY_NOT_SUPPORTED} + * if the APP_INSTANCE_KEY cannot be specified. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_START_TIMEOUT} if starting UIAbility time out. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_MAIN_THREAD_NOT_SUPPORTED} + * if the API is called in the main thread of the app. + * For details, see {@link AbilityRuntime_ErrorCode}. + * @since 21 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbilityWithPidResult(AbilityBase_Want *want, + AbilityRuntime_StartOptions *options, int32_t *targetPid); + #ifdef __cplusplus } // extern "C" #endif diff --git a/AbilityKit/ability_runtime/libability_runtime.ndk.json b/AbilityKit/ability_runtime/libability_runtime.ndk.json index f7939128e402a6a67baa4deac6554689b64f434d..3f494e738455c1b7351c70c453df4230df032c0e 100644 --- a/AbilityKit/ability_runtime/libability_runtime.ndk.json +++ b/AbilityKit/ability_runtime/libability_runtime.ndk.json @@ -178,9 +178,21 @@ { "first_introduced": "20", "name": "OH_AbilityRuntime_ApplicationContextGetResourceDir" + }, + { + "first_introduced": "21", + "name": "OH_AbilityRuntime_ApplicationContextGetLaunchParameter" + }, + { + "first_introduced": "21", + "name": "OH_AbilityRuntime_ApplicationContextGetLatestParameter" }, { "first_introduced": "21", "name": "OH_AbilityRuntime_ApplicationContextGetVersionCode" + }, + { + "first_introduced": "21", + "name": "OH_AbilityRuntime_StartSelfUIAbilityWithPidResult" } ] \ No newline at end of file diff --git a/BasicServicesKit/commonevent/oh_commonevent.h b/BasicServicesKit/commonevent/oh_commonevent.h index d3f16a959a7268aa4bfa0d6b10580c5c0be36b15..a5cca763b88a3edaceb57588159d05487dcbe8a6 100644 --- a/BasicServicesKit/commonevent/oh_commonevent.h +++ b/BasicServicesKit/commonevent/oh_commonevent.h @@ -227,19 +227,19 @@ CommonEvent_ErrCode OH_CommonEvent_UnSubscribe(const CommonEvent_Subscriber* sub const char* OH_CommonEvent_GetEventFromRcvData(const CommonEvent_RcvData* rcvData); /** - * @brief Get event result code from callback data. + * @brief Get event code from callback data. * * @param rcvData Indicates the callback data. - * @return Returns the event of result code, default is 0. + * @return Returns the event of code, default is 0. * @since 12 */ int32_t OH_CommonEvent_GetCodeFromRcvData(const CommonEvent_RcvData* rcvData); /** - * @brief Get event result data from callback data. + * @brief Get event data from callback data. * * @param rcvData Indicates the callback data. - * @return Returns the event of result data, default is null. + * @return Returns the event of data, default is null. * @since 12 */ const char* OH_CommonEvent_GetDataStrFromRcvData(const CommonEvent_RcvData* rcvData); @@ -628,7 +628,7 @@ CommonEvent_ErrCode OH_CommonEvent_SetDoubleArrayToParameters(CommonEvent_Parame const double* value, size_t num); /** - * @brief Publish a standard commen event. + * @brief Publish a commen event. * * @param event Indicates the name of the common event. * @return Returns the error code. @@ -704,39 +704,39 @@ bool OH_CommonEvent_AbortCommonEvent(CommonEvent_Subscriber* subscriber); bool OH_CommonEvent_ClearAbortCommonEvent(CommonEvent_Subscriber* subscriber); /** - * @brief Get result code from an ordered event by a subscriber. + * @brief Get code from an ordered event by a subscriber. * * @param subscriber Indicates the subscriber. - * @return Returns the result code, default is 0. + * @return Returns the code, default is 0. * @since 18 */ int32_t OH_CommonEvent_GetCodeFromSubscriber(const CommonEvent_Subscriber* subscriber); /** - * @brief Set result code to an ordered event by a subscriber. + * @brief Set code to an ordered event by a subscriber. * * @param subscriber Indicates the subscriber. - * @param code Indicates the result code. + * @param code Indicates the code. * @return Returns the result of operation, true means succeeded. * @since 18 */ bool OH_CommonEvent_SetCodeToSubscriber(CommonEvent_Subscriber* subscriber, int32_t code); /** - * @brief Get result data from an ordered event by a subscriber. + * @brief Get data from an ordered event by a subscriber. * * @param subscriber Indicates the subscriber. - * @return Returns the result data, default is null. + * @return Returns the data, default is null. * @since 18 */ const char* OH_CommonEvent_GetDataFromSubscriber(const CommonEvent_Subscriber* subscriber); /** - * @brief Set result data to an ordered event by a subscriber. + * @brief Set data to an ordered event by a subscriber. * * @param subscriber Indicates the subscriber. - * @param data Indicates the result data. - * @param length Indicates the length of result data. + * @param data Indicates the data. + * @param length Indicates the length of data. * @return Returns the result of operation, true means succeeded. * @since 18 */ diff --git a/BasicServicesKit/ohscan.h b/BasicServicesKit/ohscan.h index acaa4ec22c1834b56a05eb089b35cd38459f3d87..5a5020091e11f0884b4f00db7dd83db1c3663e2b 100644 --- a/BasicServicesKit/ohscan.h +++ b/BasicServicesKit/ohscan.h @@ -185,7 +185,7 @@ int32_t OH_Scan_StartScannerDiscovery(Scan_ScannerDiscoveryCallback callback); * {@link SCAN_ERROR_DEVICE_BUSY} Indicates that the scanner is busy. * {@link SCAN_ERROR_INVALID_PARAMETER} Indicates that the input parameter is invalid. * {@link SCAN_ERROR_IO_ERROR} Indicates an error occured while communicating with the device. - * {@link SCAN_ERROR_NO_MEM} Indicates an insufficent amount of memory is available. + * {@link SCAN_ERROR_NO_MEMORY} Indicates an insufficent amount of memory is available. * @syscap SystemCapability.Print.PrintFramework * @since 12 */ @@ -259,7 +259,7 @@ int32_t OH_Scan_SetScannerParameter(const char* scannerId, const int32_t option, * {@link SCAN_ERROR_NO_DOCS} Indicates the document feeder is out of documents. * {@link SCAN_ERROR_COVER_OPEN} Indicates the scanner cover is open. * {@link SCAN_ERROR_IO_ERROR} Indicates an error occurred while communicating with the device. - * {@link SCAN_ERROR_NO_MEM} Indicates an insufficent amount of memory is available. + * {@link SCAN_ERROR_NO_MEMORY} Indicates an insufficent amount of memory is available. * {@link SCAN_ERROR_INVALID_PARAMETER} Indicates that the input parameter is invalid. * {@link SCAN_ERROR_DEVICE_BUSY} Indicates the device is busy, the operation should be retried later. * @syscap SystemCapability.Print.PrintFramework @@ -298,7 +298,7 @@ int32_t OH_Scan_CancelScan(const char* scannerId); * {@link SCAN_ERROR_NO_DOCS} Indicates the document feeder is out of documents. * {@link SCAN_ERROR_COVER_OPEN} Indicates the scanner cover is open. * {@link SCAN_ERROR_IO_ERROR} Indicates an error occurred while communicating with the scanner. - * {@link SCAN_ERROR_NO_MEM} Indicates an insufficent amount of memory is available. + * {@link SCAN_ERROR_NO_MEMORY} Indicates an insufficent amount of memory is available. * {@link SCAN_ERROR_DEVICE_BUSY} Indicates the device is busy, the operation should be retried later. * @syscap SystemCapability.Print.PrintFramework * @since 12 diff --git a/CryptoArchitectureKit/crypto_rand.h b/CryptoArchitectureKit/crypto_rand.h index 1e9a4f8e017aaaae3d68c722704b4ef00bfb1acd..a3b261c830acf65f095a5014c3f79836baeec26a 100644 --- a/CryptoArchitectureKit/crypto_rand.h +++ b/CryptoArchitectureKit/crypto_rand.h @@ -98,6 +98,19 @@ const char *OH_CryptoRand_GetAlgoName(OH_CryptoRand *ctx); */ OH_Crypto_ErrCode OH_CryptoRand_SetSeed(OH_CryptoRand *ctx, Crypto_DataBlob *seed); +/** + * @brief Enables the hardware entropy source. + * + * @param ctx Indicates the random number generator context. + * @return {@link OH_Crypto_ErrCode#CRYPTO_SUCCESS} 0 - If the operation is successful. + * {@link OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED} 801 - If the operation is not supported. + * {@link OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR} 17620001 - If memory operation failed. + * {@link OH_Crypto_ErrCode#CRYPTO_PARAMETER_CHECK_FAILED} 17620003 - If parameter check failed. + * {@link OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR} 17630001 - If crypto operation failed. + * @since 21 + */ +OH_Crypto_ErrCode OH_CryptoRand_EnableHardwareEntropy(OH_CryptoRand *ctx); + /** * @brief Destroys the random number generator context. * diff --git a/CryptoArchitectureKit/libcrypto.ndk.json b/CryptoArchitectureKit/libcrypto.ndk.json index 76e0508480c6fc27ff9d2e82c7aa4d76033b36a4..81eb1be27b4f6cb6b840eb1f90550195ca84c7da 100644 --- a/CryptoArchitectureKit/libcrypto.ndk.json +++ b/CryptoArchitectureKit/libcrypto.ndk.json @@ -367,6 +367,10 @@ "first_introduced": "20", "name": "OH_CryptoRand_SetSeed" }, + { + "first_introduced": "21", + "name": "OH_CryptoRand_EnableHardwareEntropy" + }, { "first_introduced": "20", "name": "OH_CryptoRand_Destroy" diff --git a/ability/ability_runtime/child_process/libchild_process.ndk.json b/ability/ability_runtime/child_process/libchild_process.ndk.json index 60cf2b93d475ae34e9eea9c1b247b2e625e6643a..f4fa170602536e3b67727e0f5731d2ee5b9dd19f 100644 --- a/ability/ability_runtime/child_process/libchild_process.ndk.json +++ b/ability/ability_runtime/child_process/libchild_process.ndk.json @@ -42,5 +42,9 @@ { "first_introduced": "20", "name": "OH_Ability_StartNativeChildProcessWithConfigs" + }, + { + "first_introduced": "21", + "name": "OH_Ability_ChildProcessConfigs_SetIsolationUid" } ] diff --git a/ability/ability_runtime/child_process/native_child_process.h b/ability/ability_runtime/child_process/native_child_process.h index ce59adf740bd17bd4832cc76d0e6ef13fddae81c..e0029b46f9d0b077b103212912525da01045a9a6 100644 --- a/ability/ability_runtime/child_process/native_child_process.h +++ b/ability/ability_runtime/child_process/native_child_process.h @@ -152,30 +152,45 @@ typedef struct Ability_ChildProcessConfigs Ability_ChildProcessConfigs; Ability_ChildProcessConfigs* OH_Ability_CreateChildProcessConfigs(); /** - * @brief Destroys a child process configs object and releases associated rescources. + * @brief Destroys a child process configs object and releases associated resources. * * @param configs Pointer to the child process configs object to be destroyed. * After this call, the pointer becomes invalid and must not be used. * Passing nullptr is allowed and will be ignored. * @return Returns {@link NCP_NO_ERROR} if the operation is successful or if the input is nullptr. - * Returns {@link NCP_NO_ERR_INVALID_PARAM} if the input parameters are invalid. + * Returns {@link NCP_ERR_INVALID_PARAM} if the input parameters are invalid. * @since 20 */ Ability_NativeChildProcess_ErrCode OH_Ability_DestroyChildProcessConfigs(Ability_ChildProcessConfigs* configs); /** * @brief Sets the isolation mode for the specified child process configs. - * The isolationMode only takes effect in {@link OH_Ability_StartNativeChildProcessWithConfigs}. * * @param configs Pointer to the child process configs object. Must not be nullptr. * @param isolationMode The isolation mode to set. See {@link NativeChildProcess_IsolationMode} for details. - * @return Returns {@link NCP_NO_ERROR} if the isolation mode is set successful. - * Returns {@link NCP_NO_ERR_INVALID_PARAM} if the input parameters are invalid. + * @return Returns {@link NCP_NO_ERROR} if the isolation mode is set successfully. + * Returns {@link NCP_ERR_INVALID_PARAM} if the input parameters are invalid. * @since 20 */ Ability_NativeChildProcess_ErrCode OH_Ability_ChildProcessConfigs_SetIsolationMode( Ability_ChildProcessConfigs* configs, NativeChildProcess_IsolationMode isolationMode); +/** + * @brief Sets the UID isolation flag for the specified child process configs. + * The isolationUid only takes effect when {@link OH_Ability_ChildProcessConfigs_SetIsolationMode} + * is set to {@link NCP_ISOLATION_MODE_ISOLATED}. + * + * @param configs Pointer to the child process configs object. Must not be nullptr. + * @param isolationUid The UID isolation setting to apply. + * - true: uses independent UID + * - false: uses parent process's UID + * @return Returns {@link NCP_NO_ERROR} if the UID isolation flag is set successfully. + * Returns {@link NCP_ERR_INVALID_PARAM} if the input parameters are invalid. + * @since 21 + */ +Ability_NativeChildProcess_ErrCode OH_Ability_ChildProcessConfigs_SetIsolationUid( + Ability_ChildProcessConfigs* configs, bool isolationUid); + /** * @brief Sets the process name for the specified child process configs. * @@ -184,8 +199,8 @@ Ability_NativeChildProcess_ErrCode OH_Ability_ChildProcessConfigs_SetIsolationMo * Must be a non-empty string containing only letters, digits, or underscores. * Maximum length is 64 characters. * The name ultimately assigned to the process is {bundleName}:{processName}. - * @return Returns {@link NCP_NO_ERROR} if the process name is set successful. - * Returns {@link NCP_NO_ERR_INVALID_PARAM} if the input parameters are invalid. + * @return Returns {@link NCP_NO_ERROR} if the process name is set successfully. + * Returns {@link NCP_ERR_INVALID_PARAM} if the input parameters are invalid. * @since 20 */ Ability_NativeChildProcess_ErrCode OH_Ability_ChildProcessConfigs_SetProcessName(Ability_ChildProcessConfigs* configs, @@ -426,7 +441,7 @@ Ability_NativeChildProcess_ErrCode OH_Ability_StartNativeChildProcessWithConfigs NativeChildProcess_Args* OH_Ability_GetCurrentChildProcessArgs(); /** - * @brief Define a callback function to handle the exit of a native child process. + * @brief Defines a callback function to handle the exit of a native child process. * * @param pid The pid of the exited native child process. * @param signal The signal of the exited native child process. @@ -434,14 +449,13 @@ NativeChildProcess_Args* OH_Ability_GetCurrentChildProcessArgs(); */ typedef void (*OH_Ability_OnNativeChildProcessExit)(int32_t pid, int32_t signal); -/** + /** * @brief Register a native child process exit callback. * Registering the same callback repeatedly will only keep one. * * @param onProcessExit Pointer to the callback function to handle the exit of a native child process. * For details, see {@link OH_Ability_OnNativeChildProcessExit}. * @return Returns {@link NCP_NO_ERROR} if the call is successful. - * Returns {@link NCP_ERR_INVALID_PARAM} if the param is invalid. * Returns {@link NCP_ERR_INTERNAL} if internal error occurs. * For details, see {@link Ability_NativeChildProcess_ErrCode}. * @since 20 @@ -449,13 +463,12 @@ typedef void (*OH_Ability_OnNativeChildProcessExit)(int32_t pid, int32_t signal) Ability_NativeChildProcess_ErrCode OH_Ability_RegisterNativeChildProcessExitCallback( OH_Ability_OnNativeChildProcessExit onProcessExit); -/** + /** * @brief Unregister a native child process exit callback. * * @param onProcessExit Pointer to the callback function to handle the exit of a native child process. * For details, see {@link OH_Ability_OnNativeChildProcessExit}. * @return Returns {@link NCP_NO_ERROR} if the call is successful. - * Returns {@link NCP_ERR_INVALID_PARAM} if the param is invalid. * Returns {@link NCP_ERR_INTERNAL} if internal error occurs. * Returns {@link NCP_ERR_CALLBACK_NOT_EXIST} if the callback is not exist. * For details, see {@link Ability_NativeChildProcess_ErrCode}. diff --git a/ark_runtime/jsvm/jsvm.h b/ark_runtime/jsvm/jsvm.h index d211f329fc60b83e87e3558600f402c6fc38f061..62a4d8f5950b0392c66c635c4e01d50bb4b9ad3f 100644 --- a/ark_runtime/jsvm/jsvm.h +++ b/ark_runtime/jsvm/jsvm.h @@ -1373,7 +1373,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueInt64(JSVM_Env env, * @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 + * {@link JSVM_STRING_EXPECTED } If a non-string JSVM_Value is passed in.\n * @since 11 */ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueStringLatin1(JSVM_Env env, @@ -1394,7 +1394,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueStringLatin1(JSVM_Env env, * @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 + * {@link JSVM_STRING_EXPECTED } If a non-string JSVM_Value is passed in.\n * @since 11 */ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueStringUtf8(JSVM_Env env, @@ -1415,7 +1415,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueStringUtf8(JSVM_Env env, * @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 + * {@link JSVM_STRING_EXPECTED } If a non-string JSVM_Value is passed in.\n * @since 11 */ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueStringUtf16(JSVM_Env env, diff --git a/arkui/ace_engine/native/drag_and_drop.h b/arkui/ace_engine/native/drag_and_drop.h index 15f4de6214044b0b2438c78488e6640e01ba0218..68865dfbdf7508ea622ef9230d51f2216f5c9a24 100644 --- a/arkui/ace_engine/native/drag_and_drop.h +++ b/arkui/ace_engine/native/drag_and_drop.h @@ -467,8 +467,8 @@ float OH_ArkUI_DragEvent_GetVelocity(ArkUI_DragEvent* event); * @brief Obtains the pressed status of modifier keys from a drag event. * * @param event Indicates the pointer to an ArkUI_DragEvent object. - * @param keys {@link ArkUI_ModifierKeyName} Indicates the returned combination of modifier keys that are currently pressed. - * The application can determine the pressed modifier keys through bitwise operations. + * @param keys {@link ArkUI_ModifierKeyName} Indicates the returned combination of modifier keys that are + * currently pressed. The application can determine the pressed modifier keys through bitwise operations. * @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. @@ -499,7 +499,6 @@ ArkUI_ErrorCode OH_ArkUI_DragEvent_GetDisplayId(ArkUI_DragEvent *event, int32_t * @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_DRAG_DATA_SYNC_FAILED} if the data sync is not allowed or failed. * @since 15 */ int32_t OH_ArkUI_DragEvent_StartDataLoading( @@ -968,7 +967,6 @@ int32_t OH_ArkUI_NotifyDragEndPendingDone(int32_t requestIdentify); * to pass a character array for receiving the string and explicitly specify the array length. It is * recommended that the array length be no less than 128 characters. If the length cannot accommodate * the actual bundle name length, the ERROR result will be returned. - * * @param event Indicates the pointer to an ArkUI_DragEvent object. * @param bundleName A string array used to receive the source application's bundle name. * @param length Use this to explicitly specify the length of the incoming string array. diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 4a896d6404f7eddd28bb31e6377d17f8828491a0..1e0b4c4dfee2eca7b881132f18f4a8a34c91c6aa 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -4056,15 +4056,83 @@ "name": "OH_ArkUI_RenderNodeUtils_DisposeRenderNodeClipOption" }, { - "first_introduced": "20", + "first_introduced": "21", "name": "OH_ArkUI_PostAsyncUITask" }, { - "first_introduced": "20", + "first_introduced": "21", "name": "OH_ArkUI_PostUITask" }, { - "first_introduced": "20", + "first_introduced": "21", "name": "OH_ArkUI_PostUITaskAndWait" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_NativeModule_RegisterCommonEvent" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_NativeModule_UnregisterCommonEvent" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_NativeModule_RegisterCommonVisibleAreaApproximateChangeEvent" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_NativeModule_UnregisterCommonVisibleAreaApproximateChangeEvent" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_PositionEdges_Create" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_PositionEdges_Copy" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_PositionEdges_Dispose" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_PositionEdges_SetTop" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_PositionEdges_GetTop" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_PositionEdges_SetLeft" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_PositionEdges_GetLeft" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_PositionEdges_SetBottom" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_PositionEdges_GetBottom" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_PositionEdges_SetRight" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_PositionEdges_GetRight" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_ListItemSwipeAction_Expand" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_ListItemSwipeAction_Collapse" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_interface.h b/arkui/ace_engine/native/native_interface.h index 4c3405779511912c2b8b668c24e7ba5990028b62..0acd918d524399156a9b8b79b775bc2e73bcd4f5 100644 --- a/arkui/ace_engine/native/native_interface.h +++ b/arkui/ace_engine/native/native_interface.h @@ -60,7 +60,7 @@ typedef enum { /** * API related to supported multi thread UI components. * For details, see the struct definition in . - * @since 20 + * @since 21 */ ARKUI_MULTI_THREAD_NATIVE_NODE, } ArkUI_NativeAPIVariantKind; diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index ce5b57eb466694a3560506fa7a0111385ae2d37f..4d0d69e1ea932e22dbd2bafdf7c79adf70a51b7c 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -946,6 +946,44 @@ typedef enum { * .value[1].f32: offset of the overlay relative to the upper left corner of itself on the x-axis, in vp. \n * .value[2].f32: offset of the overlay relative to the upper left corner of itself on the y-axis, in vp. * + * @since 12 + */ + /** + * @brief Defines the overlay attribute, which can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .string: mask text.\n + * .value[0]?.i32: position of the overlay relative to the component. Optional. + * The parameter type is {@link ArkUI_Alignment}. + * The default value is ARKUI_ALIGNMENT_TOP_START. \n + * .value[1]?.f32: offset of the overlay relative to the upper left corner of itself on the x-axis, in vp. Optional. \n + * .value[2]?.f32: offset of the overlay relative to the upper left corner of itself on the y-axis, in vp. Optional. + * \n + * .value[3]?.i32: the layout direction. + * The parameter type is {@link ArkUI_Direction}. + * The default value is ARKUI_DIRECTION_LTR. \n + * In most cases, this parameter should be set to Auto, this allowing the system to handle + * the layout direction automatically. If you need to keep a specific direction in any situation, set it to + * either LTR (Left-to-Right) or RTL (Right-to-Left). Optional. + * \n + * .object: the node tree used as the overlay. + * The parameter type is {@link ArkUI_NodeHandle}. + * The default value is nullptr. \n + * this parameter is conflict with .string, and it has lower priority than .string. Optional. + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .string: mask text.\n + * .value[0].i32: position of the overlay relative to the component. + * The parameter type is {@link ArkUI_Alignment}. + * The default value is ARKUI_ALIGNMENT_TOP_START. \n + * .value[1].f32: offset of the overlay relative to the upper left corner of itself on the x-axis, in vp. \n + * .value[2].f32: offset of the overlay relative to the upper left corner of itself on the y-axis, in vp. + * .value[3].i32: the layout direction. + * The parameter type is {@link ArkUI_Direction}. + * The default value is ARKUI_DIRECTION_LTR. \n + * .object: the overlay node handle. \n + * + * @since 21 */ NODE_OVERLAY, /** @@ -1250,6 +1288,7 @@ typedef enum { * */ NODE_MARK_ANCHOR, + /** * @brief Defines the position of the background image in the component, that is, the coordinates relative to * the upper left corner of the component. This attribute can be set, reset, and obtained as required through APIs. @@ -1262,6 +1301,28 @@ typedef enum { * .value[0].f32: position along the x-axis, in px. \n * .value[1].f32: position along the y-axis, in px. \n * + * @since 12 + */ + /** + * @brief Defines the position of the background image in the component, that is, the coordinates relative to + * the upper left corner of the 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: position along the x-axis, in px. \n + * .value[1].f32: position along the y-axis, in px. \n + * .value[2].?i32: the alignment mode. The data type is {@link ArkUI_Alignment}. + * The default value is ARKUI_ALIGNMENT_TOP_START. \n + * .value[3].?i32: the direction. The type is {@link ArkUI_Direction}. + * The default value is ARKUI_DIRECTION_AUTO. \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: position along the x-axis, in px. \n + * .value[1].f32: position along the y-axis, in px. \n + * .value[2].i32: the alignment mode. The data type is {@link ArkUI_Alignment}. + * The default value is ARKUI_ALIGNMENT_TOP_START. \n + * .value[3].i32: the direction. The type is {@link ArkUI_Direction}. + * The default value is ARKUI_DIRECTION_AUTO. \n + * + * @since 21 */ NODE_BACKGROUND_IMAGE_POSITION, /** @@ -1999,6 +2060,53 @@ typedef enum { */ NODE_ROTATE_ANGLE = 104, + /** + * @brief Defines the width attribute with param type LayoutPolicy, 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: the LayoutPolicy that the width of the component follows.\n + * The parameter type is {@link ArkUI_LayoutPolicy}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: the LayoutPolicy that the width of the component follows.\n + * The parameter type is {@link ArkUI_LayoutPolicy}. \n + * + * @since 21 + */ + NODE_WIDTH_LAYOUTPOLICY = 105, + + /** + * @brief Defines the height attribute with param type LayoutPolicy, 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: the LayoutPolicy that the height of the component follows.\n + * The parameter type is {@link ArkUI_LayoutPolicy}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: the LayoutPolicy that the height of the component follows.\n + * The parameter type is {@link ArkUI_LayoutPolicy}. \n + * + * @since 21 + */ + NODE_HEIGHT_LAYOUTPOLICY = 106, + + /** + * @brief Defines the position attribute in param type Edges, which specifies the position of the component + * by the distance relative to the parent container's four edges. 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 indicates struct of edges for position. The parameter type is {@link ArkUI_PositionEdges}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .object indicates struct of edges for position. The parameter type is {@link ArkUI_PositionEdges}. \n + * + * @since 21 + */ + NODE_POSITION_EDGES = 107, + /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. * @@ -2491,6 +2599,22 @@ typedef enum { */ NODE_TEXT_VERTICAL_ALIGN = 1035, + /** + * @brief Sets the content align of the text. + * 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: content align of the text, specified using the {@link ArkUI_TextContentAlign} + * enum. The default value is ARKUI_TEXT_CONTENT_ALIGN_TOP. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: content align of the text, specified using the {@link ArkUI_TextContentAlign} + * enum. \n + * + * @since 21 + */ + NODE_TEXT_CONTENT_ALIGN = 1036, + /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. * @@ -2869,6 +2993,19 @@ typedef enum { * @since 21 */ NODE_IMAGE_ORIENTATION = 4020, + /** + * @brief Set the range of SVG parsing capabilities supported through enable switch. + * 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: enable switch.\n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: enable switch.\n + * + * @since 21 + */ + NODE_IMAGE_SUPPORT_SVG2 = 4021, /** * @brief Defines the color of the component when it is selected. * This attribute can be set, reset, and obtained as required through APIs. @@ -4088,25 +4225,19 @@ typedef enum { */ NODE_XCOMPONENT_ID = MAX_NODE_SCOPE_NUM * ARKUI_NODE_XCOMPONENT, /** - * @brief Defines the type of the component. - * This attribute can be set, reset, and obtained as required through APIs. + * @brief Specifies the type of the XComponent component. This attribute is read-only. \n + * The type of the XComponent component must be explicitly set during creation using {@link ARKUI_NODE_XCOMPONENT} or {@link ARKUI_NODE_XCOMPONENT_TEXTURE}, and cannot be modified afterward. \n + * Attempting to change the type through {@link setAttribute} will cause rendering exceptions. * - * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n - * .value[0].i32: type {@link ArkUI_XComponentType}. The default value is ARKUI_XCOMPONENT_TYPE_SURFACE. \n - * \n * Format of the return value {@link ArkUI_AttributeItem}:\n * .value[0].i32: type {@link ArkUI_XComponentType}. \n * */ NODE_XCOMPONENT_TYPE, /** - * @brief Defines the width and height of the component. - * This attribute can be set and obtained as required through APIs. + * @brief Specifies the size of the XComponent component. This attribute is read-only. \n + * Attempting to modify the size through {@link setAttribute} will have no effect. * - * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n - * .value[0].u32: width, in px. \n - * .value[1].u32: height, in px. \n - * \n * Format of the return value {@link ArkUI_AttributeItem}:\n * .value[0].u32: width, in px. \n * .value[1].u32: height, in px. \n @@ -5003,6 +5134,71 @@ typedef enum { */ NODE_SLIDER_SUFFIX, + /** + * @brief Defines the color of the slider block. 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: array of color stops, each of which consists of a color and its stop position. + * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n \n + * colors: colors of the color stops. \n + * stops: stop positions of the color stops. \n + * size: number of colors. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .object: array of color stops, each of which consists of a color and its stop position. + * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n \n + * colors: colors of the color stops. \n + * stops: stop positions of the color stops. \n + * size: number of colors. \n + * + * @since 21 + */ + NODE_SLIDER_BLOCK_LINEAR_GRADIENT_COLOR, + + /** + * @brief Defines the background color of the slider. 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: array of color stops, each of which consists of a color and its stop position. + * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n \n + * colors: colors of the color stops. \n + * stops: stop positions of the color stops. \n + * size: number of colors. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .object: array of color stops, each of which consists of a color and its stop position. + * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n \n + * colors: colors of the color stops. \n + * stops: stop positions of the color stops. \n + * size: number of colors. \n + * + * @since 21 + */ + NODE_SLIDER_TRACK_LINEAR_GRADIENT_COLOR, + + /** + * @brief Defines the color of the selected part of the slider track. 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: array of color stops, each of which consists of a color and its stop position. + * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n \n + * colors: colors of the color stops. \n + * stops: stop positions of the color stops. \n + * size: number of colors. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .object: array of color stops, each of which consists of a color and its stop position. + * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n \n + * colors: colors of the color stops. \n + * stops: stop positions of the color stops. \n + * size: number of colors. \n + * + * @since 21 + */ + NODE_SLIDER_SELECTED_LINEAR_GRADIENT_COLOR, + /** * @brief Set the selection status of an option button. Attribute setting, * attribute resetting, and attribute obtaining are supported. @@ -7322,6 +7518,21 @@ typedef enum { */ NODE_ON_HOVER_MOVE = 29, + /** + * @brief Defines the size change event. + * + * The event will be triggered when the component size changes. + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. + * {@link ArkUI_NodeComponentEvent} contains four parameters: + * ArkUI_NodeComponentEvent.data[0].f32: the width of the old rectangle. + * ArkUI_NodeComponentEvent.data[1].f32: the height of the old rectangle. + * ArkUI_NodeComponentEvent.data[2].f32: the width of the new rectangle. + * ArkUI_NodeComponentEvent.data[3].f32: the height of the new rectangle. + * @since 21 + */ + NODE_ON_SIZE_CHANGE = 30, + /** * @brief Triggers onDetectResultUpdate callback * when the text is set to TextDataDetectorConfig and recognized successfully. @@ -9895,8 +10106,8 @@ int32_t OH_ArkUI_NodeUtils_MoveTo(ArkUI_NodeHandle node, ArkUI_NodeHandle target /** * @brief Triggers node updates in the current frame. - * When node attributes are modified after the current frame's build phase (i.e., after - * the unified processing of dirty nodes), the node updates will be deferred to the next + * When node attributes are modified after the current frame's build phase, + * the node updates will be deferred to the next * frame. This function forces immediate node updates within the current frame to * ensure rendering effects are applied synchronously. * @@ -10129,7 +10340,7 @@ int32_t OH_ArkUI_SetForceDarkConfig(ArkUI_ContextHandle uiContext, bool forceDar * @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 context or asyncUITask is nullptr. - * @since 20 + * @since 21 */ int32_t OH_ArkUI_PostAsyncUITask(ArkUI_ContextHandle context, void* asyncUITaskData, void (*asyncUITask)(void* asyncUITaskData), void (*onFinish)(void* asyncUITaskData)); @@ -10143,7 +10354,7 @@ int32_t OH_ArkUI_PostAsyncUITask(ArkUI_ContextHandle context, void* asyncUITaskD * @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 context or task is nullptr. - * @since 20 + * @since 21 */ int32_t OH_ArkUI_PostUITask(ArkUI_ContextHandle context, void* taskData, void (*task)(void* taskData)); @@ -10156,9 +10367,67 @@ int32_t OH_ArkUI_PostUITask(ArkUI_ContextHandle context, void* taskData, void (* * @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 context or task is nullptr. - * @since 20 + * @since 21 */ int32_t OH_ArkUI_PostUITaskAndWait(ArkUI_ContextHandle context, void* taskData, void (*task)(void* taskData)); + +/** + * @brief Register common event callback of target node. + * + * @param node The ArkUI-NodeHandle pointer. + * @param eventType Indicates the type of event to set. + * @param userData Indicates the pointer to the custom data. + * @param callback Indicates the event callback function. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function params is invalid. + * Returns {@link ARKUI_ERROR_CODE_NODE_UNSUPPORTED_EVENT_TYPE} Function parameter eventType is not supported. + * @since 21 + */ +int32_t OH_ArkUI_NativeModule_RegisterCommonEvent(ArkUI_NodeHandle node, ArkUI_NodeEventType eventType, + void* userData, void (*callback)(ArkUI_NodeEvent* event)); + +/** + * @brief Unregister common event callback of target node. + * + * @param node The ArkUI-NodeHandle pointer. + * @param eventType Indicates the type of event 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} Function params is invalid. + * Returns {@link ARKUI_ERROR_CODE_NODE_UNSUPPORTED_EVENT_TYPE} Function parameter eventType is not supported. + * @since 21 + */ +int32_t OH_ArkUI_NativeModule_UnregisterCommonEvent(ArkUI_NodeHandle node, ArkUI_NodeEventType eventType); + +/** + * @brief Register common visible area approximate change event callback of target node. + * + * @param node The ArkUI-NodeHandle pointer. + * @param ratios Threshold array representing the visible area of the component. + * @param size The size of the ratios. + * @param expectedUpdateInterval The expected calculation interval for developers. + * @param userData Indicates the pointer to the custom data. + * @param callback Indicates the event callback function. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function params is invalid. + * @since 21 + */ +int32_t OH_ArkUI_NativeModule_RegisterCommonVisibleAreaApproximateChangeEvent(ArkUI_NodeHandle node, float* ratios, + int32_t size, float expectedUpdateInterval, void* userData, void (*callback)(ArkUI_NodeEvent* event)); + +/** + * @brief Unregister common visible area approximate change event callback of target node. + * + * @param node The ArkUI-NodeHandle pointer. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function params is invalid. + * @since 21 + */ +int32_t OH_ArkUI_NativeModule_UnregisterCommonVisibleAreaApproximateChangeEvent(ArkUI_NodeHandle node); + #ifdef __cplusplus }; #endif diff --git a/arkui/ace_engine/native/native_render.h b/arkui/ace_engine/native/native_render.h index a0ab9902a8120b9a0d396064d5477bcbed095eeb..d6ea4b1c33270c8d453c39b2a6164e6ca41eff42 100644 --- a/arkui/ace_engine/native/native_render.h +++ b/arkui/ace_engine/native/native_render.h @@ -1490,14 +1490,12 @@ void OH_ArkUI_RenderNodeUtils_DisposeRectShapeOption(ArkUI_RectShapeOption* opti * @brief Set the edge value of RectShape option. * * @param option Pointer to the RectShape option. - * @param top The top value of the RectShape. - * @param right The right value of the RectShape. - * @param bottom The bottom value of the RectShape. - * @param left The left value of the RectShape. + * @param edgeValue The edge value of the RectShape. + * @param direction {@Link ArkUI_EdgeDirection} The direction of the edge. * @since 20 */ void OH_ArkUI_RenderNodeUtils_SetRectShapeOptionEdgeValue( - ArkUI_RectShapeOption* option, float top, float right, float bottom, float left); + ArkUI_RectShapeOption* option, float edgeValue, ArkUI_EdgeDirection direction); /** * @brief Create a NodeBorderStyle option. @@ -1670,14 +1668,12 @@ void OH_ArkUI_RenderNodeUtils_DisposeRoundRectShapeOption(ArkUI_RoundRectShapeOp * @brief Set the edge value of RoundRectShape option. * * @param option Pointer to the RoundRectShape option. - * @param top The top value of the RoundRectShape. - * @param right The right value of the RoundRectShape. - * @param bottom The bottom value of the RoundRectShape. - * @param left The left value of the RoundRectShape. + * @param edgeValue The edge value of the RoundRectShape. + * @param direction {@Link ArkUI_EdgeDirection} The direction of the edge. * @since 20 */ void OH_ArkUI_RenderNodeUtils_SetRoundRectShapeOptionEdgeValue( - ArkUI_RoundRectShapeOption* option, float top, float right, float bottom, float left); + ArkUI_RoundRectShapeOption* option, float edgeValue, ArkUI_EdgeDirection direction); /** * @brief Set the coordinate value of the target corner. diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 7cef398b2d6b7cbab8dec555464d44799d0898fa..e43a92fa2e6bb1503111cdb5091bfd59e2e200d6 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -256,6 +256,13 @@ typedef struct AbilityBase_Want AbilityBase_Want; */ typedef struct ArkUI_EmbeddedComponentOption ArkUI_EmbeddedComponentOption; +/** + * @brief Define the Edges describing the position of a component by distances to the container's four edges. + * + * @since 21 + */ +typedef struct ArkUI_PositionEdges ArkUI_PositionEdges; + /** * @brief Defines the event callback type. * @@ -405,6 +412,20 @@ typedef enum { ARKUI_TEXT_VERTICAL_ALIGNMENT_TOP, } ArkUI_TextVerticalAlignment; +/** + * @brief Enumerates text content align styles. + * + * @since 21 + */ +typedef enum { + /** Top aligned. */ + ARKUI_TEXT_CONTENT_ALIGN_TOP = 0, + /** Center aligned. */ + ARKUI_TEXT_CONTENT_ALIGN_CENTER = 1, + /** Bottom aligned. */ + ARKUI_TEXT_CONTENT_ALIGN_BOTTOM = 2, +} ArkUI_TextContentAlign; + /** * @brief Enumerates the types of the Enter key for a single-line text box. * @@ -1356,6 +1377,12 @@ typedef enum { ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM, /** Not resized, the image is aligned with the end edge at the bottom of the container. */ ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM_END, + /** + * Not resized, and is used in conjunction with NODE_IMAGE_IMAGE_MATRIX. + * + * @since 21 + */ + ARKUI_OBJECT_FIT_NONE_MATRIX, } ArkUI_ObjectFit; /** @@ -2295,6 +2322,11 @@ typedef enum { ARKUI_ERROR_CODE_NODE_EVENT_PARAM_INVALID = 106108, /** The component event does not support return values. */ ARKUI_ERROR_CODE_NODE_EVENT_NO_RETURN = 106109, + /** + * @error The event type is not supported by the node. + * @since 21 + */ + ARKUI_ERROR_CODE_NODE_UNSUPPORTED_EVENT_TYPE = 106110, /** The index value is invalid. */ ARKUI_ERROR_CODE_NODE_INDEX_INVALID = 106200, /** Failed to query route navigation information. */ @@ -2308,7 +2340,7 @@ typedef enum { ARKUI_ERROR_CODE_NODE_NOT_ON_MAIN_TREE = 106203, /** * @error The node is running on invalid thread. - * @since 20 + * @since 21 */ ARKUI_ERROR_CODE_NODE_ON_INVALID_THREAD = 106204, /** @@ -2410,6 +2442,11 @@ typedef enum { * @since 19 */ ARKUI_ERROR_CODE_DRAG_DROP_OPERATION_NOT_ALLOWED = 190004, + /** + * @error Parameter error. + * @since 21 + */ + ARKUI_ERROR_CODE_PARAM_ERROR = 100023, } ArkUI_ErrorCode; /** @@ -2807,6 +2844,41 @@ typedef enum { ARKUI_CORNER_DIRECTION_BOTTOM_RIGHT, } ArkUI_CornerDirection; +/** + * @brief Enumerates the LayoutPolicy. + * + * @since 21 + */ +typedef enum { + /** The component fills its parent, which means its size is as large as its parent */ + ARKUI_LAYOUTPOLICY_MATCHPARENT = 0, + /** + * The component fills its content, which means its size is as large as its children but it is constrained + * by its parent. + */ + ARKUI_LAYOUTPOLICY_WRAPCONTENT, + /** The component fills its content which means its size is as large as its children. */ + ARKUI_LAYOUTPOLICY_FIXATIDEALSIZE, +} ArkUI_LayoutPolicy; + +/** + * @brief Define the direction to expand the swipe action. + * + * @since 21 + */ +typedef enum { + /** + * When the List direction is vertical, it indicates the left in LTR mode and right in RTL mode. + * When the List direction is horizontal, it indicates the top. + */ + ARKUI_LIST_ITEM_SWIPE_ACTION_DIRECTION_START = 0, + /** + * When the List direction is vertical, it indicates the right in LTR mode and left in RTL mode. + * When the List direction is horizontal, it indicates the bottom. + */ + ARKUI_LIST_ITEM_SWIPE_ACTION_DIRECTION_END = 1, +} ArkUI_ListItemSwipeActionDirection; + /** * @brief Defines parameter used by the system font style callback event. * @@ -5383,6 +5455,140 @@ void OH_ArkUI_EmbeddedComponentOption_SetOnError( */ void OH_ArkUI_EmbeddedComponentOption_SetOnTerminated( ArkUI_EmbeddedComponentOption* option, void (*callback)(int32_t code, AbilityBase_Want* want)); + +/** + * @brief Create an edge object for position attribute. + * + * @return A pointer to the edge object. + * @since 21 + */ +ArkUI_PositionEdges* OH_ArkUI_PositionEdges_Create(); + +/** + * @brief Creates a deep copy of an edge object for position attribute. + * + * @param edges A pointer to an edge object. + * @return A pointer to the new edge object. + * @since 21 + */ +ArkUI_PositionEdges* OH_ArkUI_PositionEdges_Copy(const ArkUI_PositionEdges* edges); + +/** + * @brief Dispose an edge object for position attribute. + * + * @param edges Pointer to the edge object to be disposed. + * @since 21 + */ +void OH_ArkUI_PositionEdges_Dispose(ArkUI_PositionEdges* edges); + +/** + * @brief Sets the top edge of an edge object for position attribute. + * + * @param edges Pointer to the edge object. + * @param value The distance of top edge to the corresponding edge of parent container, in vp. + * @since 21 + */ +void OH_ArkUI_PositionEdges_SetTop(ArkUI_PositionEdges* edges, float value); + +/** + * @brief Gets the top edge of an edge object for position attribute. + * + * @param edges Pointer to the edge object. + * @param value The distance of top edge to the corresponding edge of parent container, in vp. + * @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 the parameter is invalid. + * @since 21 + */ +int32_t OH_ArkUI_PositionEdges_GetTop(ArkUI_PositionEdges* edges, float* value); + +/** + * @brief Sets the left edge of an edge object for position attribute. + * + * @param edges Pointer to the edge object. + * @param value The distance of left edge to the corresponding edge of parent container, in vp. + * @since 21 + */ +void OH_ArkUI_PositionEdges_SetLeft(ArkUI_PositionEdges* edges, float value); + +/** + * @brief Gets the left edge of an edge object for position attribute. + * + * @param edges Pointer to the edge object. + * @param value The distance of left edge to the corresponding edge of parent container, in vp. + * @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 the parameter is invalid. + * @since 21 + */ +int32_t OH_ArkUI_PositionEdges_GetLeft(ArkUI_PositionEdges* edges, float* value); + +/** + * @brief Sets the bottom edge of an edge object for position attribute. + * + * @param edges Pointer to the edge object. + * @param value The distance of bottom edge to the corresponding edge of parent container, in vp. + * @since 21 + */ +void OH_ArkUI_PositionEdges_SetBottom(ArkUI_PositionEdges* edges, float value); + +/** + * @brief Gets the bottom edge of an edge object for position attribute. + * + * @param edges Pointer to the edge object. + * @param value The distance of bottom edge to the corresponding edge of parent container, in vp. + * @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 the parameter is invalid. + * @since 21 + */ +int32_t OH_ArkUI_PositionEdges_GetBottom(ArkUI_PositionEdges* edges, float* value); + +/** + * @brief Sets the right edge of an edge object for position attribute. + * + * @param edges Pointer to the edge object. + * @param value The distance of right edge to the corresponding edge of parent container, in vp. + * @since 21 + */ +void OH_ArkUI_PositionEdges_SetRight(ArkUI_PositionEdges* edges, float value); + +/** + * @brief Gets the right edge of an edge object for position attribute. + * + * @param edges Pointer to the edge object. + * @param value The distance of right edge to the corresponding edge of parent container, in vp. + * @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 the parameter is invalid. + * @since 21 + */ +int32_t OH_ArkUI_PositionEdges_GetRight(ArkUI_PositionEdges* edges, float* value); + +/** + * @brief Expand the swipe action. + * + * @param node List Item node. + * @param direction expand direction of swipeAction. + * @return Error code. + * {@link ARKUI_ERROR_CODE_NO_ERROR} success. + * {@link ARKUI_ERROR_CODE_PARAM_ERROR} The component type of the node is incorrect. + * {@link ARKUI_ERROR_CODE_NODE_NOT_ON_MAIN_TREE} The node not mounted to component tree. + * @since 21 + */ +int32_t OH_ArkUI_ListItemSwipeAction_Expand(ArkUI_NodeHandle node, ArkUI_ListItemSwipeActionDirection direction); + +/** + * @brief Collapse the swipe action. + * + * @param node List Item node. + * @return Error code. + * {@link ARKUI_ERROR_CODE_NO_ERROR} success. + * {@link ARKUI_ERROR_CODE_PARAM_ERROR} The component type of the node is incorrect. + * {@link ARKUI_ERROR_CODE_NODE_NOT_ON_MAIN_TREE} The node not mounted to component tree. + * @since 21 + */ +int32_t OH_ArkUI_ListItemSwipeAction_Collapse(ArkUI_NodeHandle node); #ifdef __cplusplus }; #endif diff --git a/arkui/ace_engine/native/ui_input_event.h b/arkui/ace_engine/native/ui_input_event.h index a13728fe50da5166a9e103e72b83ea0ff757db7d..1e74a9ff75b05a103684fc1f90528b8fa5b5a80c 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -429,7 +429,7 @@ float OH_ArkUI_PointerEvent_GetXByIndex(const ArkUI_UIInputEvent* event, uint32_ * * @param event Indicates the pointer to the UI input event. * @return Returns the Y coordinate relative to the upper left corner of the current component; - * returns 0 if any parameter error occurs. + * returns 0.0f if any parameter error occurs. * @since 12 */ float OH_ArkUI_PointerEvent_GetY(const ArkUI_UIInputEvent* event); @@ -453,7 +453,7 @@ float OH_ArkUI_PointerEvent_GetYByIndex(const ArkUI_UIInputEvent* event, uint32_ * * @param event Indicates the pointer to the UI input event. * @return Returns the X coordinate relative to the upper left corner of the current application window; - * returns 0 if any parameter error occurs. + * returns 0.0f if any parameter error occurs. * @since 12 */ float OH_ArkUI_PointerEvent_GetWindowX(const ArkUI_UIInputEvent* event); @@ -477,7 +477,7 @@ float OH_ArkUI_PointerEvent_GetWindowXByIndex(const ArkUI_UIInputEvent* event, u * * @param event Indicates the pointer to the UI input event. * @return Returns the Y coordinate relative to the upper left corner of the current application window; - * returns 0 if any parameter error occurs. + * returns 0.0f if any parameter error occurs. * @since 12 */ float OH_ArkUI_PointerEvent_GetWindowY(const ArkUI_UIInputEvent* event); @@ -501,7 +501,7 @@ float OH_ArkUI_PointerEvent_GetWindowYByIndex(const ArkUI_UIInputEvent* event, u * * @param event Indicates the pointer to the UI input event. * @return Returns the X coordinate relative to the upper left corner of the current screen; - * returns 0 if any parameter error occurs. + * returns 0.0f if any parameter error occurs. * @since 12 */ float OH_ArkUI_PointerEvent_GetDisplayX(const ArkUI_UIInputEvent* event); @@ -525,7 +525,7 @@ float OH_ArkUI_PointerEvent_GetDisplayXByIndex(const ArkUI_UIInputEvent* event, * * @param event Indicates the pointer to the UI input event. * @return Returns the Y coordinate relative to the upper left corner of the current screen; - * returns 0 if any parameter error occurs. + * returns 0.0f if any parameter error occurs. * @since 12 */ float OH_ArkUI_PointerEvent_GetDisplayY(const ArkUI_UIInputEvent* event); @@ -666,8 +666,9 @@ float OH_ArkUI_PointerEvent_GetTouchAreaHeight(const ArkUI_UIInputEvent* event, * @brief Checks whether an event is triggered by the user's left or right hand. * This API is only effective on some touch devices. * - * @note The value is not available immediately upon press. Until the system infers the result, this API will return - * NONE. Do not rely on the return value for critical functionality. + * @note This value cannot be obtained in real time when pressed. Before the + * system completes result inference, it will return NONE by default. Therefore, + * please do not over-rely on the results returned by this interface. * * @param event Pointer to the current UI input event. * @param hand Whether the touch point is from the left or right hand. @@ -682,8 +683,9 @@ int32_t OH_ArkUI_PointerEvent_GetInteractionHand(const ArkUI_UIInputEvent *event * @brief Checks whether an event is triggered by the user's left or right hand. * This API is only effective on some touch devices. * - * @note The value is not available immediately upon press. Until the system infers the result, - * this API will return NONE. Do not rely on the return value for critical functionality. + * @note This value cannot be obtained in real time when pressed. Before the + * system completes result inference, it will return NONE by default. Therefore, + * please do not over-rely on the results returned by this interface. * * @param event Pointer to the current UI input event. * @param pointerIndex Index of the target touch point in the multi-touch data list. diff --git a/arkui/display_manager/oh_display_info.h b/arkui/display_manager/oh_display_info.h index 641a72486c76bce540d5d469a83682e51370d0fc..1aaf08f6dff69213500e32c0ab1f8b8ffc8c92fb 100644 --- a/arkui/display_manager/oh_display_info.h +++ b/arkui/display_manager/oh_display_info.h @@ -127,7 +127,11 @@ typedef enum { /** @error Operation system abnormal */ DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL = 1400003, - /** @error Operation illegal param */ + /** + * @error Operation illegal param. + * + * @since 20 + */ DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM = 1400004, } NativeDisplayManager_ErrorCode; diff --git a/arkui/window_manager/libwm.ndk.json b/arkui/window_manager/libwm.ndk.json index 4f4f24f91b1c3f66274ffa669fe66b6f1d51dd17..8bb60641f1b1bd2148dc0b5e678f7bdd587e703f 100644 --- a/arkui/window_manager/libwm.ndk.json +++ b/arkui/window_manager/libwm.ndk.json @@ -203,5 +203,21 @@ { "first_instroduced":"20", "name":"OH_PictureInPicture_UnregisterAllResizeListeners" + }, + { + "first_instroduced":"21", + "name":"OH_WindowManager_GetAllMainWindowInfo" + }, + { + "first_instroduced":"21", + "name":"OH_WindowManager_ReleaseAllMainWindowInfo" + }, + { + "first_instroduced":"21", + "name":"OH_WindowManager_GetMainWindowSnapshot" + }, + { + "first_instroduced":"21", + "name":"OH_WindowManager_ReleaseMainWindowSnapshot" } ] \ No newline at end of file diff --git a/arkui/window_manager/oh_window.h b/arkui/window_manager/oh_window.h index 347d1000275db13023663a48045c143e2daa068f..b99d6f4a7e00a7d987e1bf7f21428fbe583cec4e 100644 --- a/arkui/window_manager/oh_window.h +++ b/arkui/window_manager/oh_window.h @@ -289,6 +289,66 @@ void OH_WindowManager_ReleaseAllWindowLayoutInfoList(WindowManager_Rect* windowL int32_t OH_WindowManager_InjectTouchEvent( int32_t windowId, Input_TouchEvent* touchEvent, int32_t windowX, int32_t windowY); +/** + * @brief Get all main window info on device. + * + * @permission ohos.permission.CUSTOM_SCREEN_CAPTURE + * @param infoList Indicates the pointer to a main window info list. + * @param mainWindowInfoSize The size of main window info list. + * @return Returns the status code of the execution. + * {@link WS_OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_NO_PERMISSION} permission verification failed. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_SYSTEM_ABNORMAL} the window manager service works abnormally. + * @since 21 + */ +int32_t OH_WindowManager_GetAllMainWindowInfo( + WindowManager_MainWindowInfo** infoList, size_t* mainWindowInfoSize); + +/** + * @brief Release all main window info list. + * + * @param infoList Pointer to the main window info list. + * @since 21 + */ +void OH_WindowManager_ReleaseAllMainWindowInfo(WindowManager_MainWindowInfo* infoList); + +/** + * @brief Callback interface for getting main windows' snapshot. + * + * @param snapshotPixelMapList List of windows' snapshot + * @param snapshotListSize Size of snapshotPixelMapList + * @since 21 + */ +typedef void (*OH_WindowManager_WindowSnapshotCallback)(const OH_PixelmapNative* snapshotPixelMapList, + size_t snapshotListSize); + +/** + * @brief Get snapshot of the specified windows. + * + * @permission ohos.permission.CUSTOM_SCREEN_CAPTURE + * @param windowIdList Main window id list for getting snapshot. + * @param windowIdListSize Size of main window id list. + * @param config Configuration for getting snapshot. + * @param callback Snapshot callback object. + * @return Returns the status code of the execution. + * {@link WS_OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_NO_PERMISSION} permission verification failed. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_SYSTEM_ABNORMAL} the window manager service works abnormally. + * @since 21 + */ +int32_t OH_WindowManager_GetMainWindowSnapshot(int32_t* windowIdList, size_t windowIdListSize, + WindowManager_WindowSnapshotConfig config, OH_WindowManager_WindowSnapshotCallback callback); + +/** + * @brief Release main window snapshot list. + * + * @param snapshotPixelMapList Indicates the pointer of a windows' snapshot list. + * @since 21 + */ +void OH_WindowManager_ReleaseMainWindowSnapshot(const OH_PixelmapNative* snapshotPixelMapList); + #ifdef __cplusplus } #endif diff --git a/arkui/window_manager/oh_window_comm.h b/arkui/window_manager/oh_window_comm.h index 152c9a318270f77fde5a60ae796c8a5b502f744d..ad05a16950fb96cab1932b03e36e647d359f931a 100644 --- a/arkui/window_manager/oh_window_comm.h +++ b/arkui/window_manager/oh_window_comm.h @@ -229,6 +229,32 @@ typedef struct { WindowManager_Rect bottomRect; } WindowManager_AvoidArea; +/** + * @brief Main window info + * + * @since 21 + */ +typedef struct { + /** Display id of the window. */ + uint64_t displayId; + /** Window id. */ + int32_t windowId; + /** Showing state of the window. */ + bool showing; + /** Label of the window. */ + const char* label; +} WindowManager_MainWindowInfo; + +/** + * @brief Window snapshot config info + * + * @since 21 + */ +typedef struct { + /** Use cached windows' snapshot. */ + bool useCache; +} WindowManager_WindowSnapshotConfig; + #ifdef __cplusplus } #endif diff --git a/arkui/window_manager/oh_window_pip.h b/arkui/window_manager/oh_window_pip.h index dc16d176ead0caaee4b94d01c0dd8613b835d52f..6fd57bcaa6303e986066239d1406224b2def119c 100644 --- a/arkui/window_manager/oh_window_pip.h +++ b/arkui/window_manager/oh_window_pip.h @@ -358,7 +358,7 @@ int32_t OH_PictureInPicture_UpdatePipControlStatus(uint32_t controllerId, Pictur PictureInPicture_PipControlStatus status); /** - * @brief Set picture-in-picture controll enable status. + * @brief Set picture-in-picture control enable status. * * @param controllerId The picture-in-picture controller ID * @param controlType The picture-in-picture control type. diff --git a/build-tools/clean_ndk_ani.py b/build-tools/clean_ndk_ani.py new file mode 100755 index 0000000000000000000000000000000000000000..f28647ffbda489e351be6ad74889f9b08668d9a9 --- /dev/null +++ b/build-tools/clean_ndk_ani.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (c) 2025 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 os +import re +import argparse +import shutil +import json +import stat +from typing import List + +# ani header file list +_ANI_HEADER_LISTS = [ +] + +# Precompiled regular expression +_HEADER_PATTERN = re.compile( + r'^\s*#\s*include\s+["<](.*/)?({})[">]'.format( + '|'.join(map(re.escape, _ANI_HEADER_LISTS)) + ) +) + + +def process_header_file(file_path): + """processing single header file""" + modified = False + try: + with open(file_path, 'r+', encoding='utf-8') as f: + content = f.read() + # Use a regular expression to process all rows at once + new_content = [] + for line in content.splitlines(): + if not _HEADER_PATTERN.match(line): + new_content.append(line) + else: + modified = True + + if modified: + f.seek(0) + f.write('\n'.join(new_content)) + f.truncate() + except Exception as e: + print(f"process file {file_path} failed: {str(e)}") + return modified + + +def clean_ndk_ani_headers(ndk_header_path): + if not _ANI_HEADER_LISTS: + print("Warning: ani header file list") + return + + # all files to be processed + file_paths = [] + for root, _, files in os.walk(ndk_header_path): + for file in files: + if not file.endswith('.h'): + continue + + file_path = os.path.join(root, file) + if file in _ANI_HEADER_LISTS: + try: + os.remove(file_path) + print(f"Deleted ani header file: {file_path}") + except OSError as e: + print(f"Error deleting {file_path}: {str(e)}") + else: + file_paths.append(file_path) + + # Bulk processing file include + for file_path in file_paths: + process_header_file(file_path) + + +# Clear the ani header file in the systemCapability configuration json file +def clean_json_systemCapability_headers(capability_header_path): + try: + with open(capability_header_path, 'r') as f: + systemCapabilitys = json.load(f) + except Exception as e: + print(f"Error reading JSON file: {str(e)}") + return + + # Traverse all levels of items + for _systemCapability in systemCapabilitys: + # filtering ani header file + systemCapabilitys[_systemCapability] = [item for item in systemCapabilitys[_systemCapability] + if os.path.basename(item) not in _ANI_HEADER_LISTS] + + # Saving the modified JSON + try: + fd = os.open(capability_header_path, os.O_WRONLY | os.O_TRUNC | os.O_CREAT, + stat.S_IRUSR | stat.S_IWUSR) + with os.fdopen(fd, 'w') as f: + json.dump(systemCapabilitys, f, indent=2) + print("JSON file updated successfully") + except Exception as e: + print(f"Error saving JSON file: {str(e)}") + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--ndk-header-path', help='ndk header path', required=True) + parser.add_argument('--system-capability-header-config', required=True) + args = parser.parse_args() + + if not os.path.isdir(args.ndk_header_path): + print(f"Error:path {args.ndk_header_path} is not exist!") + return + + clean_ndk_ani_headers(args.ndk_header_path) + clean_json_systemCapability_headers(args.system_capability_header_config) + print("Ani Header file cleanup complete!") + + +if __name__ == '__main__': + main() diff --git a/build-tools/clean_ndk_ani.pydeps b/build-tools/clean_ndk_ani.pydeps new file mode 100644 index 0000000000000000000000000000000000000000..9ec5fde3fccfab67dd5391b753fb08513622e8a3 --- /dev/null +++ b/build-tools/clean_ndk_ani.pydeps @@ -0,0 +1,10 @@ +# Generated by running: +# build/print_python_deps.py --root build/ohos/ndk --output interface/sdk_c/build-tools/clean_ndk_ani.pydeps interface/sdk_c/build-tools/clean_ndk_ani.py +../../../build/gn_helpers.py +../../../build/scripts/__init__.py +../../../build/scripts/interface_mgr.py +../../../build/scripts/util/__init__.py +../../../build/scripts/util/build_utils.py +../../../build/scripts/util/md5_check.py +../../../build/scripts/util/pycache.py +clean_ndk_ani.py diff --git a/bundlemanager/bundle_framework/bundle/BUILD.gn b/bundlemanager/bundle_framework/bundle/BUILD.gn index 22dfebfab4a23b42806d2dfd915c7e2a5e78597c..5f7c039ef556c933eed9da29f3a3f223bc067765 100644 --- a/bundlemanager/bundle_framework/bundle/BUILD.gn +++ b/bundlemanager/bundle_framework/bundle/BUILD.gn @@ -18,7 +18,11 @@ config("bundle_ndk_config") { } ohos_ndk_headers("bundle_header") { dest_dir = "$ndk_headers_out_dir/bundle/" - sources = [ "./include/native_interface_bundle.h" ] + sources = [ + "./include/ability_resource_info.h", + "./include/bundle_manager_common.h", + "./include/native_interface_bundle.h", + ] } ohos_ndk_library("libbundle_ndk") { @@ -26,5 +30,9 @@ ohos_ndk_library("libbundle_ndk") { min_compact_version = "9" output_name = "bundle_ndk" system_capability = "SystemCapability.BundleManager.BundleFramework.Core" - system_capability_headers = [ "bundle/native_interface_bundle.h" ] + system_capability_headers = [ + "bundle/native_interface_bundle.h", + "bundle/bundle_manager_common.h", + "bundle/ability_resource_info.h", + ] } diff --git a/bundlemanager/bundle_framework/bundle/include/ability_resource_info.h b/bundlemanager/bundle_framework/bundle/include/ability_resource_info.h new file mode 100644 index 0000000000000000000000000000000000000000..e53815ca3fb561f59093009b9b6b0fc22b2ff8f5 --- /dev/null +++ b/bundlemanager/bundle_framework/bundle/include/ability_resource_info.h @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2025 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 Native_Bundle + * @{ + * + * @brief Describe the functions of AbilityResourceInfo. + * + * @since 21 + */ + +/** + * @file ability_resource_info.h + * + * @brief Defines the OH_NativeBundle_AbilityResourceInfo APIs. + * + * @library libbundle_ndk.z.so + * @kit AbilityKit + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 21 + */ + +#ifndef ABILITY_RESOURCE_INFO_H +#define ABILITY_RESOURCE_INFO_H + +#include +#include +#include "bundle_manager_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Indicates ability resource info. + * + * @since 21 + */ +struct OH_NativeBundle_AbilityResourceInfo; +typedef struct OH_NativeBundle_AbilityResourceInfo OH_NativeBundle_AbilityResourceInfo; + +/** +* @brief Get the bundle name of the abilityResourceInfo. + * + * @param abilityResourceInfo The ability resource info that has been obtained. + * @param bundleName The bundle name obtained from abilityResourceInfo. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetBundleName( + OH_NativeBundle_AbilityResourceInfo* abilityResourceInfo, char** bundleName); + +/** +* @brief Get the module name of the abilityResourceInfo. + * + * @param abilityResourceInfo The ability resource info that has been obtained. + * @param moduleName The module name obtained from abilityResourceInfo. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetModuleName( + OH_NativeBundle_AbilityResourceInfo* abilityResourceInfo, char** moduleName); + +/** +* @brief Get the ability name of the abilityResourceInfo. + * + * @param abilityResourceInfo The ability resource info that has been obtained. + * @param abilityName The ability name obtained from abilityResourceInfo. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetAbilityName( + OH_NativeBundle_AbilityResourceInfo* abilityResourceInfo, char** abilityName); + +/** +* @brief Get the icon of the abilityResourceInfo. + * + * @param abilityResourceInfo The ability resource info that has been obtained. + * @param icon The icon obtained from abilityResourceInfo. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetIcon( + OH_NativeBundle_AbilityResourceInfo* abilityResourceInfo, char** icon); + +/** +* @brief Get the label of the abilityResourceInfo. + * + * @param abilityResourceInfo The ability resource info that has been obtained. + * @param label The label obtained from abilityResourceInfo. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetLabel( + OH_NativeBundle_AbilityResourceInfo* abilityResourceInfo, char** label); + +/** +* @brief Get the appIndex of the abilityResourceInfo. + * + * @param abilityResourceInfo The ability resource info that has been obtained. + * @param appIndex The appIndex obtained from abilityResourceInfo. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetAppIndex( + OH_NativeBundle_AbilityResourceInfo* abilityResourceInfo, int* appIndex); + +/** +* @brief Check whether abilityResourceInfo is the default application. + * + * @param abilityResourceInfo The ability resource info that has been obtained. + * @param isDefault Check whether abilityResourceInfo is the default application. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_CheckDefaultApp( + OH_NativeBundle_AbilityResourceInfo* abilityResourceInfo, bool* isDefault); + +/** +* @brief Destroy the ability resource info. + * + * @param abilityResourceInfo The ability resource info to be deleted. + * @param count Indicates the ability resource array size. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_AbilityResourceInfo_Destroy( + OH_NativeBundle_AbilityResourceInfo* abilityResourceInfo, size_t count); + +/** +* @brief Get the size of ability resource info. + * + * @return The size of ability resource info. + * + * @since 21 + */ +int OH_NativeBundle_GetSize(); +#ifdef __cplusplus +} // extern "C" +#endif + +/** @} */ +#endif // ABILITY_RESOURCE_INFO_H diff --git a/bundlemanager/bundle_framework/bundle/include/bundle_manager_common.h b/bundlemanager/bundle_framework/bundle/include/bundle_manager_common.h new file mode 100644 index 0000000000000000000000000000000000000000..3098a2582d310a7ae34cfc1d0d19f3d6ba56427f --- /dev/null +++ b/bundlemanager/bundle_framework/bundle/include/bundle_manager_common.h @@ -0,0 +1,72 @@ +/* +* Copyright (C) 2025 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 Native_Bundle + * @{ + * + * @brief Describes the Native Bundle. + * + * @since 21 + * @version 1.0 + */ + +/** + * @file bundle_manager_common.h + * + * @brief Declare the common types for the native BundleManager. + * + * @library libbundle_ndk.z.so + * @kit AbilityKit + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 21 + */ + +#ifndef BUNDLE_MANAGER_COMMON_H +#define BUNDLE_MANAGER_COMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the error codes. + * + * @since 21 + */ +typedef enum { + /** + * @error No error. + * @since 21 + */ + BUNDLE_MANAGER_ERROR_CODE_NO_ERROR = 0, + /** + * @error permission denied. + * @since 21 + */ + BUNDLE_MANAGER_ERROR_CODE_PERMISSION_DENIED = 201, + /** + * @error param invalid. + * @since 21 + */ + BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID = 401, +} BundleManager_ErrorCode; + +#ifdef __cplusplus +} +#endif + +/** @} */ +#endif // BUNDLE_MANAGER_COMMON_H diff --git a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h index d1b0201e4fb1a91448fe122c711a3e788b603907..9b7867ba14346294d23d267b25cb0b684577e2d7 100644 --- a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h +++ b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h @@ -40,6 +40,9 @@ #include #include +#include "ability_resource_info.h" +#include "bundle_manager_common.h" + #ifdef __cplusplus extern "C" { #endif @@ -224,6 +227,20 @@ bool OH_NativeBundle_IsDebugMode(bool* isDebugMode); * @since 20 */ OH_NativeBundle_ModuleMetadata* OH_NativeBundle_GetModuleMetadata(size_t* size); + +/** + * @brief Obtain a list of ability that support opening files in a certain format. + * + * @permisssion {@code ohos.permission.GET_ABILITY_INFO}. + * @param fileType Indicates the file type. + * @param abilityResourceInfo Indicates the ability resource array. + * @param size Indicates the ability resource array size. + * @return Returns {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the call is successful. + * Returns {@link BUNDLE_MANAGER_ERROR_CODE_PERMISSION_DENIED} if the caller has no correct permission. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetAbilityResourceInfo(char* fileType, + OH_NativeBundle_AbilityResourceInfo** abilityResourceInfo, size_t* size); #ifdef __cplusplus }; #endif diff --git a/bundlemanager/bundle_framework/bundle/libbundle.ndk.json b/bundlemanager/bundle_framework/bundle/libbundle.ndk.json index 7c05eef7bb28cbe0e7617d161dceaa7d0966beb7..a21ec324459755f87cd9e8decc4dd09e83f0b47b 100644 --- a/bundlemanager/bundle_framework/bundle/libbundle.ndk.json +++ b/bundlemanager/bundle_framework/bundle/libbundle.ndk.json @@ -26,5 +26,45 @@ { "first_introduced": "20", "name": "OH_NativeBundle_GetModuleMetadata" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetAbilityResourceInfo" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetBundleName" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetModuleName" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetAbilityName" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetIcon" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetLabel" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetAppIndex" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_CheckDefaultApp" + }, + { + "first_introduced": "21", + "name": "OH_AbilityResourceInfo_Destroy" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetSize" } ] diff --git a/distributeddatamgr/pasteboard/include/oh_pasteboard.h b/distributeddatamgr/pasteboard/include/oh_pasteboard.h index 3218fff577ea728bcc29d5923b8a6d3c15d42c43..8776f22db014e074209b5ae8ccb2bc87685d525b 100644 --- a/distributeddatamgr/pasteboard/include/oh_pasteboard.h +++ b/distributeddatamgr/pasteboard/include/oh_pasteboard.h @@ -291,6 +291,7 @@ bool OH_Pasteboard_HasData(OH_Pasteboard* pasteboard); /** * @brief Obtains data from the Pasteboard. * + * @permission ohos.permission.READ_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. @@ -441,6 +442,16 @@ void OH_Pasteboard_ProgressCancel(Pasteboard_GetDataParams* params); */ OH_UdmfData* OH_Pasteboard_GetDataWithProgress(OH_Pasteboard* pasteboard, Pasteboard_GetDataParams* params, int* status); + +/** + * @brief Notifies the system pasteboard to synchronize all time-lapse paste data from application. + * + * @param pasteboard Pointer to the {@link OH_Pasteboard} instance. + * @param callback Indicates the pointer to the callback that is called after the synchronize is finished. + * @since 21 + */ +void OH_Pasteboard_SyncDelayedDataAsync(OH_Pasteboard* pasteboard, void (*callback)(int errorCode)); + #ifdef __cplusplus }; #endif diff --git a/distributeddatamgr/pasteboard/libpasteboard.ndk.json b/distributeddatamgr/pasteboard/libpasteboard.ndk.json index 6b21588f7a09e99974704c28f796615d4787f460..84ec7a82593f546d685e5ee44a6698feedca6ea1 100644 --- a/distributeddatamgr/pasteboard/libpasteboard.ndk.json +++ b/distributeddatamgr/pasteboard/libpasteboard.ndk.json @@ -98,6 +98,9 @@ { "first_introduced": "18", "name": "OH_Pasteboard_GetChangeCount" - + }, + { + "first_introduced": "21", + "name": "OH_Pasteboard_SyncDelayedDataAsync" } ] \ No newline at end of file diff --git a/distributeddatamgr/relational_store/include/data_asset.h b/distributeddatamgr/relational_store/include/data_asset.h index f791cbc9e815b1358fd4bb3b4054f1576b808521..85c4fbdf6ba1a0195c34f30f2a15c36c5465c1fc 100644 --- a/distributeddatamgr/relational_store/include/data_asset.h +++ b/distributeddatamgr/relational_store/include/data_asset.h @@ -326,7 +326,9 @@ Data_Asset *OH_Data_Asset_CreateOne(void); * * @param asset Represents a pointer to an {@link Data_Asset} instance. * @return Returns the status code of the execution. Successful execution returns RDB_OK, - * while failure returns a specific error code. Specific error codes can be referenced {@link OH_Rdb_ErrCode}. + * while failure returns a specific error code. + * {@link RDB_OK} - success. + * Specific error codes can be referenced {@link OH_Rdb_ErrCode}. * @see Data_Asset, OH_Rdb_ErrCode. * @since 11 */ @@ -349,7 +351,9 @@ Data_Asset **OH_Data_Asset_CreateMultiple(uint32_t count); * @param assets Represents a pointer to an {@link Data_Asset} instance. * @param count Represents the count of {@link Data_Asset} to destroy. * @return Returns the status code of the execution. Successful execution returns RDB_OK, - * while failure returns a specific error code. Specific error codes can be referenced {@link OH_Rdb_ErrCode}. + * while failure returns a specific error code. + * {@link RDB_OK} - success. + * Specific error codes can be referenced {@link OH_Rdb_ErrCode}. * @see Data_Asset, OH_Rdb_ErrCode. * @since 11 */ diff --git a/graphic/graphic_2d/native_drawing/drawing_error_code.h b/graphic/graphic_2d/native_drawing/drawing_error_code.h index 0c6e6e0c8769442fa067a5aa242eee703eabfc9e..239f948173bbc8e79ec0c11be2b43bbe056b8747 100644 --- a/graphic/graphic_2d/native_drawing/drawing_error_code.h +++ b/graphic/graphic_2d/native_drawing/drawing_error_code.h @@ -70,6 +70,11 @@ typedef enum { * @since 13 */ OH_DRAWING_ERROR_ALLOCATION_FAILED = 26200002, + /** + * @error The attribute id is not recognized or supported. + * @since 21 + */ + OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH = 26200003, } OH_Drawing_ErrorCode; /** diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 9bdf581f61da05374d9028e623b2e958a73126aa..633d974825bc2a08d652d30db03cb2e8235120d4 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -48,6 +48,7 @@ #include #endif #include "drawing_canvas.h" +#include "drawing_error_code.h" #include "drawing_color.h" #include "drawing_font.h" #include "drawing_text_declaration.h" @@ -582,6 +583,180 @@ typedef enum OH_Drawing_FontWidth { FONT_WIDTH_ULTRA_EXPANDED = 9, } OH_Drawing_FontWidth; +/** + * @brief Enumerates text style attribute. + * + * @since 21 + */ +typedef enum OH_Drawing_TextStyleAttributeId { + /** Line height maximum */ + TEXT_STYLE_ATTR_D_LINE_HEIGHT_MAXIMUM = 0, + /** Line height minimum */ + TEXT_STYLE_ATTR_D_LINE_HEIGHT_MINIMUM = 1, + /** Line height style */ + TEXT_STYLE_ATTR_I_LINE_HEIGHT_STYLE = 2, + /** Font width */ + TEXT_STYLE_ATTR_I_FONT_WIDTH = 3, +} OH_Drawing_TextStyleAttributeId; + +/** + * @brief Enumerates line height's scaling type. + * + * @since 21 + */ +typedef enum OH_Drawing_LineHeightStyle { + /** Use the font size as the scale factor for line height scaling */ + TEXT_LINE_HEIGHT_BY_FONT_SIZE = 0, + /** Use the text height after shaping as the scale factor for line height scaling */ + TEXT_LINE_HEIGHT_BY_FONT_HEIGHT = 1, +} OH_Drawing_LineHeightStyle; + +/** + * @brief Enumerates typography style attribute. + * + * @since 21 + */ +typedef enum OH_Drawing_TypographyStyleAttributeId { + /** Line height maximum */ + TYPOGRAPHY_STYLE_ATTR_D_LINE_HEIGHT_MAXIMUM = 0, + /** Line height minimum */ + TYPOGRAPHY_STYLE_ATTR_D_LINE_HEIGHT_MINIMUM = 1, + /** Line spacing */ + TYPOGRAPHY_STYLE_ATTR_D_LINE_SPACING = 2, + /** Line height style */ + TYPOGRAPHY_STYLE_ATTR_I_LINE_HEIGHT_STYLE = 3, + /** Font width */ + TYPOGRAPHY_STYLE_ATTR_I_FONT_WIDTH = 4, +} OH_Drawing_TypographyStyleAttributeId; + +/** + * @brief Sets double value to the text style attribute. + * + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param id Indicates the attribute id. + * @param value Indicates the value to set. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr. + * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported. + * Returns {@link OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE} if the value corresponding to the attribute id + * exceeds the allowable range. + * @since 21 + */ +OH_Drawing_ErrorCode OH_Drawing_SetTextStyleAttributeDouble(OH_Drawing_TextStyle* style, + OH_Drawing_TextStyleAttributeId id, double value); + +/** + * @brief Gets the double type property's value from the text style. + * + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param id Indicates the attribute id. + * @param value Indicates the return value of the interface. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr. + * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported. + * @since 21 + */ +OH_Drawing_ErrorCode OH_Drawing_GetTextStyleAttributeDouble(OH_Drawing_TextStyle* style, + OH_Drawing_TextStyleAttributeId id, double* value); + +/** + * @brief Sets int value to the text style attribute. + * + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param id Indicates the attribute id. + * @param value Indicates the value to set. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr. + * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported. + * Returns {@link OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE} if the value corresponding to the attribute id + * exceeds the allowable range. + * @since 21 + */ +OH_Drawing_ErrorCode OH_Drawing_SetTextStyleAttributeInt(OH_Drawing_TextStyle* style, + OH_Drawing_TextStyleAttributeId id, int value); + +/** + * @brief Gets the int type property's value from the text style. + * + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param id Indicates the attribute id. + * @param value Indicates the return value of the interface. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr. + * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported. + * @since 21 + */ +OH_Drawing_ErrorCode OH_Drawing_GetTextStyleAttributeInt(OH_Drawing_TextStyle* style, + OH_Drawing_TextStyleAttributeId id, int* value); + +/** + * @brief Sets double value to the typography style attribute. + * + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param id Indicates the attribute id. + * @param value Indicates the value to set. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr. + * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported. + * Returns {@link OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE} if the value corresponding to the attribute id + * exceeds the allowable range. + * @since 21 + */ +OH_Drawing_ErrorCode OH_Drawing_SetTypographyStyleAttributeDouble(OH_Drawing_TypographyStyle* style, + OH_Drawing_TypographyStyleAttributeId id, double value); + +/** + * @brief Gets the double type property's value from the typography style. + * + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param id Indicates the attribute id. + * @param value Indicates the return value of the interface. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr. + * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported. + * @since 21 + */ +OH_Drawing_ErrorCode OH_Drawing_GetTypographyStyleAttributeDouble(OH_Drawing_TypographyStyle* style, + OH_Drawing_TypographyStyleAttributeId id, double* value); + +/** + * @brief Sets int value to the typography style attribute. + * + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param id Indicates the attribute id. + * @param value Indicates the value to set. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr. + * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported. + * Returns {@link OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE} if the value corresponding to the attribute id + * exceeds the allowable range. + * @since 21 + */ +OH_Drawing_ErrorCode OH_Drawing_SetTypographyStyleAttributeInt(OH_Drawing_TypographyStyle* style, + OH_Drawing_TypographyStyleAttributeId id, int value); + +/** + * @brief Gets the int type property's value from the typography style. + * + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param id Indicates the attribute id. + * @param value Indicates the return value of the interface. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr. + * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported. + * @since 21 + */ +OH_Drawing_ErrorCode OH_Drawing_GetTypographyStyleAttributeInt(OH_Drawing_TypographyStyle* style, + OH_Drawing_TypographyStyleAttributeId id, int* value); + /** * @brief Type of badge. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 7472ebb07985bc1347f7f672324792cae5f576ec..dd7a437602384c555040754aab51efeed2b8a736 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -2037,5 +2037,37 @@ { "first_introduced": "20", "name": "OH_Drawing_FontFeaturesDestroy" + }, + { + "first_introduced": "21", + "name": "OH_Drawing_SetTextStyleAttributeDouble" + }, + { + "first_introduced": "21", + "name": "OH_Drawing_GetTextStyleAttributeDouble" + }, + { + "first_introduced": "21", + "name": "OH_Drawing_SetTextStyleAttributeInt" + }, + { + "first_introduced": "21", + "name": "OH_Drawing_GetTextStyleAttributeInt" + }, + { + "first_introduced": "21", + "name": "OH_Drawing_SetTypographyStyleAttributeDouble" + }, + { + "first_introduced": "21", + "name": "OH_Drawing_GetTypographyStyleAttributeDouble" + }, + { + "first_introduced": "21", + "name": "OH_Drawing_SetTypographyStyleAttributeInt" + }, + { + "first_introduced": "21", + "name": "OH_Drawing_GetTypographyStyleAttributeInt" } ] \ No newline at end of file diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug.h b/hiviewdfx/hidebug/include/hidebug/hidebug.h index 287cf4433ecb57135baac30af4337b5e5e16ab09..242377c99bee37f2a6ca60dfde3942142c03ac14 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug.h @@ -246,6 +246,21 @@ HiDebug_Backtrace_Object OH_HiDebug_CreateBacktraceObject(void); */ void OH_HiDebug_DestroyBacktraceObject(HiDebug_Backtrace_Object object); +/** + * @brief Obtain the graphics memory summary of application. + * + * @param interval If the cache of graphics memory is longer than interval (unit: second), the latest + * graphics memory data will be obtained. The interval value range is 2 seconds to + * 3600 seconds, If interval is an invalid value, the default value is 300 seconds. + * @param summary Indicates value of graphics memory summary, 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 21 + */ +HiDebug_ErrorCode OH_HiDebug_GetGraphicsMemorySummary(uint32_t interval, HiDebug_GraphicsMemorySummary *summary); + #ifdef __cplusplus } #endif // __cplusplus diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h index 9ff70423aea0c8e2d928491eb5240f253dd0f1bb..ce767a08e1416ccb1a5b40bca21d2a227028556c 100644 --- a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h +++ b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h @@ -313,6 +313,23 @@ typedef struct HiDebug_StackFrame { */ typedef struct HiDebug_Backtrace_Object__* HiDebug_Backtrace_Object; +/** + * @brief Defines the graphics memory summary structure type. + * + * @since 21 + */ +typedef struct HiDebug_GraphicsMemorySummary { + /** + * GL memory + */ + uint32_t gl; + + /** + * graph memory + */ + uint32_t graph; +} HiDebug_GraphicsMemorySummary; + #ifdef __cplusplus } #endif // __cplusplus diff --git a/hiviewdfx/hidebug/libhidebug.ndk.json b/hiviewdfx/hidebug/libhidebug.ndk.json index ec903bef43d1816bcbdb4de6e13b97b4f3172e82..ac8921126918a48846216aac0ac941a056632422 100644 --- a/hiviewdfx/hidebug/libhidebug.ndk.json +++ b/hiviewdfx/hidebug/libhidebug.ndk.json @@ -43,6 +43,10 @@ "first_introduced": "14", "name": "OH_HiDebug_GetGraphicsMemory" }, + { + "first_introduced": "21", + "name": "OH_HiDebug_GetGraphicsMemorySummary" + }, { "first_introduced": "20", "name": "OH_HiDebug_SetMallocDispatchTable" diff --git a/hiviewdfx/hilog/include/hilog/log.h b/hiviewdfx/hilog/include/hilog/log.h index 1c4cda70470867aa3a89f12d025251f6c9742567..0aa747734a09aae4cdb54d2607e8674d49aff9ad 100644 --- a/hiviewdfx/hilog/include/hilog/log.h +++ b/hiviewdfx/hilog/include/hilog/log.h @@ -133,6 +133,30 @@ typedef enum { LOG_FATAL = 7, } LogLevel; +/** + * @brief Enumerates preference strategy to be used in {@link OH_LOG_SetLogLevel}. + * + * You are advised to select preference strategy based on their respective usage scenarios. + * + * @since 21 + */ +typedef enum { + /** Used to unset SetLogLevel, then none is set + */ + UNSET_LOGLEVEL = 0, + /** + * The actual lowest log level is determined by + * the maximum level between the new level and the system-controlled level. + * This is equivalent to calling OH_LOG_SetMinLogLevel. + */ + PREFER_CLOSE_LOG = 1, + /** + * The actual lowest log level is determined by + * the minimum level between the new level and the system-controlled level. + */ + PREFER_OPEN_LOG = 2, +} PreferStrategy; + /** * @brief Outputs logs. * @@ -351,6 +375,15 @@ void OH_LOG_SetCallback(LogCallback callback); */ void OH_LOG_SetMinLogLevel(LogLevel level); +/** + * @brief Sets the lowest log level of the current application process. Different preference strategy can be set. + * + * @param level log level. + * @param prefer preference strategy. See {@link PreferStrategy}. + * @since 21 + */ +void OH_LOG_SetLogLevel(LogLevel level, PreferStrategy prefer); + #ifdef __cplusplus } #endif diff --git a/hiviewdfx/hilog/libhilog.ndk.json b/hiviewdfx/hilog/libhilog.ndk.json index 0d14010e04c1ea7dffaef8c2a1e89a2dc7a6e037..2f06e93a984744041fa91f00fe9b0f2ec28afb60 100644 --- a/hiviewdfx/hilog/libhilog.ndk.json +++ b/hiviewdfx/hilog/libhilog.ndk.json @@ -19,5 +19,9 @@ }, { "name": "OH_LOG_SetMinLogLevel" + }, + { + "first_instroduced":"21", + "name": "OH_LOG_SetLogLevel" } ] diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 858a405ccc3ce5403e73550e770a5889ef7e7db3..327f7573d81a14ed3e264534400c4d95aeb580c9 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -348,35 +348,35 @@ "name":"OH_AudioSessionManager_UnregisterSessionDeactivatedCallback" }, { - "first_introduced": "12", + "first_introduced": "20", "name":"OH_AudioSessionManager_SetScene" }, { - "first_introduced": "12", + "first_introduced": "20", "name":"OH_AudioSessionManager_RegisterStateChangeCallback" }, { - "first_introduced": "12", + "first_introduced": "20", "name":"OH_AudioSessionManager_UnregisterStateChangeCallback" }, { - "first_introduced": "12", + "first_introduced": "20", "name":"OH_AudioSessionManager_SetDefaultOutputDevice" }, { - "first_introduced": "12", + "first_introduced": "20", "name":"OH_AudioSessionManager_GetDefaultOutputDevice" }, { - "first_introduced": "12", + "first_introduced": "20", "name":"OH_AudioSessionManager_ReleaseDevices" }, { - "first_introduced": "12", + "first_introduced": "20", "name":"OH_AudioSessionManager_RegisterCurrentOutputDeviceChangeCallback" }, { - "first_introduced": "12", + "first_introduced": "20", "name":"OH_AudioSessionManager_UnregisterCurrentOutputDeviceChangeCallback" }, { diff --git a/multimedia/av_codec/native_avcapability.h b/multimedia/av_codec/native_avcapability.h index 1d0af06b2b47a70e57f70e5f8440b67e56dd7d56..3c8649510a60c693bee868cff1098b08c40814e9 100644 --- a/multimedia/av_codec/native_avcapability.h +++ b/multimedia/av_codec/native_avcapability.h @@ -84,7 +84,7 @@ typedef enum OH_AVCapabilityFeature { VIDEO_ENCODER_TEMPORAL_SCALABILITY = 0, /** Feature for codec supports long-term reference. It is only used in video encoder. */ VIDEO_ENCODER_LONG_TERM_REFERENCE = 1, - /** Feature for codec supports low latency. It is used in video encoder and video decoder. */ + /** Feature for codec supports low latency. It is only used in video decoder. */ VIDEO_LOW_LATENCY = 2, /** Feature for codec supports B-frame encoding. It is only used in video encoder. * @since 20 diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 7745ac2101f9066330942d3bd141a608a2ec70e2..0042b76b4a2da27c3f8f01b44f2254bfe09f2a95 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -944,8 +944,8 @@ extern const char *OH_MD_KEY_VIDEO_PIC_WIDTH; extern const char *OH_MD_KEY_VIDEO_PIC_HEIGHT; /** * @brief Key to enable the low latency mode, value type is int32_t (0 or 1):1 is enabled, 0 otherwise. - * If enabled, the video encoder or video decoder doesn't hold input and output data more than required by - * the codec standards. This is an optional key that applies only to video encoder or video decoder. + * If enabled, the video decoder doesn't hold input and output data more than required by + * the codec standards. This is an optional key that applies only to video decoder. * It is used in configure. * * @syscap SystemCapability.Multimedia.Media.CodecBase diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index c158c5ebe6bfb3f58347fe7147d8713ad33b2e3b..5d2967e91f4a15c71ac9e626a6da14e0df900b26 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -1265,6 +1265,24 @@ typedef struct Camera_ControlCenterStatusInfo { bool isActive; } Camera_ControlCenterStatusInfo; +/** + * @brief Enum for photo quality prioritization. + * + * @since 21 + * @version 1.0 + */ +typedef enum Camera_PhotoQualityPrioritization { + /** + * High quality photos are the top preference, even at the expense of shot-to-shot time. + */ + CAMERA_PHOTO_QUALITY_PRIORITIZATION_HIGH_QUALITY = 0, + + /** + * Prefering speed over quality, even at the expense of quality. + */ + CAMERA_PHOTO_QUALITY_PRIORITIZATION_SPEED = 1, +} Camera_PhotoQualityPrioritization; + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index ff95d61ee10ccdf7ce6e97dad268cb9889d902b4..cd755635d3232f7df5c49e9ce3245adcf4089080 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -23,6 +23,18 @@ "first_introduced": "11", "name": "OH_CameraInput_Release" }, + { + "first_introduced": "21", + "name": "OH_CameraInput_IsPhysicalCameraOrientationVariable" + }, + { + "first_introduced": "21", + "name": "OH_CameraInput_GetPhysicalCameraOrientation" + }, + { + "first_introduced": "21", + "name": "OH_CameraInput_UsePhysicalCameraOrientation" + }, { "first_introduced": "11", "name": "OH_CameraManager_RegisterCallback" @@ -734,5 +746,13 @@ { "first_introduced": "20", "name": "OH_CaptureSession_UnregisterMacroStatusChangeCallback" + }, + { + "first_introduced": "21", + "name": "OH_PhotoOutput_IsPhotoQualityPrioritizationSupported" + }, + { + "first_introduced": "21", + "name": "OH_PhotoOutput_SetPhotoQualityPrioritization" } ] diff --git a/multimedia/camera_framework/camera_input.h b/multimedia/camera_framework/camera_input.h index a91452d9d46cdef6d27a3e7e68095be23b48bb5e..72a974c9a69da737a5992085e43e91839e5849a5 100644 --- a/multimedia/camera_framework/camera_input.h +++ b/multimedia/camera_framework/camera_input.h @@ -171,6 +171,41 @@ Camera_ErrorCode OH_CameraInput_Close(Camera_Input* cameraInput); */ Camera_ErrorCode OH_CameraInput_Release(Camera_Input* cameraInput); +/** + * @brief Query whether physical camera orientation is variable under different fold status. + * + * @param {CameraInput} cameraInput the {@link Camera_Input} instance. + * @param {bool} isVariable the result of whether physical camera orientation is variable. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 21 + */ +Camera_ErrorCode OH_CameraInput_IsPhysicalCameraOrientationVariable(Camera_Input* cameraInput, bool* isVariable); + +/** + * @brief Get physical camera orientation under current fold status. + * + * @param cameraInput the {@link Camera_Input} instance. + * @param orientation the physical camera orientation of current fold status. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 21 + */ +Camera_ErrorCode OH_CameraInput_GetPhysicalCameraOrientation(Camera_Input* cameraInput, uint32_t* orientation); + +/** + * @brief Choose whether to use the physical camera orientation. + * + * @param cameraInput the {@link Camera_Input} instance. + * @param isUsed the flag of whether to use physical camera orientation. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 21 + */ +Camera_ErrorCode OH_CameraInput_UsePhysicalCameraOrientation(Camera_Input* cameraInput, bool isUsed); + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/photo_output.h b/multimedia/camera_framework/photo_output.h index 27e502b695a667c5e6ad112c8035bb6081bf4919..90b5161d62443ca8606a3a3fd1c97d8c0d160cf8 100644 --- a/multimedia/camera_framework/photo_output.h +++ b/multimedia/camera_framework/photo_output.h @@ -499,6 +499,35 @@ Camera_ErrorCode OH_PhotoOutput_IsMovingPhotoSupported(Camera_PhotoOutput* photo */ Camera_ErrorCode OH_PhotoOutput_EnableMovingPhoto(Camera_PhotoOutput* photoOutput, bool enabled); +/** + * @brief Check whether to support photo quality prioritization. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance which used to check whether photo quality prioritization supported. + * @param qualityPrioritization the {@link Camera_PhotoQualityPrioritization} instance indicating quality preference. + * @param isSupported the result of whether quality prioritization is supported. + * @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 21 + */ + +Camera_ErrorCode OH_PhotoOutput_IsPhotoQualityPrioritizationSupported(Camera_PhotoOutput* photoOutput, + Camera_PhotoQualityPrioritization qualityPrioritization, bool* isSupported); + +/** + * @brief Set photo quality prioritization. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance which used to configure photo quality prioritization. + * @param qualityPrioritization the {@link Camera_PhotoQualityPrioritization} instance indicating the choice of quality or speed. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 21 + */ +Camera_ErrorCode OH_PhotoOutput_SetPhotoQualityPrioritization(Camera_PhotoOutput* photoOutput, + Camera_PhotoQualityPrioritization qualityPrioritization); + #ifdef __cplusplus } #endif diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h index 1261bdd3b10c18efbed98887ede2416eefb081f2..d206b6d46ed601f526a80ed178c9e76b0be7fcca 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -47,6 +47,7 @@ #include "avplayer_base.h" #include "native_window/external_window.h" #include "ohaudio/native_audiostream_base.h" +#include "native_avcodec_base.h" #ifdef __cplusplus extern "C" { @@ -621,6 +622,41 @@ OH_AVErrCode OH_AVPlayer_SetOnErrorCallback(OH_AVPlayer *player, OH_AVPlayerOnEr */ OH_AVErrCode OH_AVPlayer_SetVolumeMode(OH_AVPlayer *player, OH_AudioStream_VolumeMode volumeMode); +/** + * @brief Sets the loudness gain of current media. The default gain is 0.0 dB. + * This API can be called only when the AVPlayer is in the prepared, playing, paused completed or stopped state. + * The default loudness gain is 0.0dB. The stream usage of the player must be + * {@link OH_AudioStream_Usage#AUDIOSTREAM_USAGE_MUSIC}, {@link OH_AudioStream_Usage#AUDIOSTREAM_USAGE_MOVIE} + * or {@link OH_AudioStream_Usage#AUDIOSTREAM_USAGE_AUDIOBOOK}. + * The latency mode of the audio renderer must be {@link OH_AudioStream_LatencyMode#AUDIOSTREAM_LATENCY_MODE_NORMAL}. + * If AudioRenderer is played through the high-resolution pipe, this operation is not supported. + * + * @param player Pointer to an OH_AVPlayer instance. + * @param loudnessGain Loudness gain to set which changes from -90.0 to 24.0, expressing in dB. + * @return Function result code: + * {@link AV_ERR_OK} If the execution is successful. + * {@link AV_ERR_INVALID_VAL}:The value of player is a null pointer or + * the value of loudnessGain is invalid. + * {@link AV_ERR_INVALID_STATE}: The function is called in an incorrect state. or the stream usage of + * audioRendererInfo is not one of {@link StreamUsage#STREAM_USAGE_MUSIC}, + * {@link StreamUsage#STREAM_USAGE_MOVIE} or {@link StreamUsage#STREAM_USAGE_AUDIOBOOK}. + * {@link AV_ERR_SERVICE_DIED}: System errors such as media service breakdown. + * @since 21 + */ +OH_AVErrCode OH_AVPlayer_SetLoudnessGain(OH_AVPlayer *player, float loudnessGain); + +/** + * @brief Set the media source of the player. The data of this media source is provided by the application. + * @param {OH_AVPlayer*} player Pointer to an OH_AVPlayer instance + * @param {OH_AVDataSourceExt*} datasrc Pointer to an OH_AVDataSourceExt instance + * @param {void*} userData The handle passed in by the user is used to pass in the callback + * @return Function result code. + * {@link AV_ERR_OK} if the execution is successful. + * {@link AV_ERR_INVALID_VAL} if input player is nullptr or datasrc is nullptr. + * @since 21 + */ +OH_AVErrCode OH_AVPlayer_SetDataSource(OH_AVPlayer *player, OH_AVDataSourceExt* datasrc, void* userData); + #ifdef __cplusplus } #endif diff --git a/multimedia/player_framework/avplayer/libavplayer.ndk.json b/multimedia/player_framework/avplayer/libavplayer.ndk.json index 7f6d8b5bb7e8c1661a0550e673f96fb15a090a46..2b372fe8fa02338d7c592711421201db13b19a9c 100644 --- a/multimedia/player_framework/avplayer/libavplayer.ndk.json +++ b/multimedia/player_framework/avplayer/libavplayer.ndk.json @@ -146,5 +146,13 @@ { "first_introduced": "20", "name": "OH_AVPlayer_SetPlaybackRate" + }, + { + "first_introduced": "21", + "name": "OH_AVPlayer_SetLoudnessGain" + }, + { + "first_introduced": "21", + "name": "OH_AVPlayer_SetDataSource" } ] \ No newline at end of file diff --git a/multimedia/player_framework/lowpower_audio_sink.h b/multimedia/player_framework/lowpower_audio_sink.h index 07f24a2999867ed323462567a676035cdcf3d874..3ed0476042c8e2b5014e2eedf29d010e11373abc 100644 --- a/multimedia/player_framework/lowpower_audio_sink.h +++ b/multimedia/player_framework/lowpower_audio_sink.h @@ -268,7 +268,7 @@ OH_AVErrCode OH_LowPowerAudioSink_ReturnSamples(OH_LowPowerAudioSink* sink, OH_A * otherwise, returns a specific error code as defined in {@link OH_AVErrCode} * {@link AV_ERR_INVALID_VAL} the sink is nullptr or loudnessGain is out of valid range. * {@link AV_ERR_SERVICE_DIED} media service is died. - * @since 20 + * @since 21 */ OH_AVErrCode OH_LowPowerAudioSink_SetLoudnessGain(OH_LowPowerAudioSink* sink, float loudnessGain); diff --git a/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json b/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json index 7e53713e491574d739dd5d83c218d7ebb6cf50de..8a200fc18de328596d4d55d6b9770a023491de05 100644 --- a/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json +++ b/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json @@ -9,6 +9,10 @@ }, { "first_introduced": "20", + "name": "OH_LowPowerAVSink_GetCapability" + }, + { + "first_introduced": "21", "name": "OH_LowPowerAudioSink_CreateByMime" }, { @@ -68,7 +72,7 @@ "name": "OH_LowPowerAudioSink_ReturnSamples" }, { - "first_introduced": "20", + "first_introduced": "21", "name": "OH_LowPowerAudioSink_SetLoudnessGain" }, { @@ -185,6 +189,10 @@ }, { "first_introduced": "20", + "name": "OH_LowPowerVideoSink_GetLatestPts" + }, + { + "first_introduced": "21", "name": "OH_LowPowerVideoSink_RegisterCallback" }, { diff --git a/multimedia/player_framework/lowpower_avsink_base.h b/multimedia/player_framework/lowpower_avsink_base.h index fbb65514be1bc0084a98b97e3e490048d9582549..5b8e4e1ad23d71cfe9765d52f95f9f8fc56ccecd 100644 --- a/multimedia/player_framework/lowpower_avsink_base.h +++ b/multimedia/player_framework/lowpower_avsink_base.h @@ -53,6 +53,13 @@ extern "C" { */ typedef struct OH_AVSamplesBuffer OH_AVSamplesBuffer; +/** + * @brief Forward declaration of OH_LowPowerAVSink_Capability. + * + * @since 20 + */ +typedef struct OH_LowPowerAVSink_Capability OH_LowPowerAVSink_Capability; + /** * @brief Append one OH_AVBuffer data to framePacketBuffer instance. * @@ -77,9 +84,22 @@ OH_AVErrCode OH_AVSamplesBuffer_AppendOneBuffer(OH_AVSamplesBuffer *samplesBuffe */ int32_t OH_AVSamplesBuffer_GetRemainedCapacity(OH_AVSamplesBuffer *samplesBuffer); +/** + * @brief Query the supported capabilities of a lowpower audio/video sink. + * + * This function queries and returns the capability set supported by the current + * lowpower audio/video sink, including but not limited to supported media formats, etc. + * + * @return {OH_LowPowerAVSink_Capability*} + * - A pointer to the capability structure if the sink supports capability queries and the query is successful. + * - nullptr if the sink does not support capability queries or the query fails. + * + * @since 21 + */ +OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability(); #ifdef __cplusplus } #endif #endif // NATIVE_LOWPOWER_AVSINK_BASE_H -/** @} */ \ No newline at end of file +/** @} */ diff --git a/multimedia/player_framework/lowpower_video_sink.h b/multimedia/player_framework/lowpower_video_sink.h index 52c77f14c4a3e9056c69c96720b405f143ecd6fc..3f91faa145973b9e0684db6173170d93121f5a2f 100644 --- a/multimedia/player_framework/lowpower_video_sink.h +++ b/multimedia/player_framework/lowpower_video_sink.h @@ -341,6 +341,20 @@ OH_AVErrCode OH_LowPowerVideoSink_ReturnSamples(OH_LowPowerVideoSink* sink, OH_A */ OH_AVErrCode OH_LowPowerVideoSink_RegisterCallback(OH_LowPowerVideoSink* sink, OH_LowPowerVideoSinkCallback* callback); +/** + * @brief Get the latest presentation timestamp (PTS) from lowpower video sink. + * + * @param {OH_LowPowerVideoSink*} sink Pointer to an OH_LowPowerVideoSink instance. + * @param {int64_t*} pts Pointer to store the latest PTS value (in microseconds). + * @return Returns AV_ERR_OK if the timestamp is obtained successfully; + * otherwise, returns a specific error code as defined in {@link OH_AVErrCode}: + * {@link AV_ERR_INVALID_VAL} the sink is nullptr, or sink is invalid. + * {@link AV_ERR_SERVICE_DIED} media service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT} operation not permitted. + * @since 21 + */ +OH_AVErrCode OH_LowPowerVideoSink_GetLatestPts(OH_LowPowerVideoSink *sink, int64_t *pts); + /** * @brief Creates a lowpower video sink callback instance. * diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 7ff7bb1511574ab7bb2c8660dddbef2d7de3161a..53204cd86638c2b2ba410dfadf53476d0956f8d2 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -640,6 +640,75 @@ void OH_Input_SetKeyEventDisplayId(struct Input_KeyEvent* keyEvent, int32_t disp */ int32_t OH_Input_GetKeyEventDisplayId(const struct Input_KeyEvent* keyEvent); +/** + * @brief Get the eventId of the keyEvent. + * + * @param keyEvent - Key event object. + * @param eventId - Get the keyEvent eventId. + * @return OH_Input_GetKeyEventId function result code. + * {@link INPUT_SUCCESS} Get the eventId of the keyEvent success.\n + * {@link INPUT_PARAMETER_ERROR} Parameter check failed.\n + * @since 21 + */ + +Input_Result OH_Input_GetKeyEventId(const struct Input_KeyEvent* keyEvent, int32_t* eventId); + +/** + * @brief Add a keyEvent interception hook function. Before using this interface, + * the user needs to authorize it in the settings. + * + * @permission ohos.permission.HOOK_KEY_EVENT + * @param callback - Hook function, keyEvent will be sent to the hook function for priority processing. + * @return OH_Input_AddKeyEventHook function result code. + * {@link INPUT_SUCCESS} Added hook function successfully.\n + * {@link INPUT_PARAMETER_ERROR} Failed to add the hook function. Reason: Parameter check failed.\n + * {@link INPUT_DEVICE_NOT_SUPPORTED} Capability not supported.\n + * {@link INPUT_PERMISSION_DENIED} Failed to add the hook function. Reason: Permission check failed.\n + * {@link INPUT_REPEAT_INTERCEPTOR} Failed to add the hook function.\n + * Reason: Repeatedly set the hook function. A process can only have one key hook function.\n + * {@link INPUT_SERVICE_EXCEPTION} Failed to add the hook function.\n + * Reason: Input service exception, please try again.\n + * @since 21 + */ +Input_Result OH_Input_AddKeyEventHook(Input_KeyEventCallback callback); + +/** + * @brief Remove keyEvent interception hook function. + * + * @param callback - Hook function, Same as the parameters when calling OH_Input_AddKeyEventHook. + * @return OH_Input_RemoveKeyEventHook function result code. + * {@link INPUT_SUCCESS} Hook function removed successfully.\n + * Even if the hook function has not been added before, it will return success when removed.\n + * {@link INPUT_PARAMETER_ERROR} Failed to remove the hook function. Reason: Parameter check failed.\n + * {@link INPUT_SERVICE_EXCEPTION} Failed to remove the hook function.\n + * Reason: Input service exception, please try again.\n + * @since 21 + */ +Input_Result OH_Input_RemoveKeyEventHook(Input_KeyEventCallback callback); + +/** + * @brief Redispatches keyEvent. + * Only keyEvent intercepted by hook functions can be redispatched, + * and the event order must be maintained during redispatching. + * The hook function intercepts the input event and then redistributes it for 3 seconds. + * If this time is exceeded, calling this function will return INPUT_PARAMETER_ERROR. + * Re-dispatching requires event pairing, usually starting with one or more KEY_ACTION_DOWN and + * ending with KEY_ACTION_UP or KEY_ACTION_CANCEL. + * Only KEY_ACTION_UP or KEY_ACTION_CANCEL is redispatched, the function call succeeds, + * but no actual dispatch is made. + * If an event is dispatched that is not intercepted by the hook function, + * the function call succeeds, but no actual dispatch action is taken. + * + * @param eventId - keyEvent eventId. + * @return OH_Input_DispatchToNextHandler function result code. + * {@link INPUT_SUCCESS} Redistribution successful.\n + * {@link INPUT_PARAMETER_ERROR} Redistribution failed. Reason: KeyEvent does not exist.\n + * {@link INPUT_SERVICE_EXCEPTION} Redistribution failed.\n + * Reason: Input service exception, it's recommended to reset the pending distribution status.\n + * @since 21 + */ +Input_Result OH_Input_DispatchToNextHandler(int32_t eventId); + /** * @brief Inject mouse event. * since API 20, it is recommended to use OH_Input_RequestInjection @@ -1389,7 +1458,7 @@ Input_Result OH_Input_GetAxisEventSourceType(const Input_AxisEvent* axisEvent, I * * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. * @param windowId The windowId for the axis event. - * @return OH_Input_SetAxisEventDisplayY function result code. + * @return OH_Input_SetAxisEventWindowId 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 @@ -1402,7 +1471,7 @@ Input_Result OH_Input_SetAxisEventWindowId(Input_AxisEvent* axisEvent, int32_t w * * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. * @param windowId The windowId for the axis event. - * @return OH_Input_GetAxisEventDisplayY function result code. + * @return OH_Input_GetAxisEventWindowId 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 @@ -1415,7 +1484,7 @@ Input_Result OH_Input_GetAxisEventWindowId(const Input_AxisEvent* axisEvent, int * * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. * @param displayId The displayId for the axis event. - * @return OH_Input_SetAxisEventDisplayY function result code. + * @return OH_Input_SetAxisEventDisplayId 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 @@ -1428,7 +1497,7 @@ Input_Result OH_Input_SetAxisEventDisplayId(Input_AxisEvent* axisEvent, int32_t * * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. * @param displayId The displayId for the axis event. - * @return OH_Input_GetAxisEventDisplayY function result code. + * @return OH_Input_GetAxisEventDisplayId 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 @@ -1775,7 +1844,7 @@ void OH_Input_SetFinalKey(Input_Hotkey *hotkey, int32_t finalKey); * * @param hotkey Hotkey key object. * @param finalKeyCode Returns the key value of the decorated key. - * @return OH_Input_GetfinalKey status code, specifically, + * @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_DEVICE_NOT_SUPPORTED} Capability not supported.\n @@ -1840,7 +1909,7 @@ void OH_Input_SetRepeat(Input_Hotkey* hotkey, bool isRepeat); * * @param hotkey Shortcut key object. * @param isRepeat Whether a key event is repeated. - * @return OH_Input_GetIsRepeat status code, specifically, + * @return OH_Input_GetRepeat status code, specifically, * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} otherwise;\n * {@Link INPUT_DEVICE_NOT_SUPPORTED} Capability not supported.\n @@ -2061,7 +2130,7 @@ Input_Result OH_Input_UnregisterDeviceListener(Input_DeviceListener* listener); /** * @brief Unregisters the listener for all device hot swap events. * - * @return OH_Input_UnregisterDeviceListener status code, specifically, + * @return OH_Input_UnregisterDeviceListeners 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 @@ -2093,7 +2162,7 @@ Input_Result OH_Input_GetFunctionKeyState(int32_t keyCode, int32_t *state); * {@link INPUT_SUCCESS} if the operation is successful; * {@link INPUT_PARAMETER_ERROR} if count is a null pointer. * @since 20 -*/ + */ Input_Result OH_Input_QueryMaxTouchPoints(int32_t *count); /** diff --git a/multimodalinput/kits/c/ohinput.ndk.json b/multimodalinput/kits/c/ohinput.ndk.json index 2747b8fa116a9a466fdf8ea14418d3bb98e44bde..83ce83a89e1f7616f1a2209909699df32b1c7d9c 100644 --- a/multimodalinput/kits/c/ohinput.ndk.json +++ b/multimodalinput/kits/c/ohinput.ndk.json @@ -569,5 +569,21 @@ { "first_introduced": "20", "name": "OH_Input_InjectTouchEventGlobal" + }, + { + "first_introduced": "21", + "name": "OH_Input_GetKeyEventId" + }, + { + "first_introduced": "21", + "name": "OH_Input_AddKeyEventHook" + }, + { + "first_introduced": "21", + "name": "OH_Input_RemoveKeyEventHook" + }, + { + "first_introduced": "21", + "name": "OH_Input_DispatchToNextHandler" } ] \ No newline at end of file diff --git a/third_party/musl/ndk_script/toolchain.sh b/third_party/musl/ndk_script/toolchain.sh index db0cf489e508e0aa596db564b527679d41069a8f..4c87b345f9c93d4f5f7ac2b6134bed6a4379f587 100755 --- a/third_party/musl/ndk_script/toolchain.sh +++ b/third_party/musl/ndk_script/toolchain.sh @@ -74,3 +74,9 @@ function remove_unnecessary_file() { } remove_unnecessary_file strip_dir ${OUT_DIR}/lib +if [ -f "${OUT_DIR}/bin/python/lib/python3.11/lldb/_lldb.so" ]; then + ${TOOL_DIR}/llvm-strip ${OUT_DIR}/bin/python/lib/python3.11/lldb/_lldb.so +fi +if [ -f "${OUT_DIR}/bin/python/lib/python3.11/lldb/_lldb.so" ]; then + ${TOOL_DIR}/llvm-strip ${OUT_DIR}/bin/python/lib/python3.11/lldb/_lldb.so +fi diff --git a/web/webview/interfaces/native/arkweb_scheme_handler.h b/web/webview/interfaces/native/arkweb_scheme_handler.h index ead91cb02d62dd45e942a3335f06e5c15e53f1ab..d0232f3c3499a6c5e438f57a4cf8251d0d9531a3 100644 --- a/web/webview/interfaces/native/arkweb_scheme_handler.h +++ b/web/webview/interfaces/native/arkweb_scheme_handler.h @@ -1024,8 +1024,7 @@ int32_t OH_ArkWebResourceHandler_DidFailWithError(const ArkWeb_ResourceHandler* * if DidReceiveResponse has not been called, * a response is automatically constructed and the current request is terminated. * @return {@link ARKWEB_NET_OK} 0 - Success. - * {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param, the errorCode is either ARKWEB_NET_OK - * or outside the range of error codes in ArkWeb_NetError. + * {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param, the resourceHandler is nullptr. * @since 20 */ int32_t OH_ArkWebResourceHandler_DidFailWithErrorV2(const ArkWeb_ResourceHandler* resourceHandler, diff --git a/web/webview/interfaces/native/libohweb.ndk.json b/web/webview/interfaces/native/libohweb.ndk.json index c86a02925aa59078751e1186c6315c1a960ed980..1cdb08fd6a841b158b8b48b1388fde3371b32d21 100644 --- a/web/webview/interfaces/native/libohweb.ndk.json +++ b/web/webview/interfaces/native/libohweb.ndk.json @@ -366,5 +366,13 @@ { "first_introduced": "20", "name": "OH_ArkWebResourceHandler_DidFailWithErrorV2" + }, + { + "first_introduced": "20", + "name": "OH_NativeArkWeb_SetActiveWebEngineVersion" + }, + { + "first_introduced": "20", + "name": "OH_NativeArkWeb_GetActiveWebEngineVersion" } ] diff --git a/web/webview/interfaces/native/native_interface_arkweb.h b/web/webview/interfaces/native/native_interface_arkweb.h index 10332371c25cfc6edba29c677bbef88757d8712b..122d0c50bb4363bbcec2ba7b86b7f04fb4b1a7d3 100644 --- a/web/webview/interfaces/native/native_interface_arkweb.h +++ b/web/webview/interfaces/native/native_interface_arkweb.h @@ -93,6 +93,34 @@ typedef struct { int32_t loadingTime; } ArkWeb_BlanklessInfo; +/** + * @brief ArkWeb Engine Version. + * + * ArkWeb Dual Web Engine Versioning Convention: + *

See [ArkWeb Dual Web Engine Versioning Convention] for switching between Legacy and Evergreen Web Engine. + * + * @since 20 + */ +typedef enum { + /** + * the system default ArkWeb engine. + * @since 20 + */ + SYSTEM_DEFAULT = 0, + + /** + * ArkWeb M114 version. + * @since 20 + */ + ARKWEB_M114 = 1, + + /** + * ArkWeb M132 version. + * @since 20 + */ + ARKWEB_M132 = 2, +} ArkWebEngineVersion; + /** * @brief Loads a piece of code and execute JS code in the context of the currently displayed page. * @@ -315,6 +343,30 @@ ArkWeb_ErrorCode OH_ArkWebCookieManager_SaveCookieSync(); */ void OH_ArkWebCookieManager_SaveCookieAsync(OH_ArkWeb_OnCookieSaveCallback callback); +/** + * Set active ArkWeb engine version. + * If the system does not support the specified version, it will not take effect. + * + * This is a global static API that must be called before initializeWebEngine, and it will have no effect if any + * Web components are loaded. + * + * Legacy Web Engine Compatibility Note: + *

When using legacy ArkWeb Engine, some ArkWeb newly created API will not take effect,
+ * see [Compatible with Legacy Web Engine in release note] for compatibility guidelines. + *

+ * + * @param { ArkWebEngineVersion } webEngineVersion - the ArkWebEngineVersion + * @since 20 + */ +void OH_NativeArkWeb_SetActiveWebEngineVersion(ArkWebEngineVersion webEngineVersion); + +/** + * Get currently active ArkWeb engine version. + * @return { ArkWebEngineVersion } Active ArkWeb Engine version as defined by ArkWebEngineVersion + * @since 20 + */ +ArkWebEngineVersion OH_NativeArkWeb_GetActiveWebEngineVersion(); + #ifdef __cplusplus }; #endif