diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 04ace229122f1263de972ce5a5c4d07536301662..abd9ae274498d16781d8c8a221f98879091a0fb1 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3454,5 +3454,9 @@ { "first_introduced": "20", "name": "OH_ArkUI_SetTouchTestDoneCallback" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_SetForceDarkConfig" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 0b18b223f8722f7cad873830f8ca770fae85794a..cf6fb3b014de2e6c33f3c8e9fc18e28dec504b39 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -143,6 +143,11 @@ typedef enum { * @since 20 */ ARKUI_NODE_EMBEDDED_COMPONENT, + /** + * Undefined. + * @since 20 + */ + ARKUI_NODE_UNDEFINED, } ArkUI_NodeType; /** @@ -9789,6 +9794,24 @@ int32_t OH_ArkUI_NodeUtils_GetNodeHandleByUniqueId(const uint32_t uniqueId, ArkU */ int32_t OH_ArkUI_NodeUtils_GetNodeUniqueId(ArkUI_NodeHandle node, int32_t* uniqueId); +/** + * @brief Sets the inverse color algorithm for components and instances. + * + * @param uiContext Indicates the context in which the inverse color feature should take effect. If the value is null, + * the feature applies to the entire application process. + * @param forceDark Indicates whether the inverse color feature is enabled. + * @param nodeType Indicates the component type for which to enable the inverse color feature. If the value is null, + * enabling the feature for all components. + * @param colorInvertFunc Indicates the user-defined inverse color algorithm. + * @return Returns the error code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ERROR_CODE_CAPI_INIT_ERROR} if CAPI init error. + Returns {@link ARKUI_ERROR_CODE_FORCE_DARK_CONFIG_INVALID} if force dark config is invalid. + * @since 20 + */ +int32_t OH_ArkUI_SetForceDarkConfig(ArkUI_ContextHandle uiContext, bool forceDark, ArkUI_NodeType nodeType, + uint32_t (*colorInvertFunc)(uint32_t color)); + #ifdef __cplusplus }; #endif diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 14df29f5c5915ace13d0be19227caf9ef21556d7..b8f81e93eb07017caf02dff4cfe85b159373672d 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -2246,6 +2246,11 @@ typedef enum { * @since 15 */ ARKUI_ERROR_CODE_NODE_NOT_ON_MAIN_TREE = 106203, + /** + * @error Force dark config is invalid. + * @since 20 + */ + ARKUI_ERROR_CODE_FORCE_DARK_CONFIG_INVALID = 106205, /** * @error The node requesting focus is not focusable. * @since 15