diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 3b7a8c0affac35abc241180a6e296a99b8140346..2f74b718fb1879ebda9fb35c6b021a26a4b816a4 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3334,5 +3334,9 @@ { "first_introduced": "20", "name": "OH_ArkUI_EmbeddedComponentOption_SetOnTerminated" + }, + { + "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 f3d238f724877c0bc0f172784700327045980765..b1f72c18b706fce631f050438299de4feccfd5ae 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 = 999, } ArkUI_NodeType; /** @@ -9281,6 +9286,24 @@ int32_t OH_ArkUI_GetNodeSnapshot(ArkUI_NodeHandle node, ArkUI_SnapshotOptions* s */ int32_t OH_ArkUI_NodeUtils_GetPositionToParent(ArkUI_NodeHandle node, ArkUI_IntOffset* globalOffset); +/** + * @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 adb29c35fdeb62015e1e132d0ff5824e39080dcd..9ab9a2f57defdce612ee97deddb4707a058053c9 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -2202,6 +2202,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 = 106204, /** * @error The node requesting focus is not focusable. * @since 15