diff --git a/arkui/ace_engine/native/BUILD.gn b/arkui/ace_engine/native/BUILD.gn index b48b73ada3d60b5a9903bbb79167cbdd0c55399d..31cb72ebcc565e914c505512b75901d601ef7791 100644 --- a/arkui/ace_engine/native/BUILD.gn +++ b/arkui/ace_engine/native/BUILD.gn @@ -37,6 +37,7 @@ if (!is_arkui_x) { "native_key_event.h", "native_node.h", "native_node_napi.h", + "native_theme.h", "native_type.h", "styled_string.h", "ui_input_event.h", diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index c246d755ff67c3e5ce6bcc1f956cc26498ac5f50..eb293cf0df24d33a5edf81ad3855921636f12d72 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -133,6 +133,11 @@ typedef enum { ARKUI_NODE_GRID_ITEM, /** Custom span. */ ARKUI_NODE_CUSTOM_SPAN, + /** + * all node type means no specific node type is specified. + * @since 20 + */ + ARKUI_NODE_ALL = INT32_MAX, } ArkUI_NodeType; /** diff --git a/arkui/ace_engine/native/native_theme.h b/arkui/ace_engine/native/native_theme.h new file mode 100644 index 0000000000000000000000000000000000000000..9d6c7fe61cde3698ee1fa93c1ea950371bfc0138 --- /dev/null +++ b/arkui/ace_engine/native/native_theme.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 ArkUI_NativeModule + * @{ + * + * @brief Provides UI capabilities of ArkUI on the native side, such as UI + * component creation and destruction, tree node operations, attribute setting, + * and event listening. + * + * @since 12 + */ + +/** + * @file native_theme.h + * + * @brief Defines the theme types for the native module. + * + * @library libace_ndk.z.so + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @kit ArkUI + * @since 20 + */ + +#ifndef ARKUI_NATIVE_THEME_H +#define ARKUI_NATIVE_THEME_H + +#include "native_node.h" +#include "native_type.h" +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Set the component's ability to switch between light and dark colors. + * + * @param forceDark Forcedark color reversal ability. + * @param nodeType Control type. refer to {@link ArkUI_NodeType}. + * @param colorConvertFunc Custom color reversal algorithm function pointer. + * @param uiContext Indicates the pointer to the ArkUI_ContextHandle object. + * @return Returns the error code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * + * @since 20 + */ +uint32_t OH_ArkUI_SetForceDarkConfig(bool forceDark, ArkUI_NodeType nodeType, + uint32_t (*colorConvertFunc)(uint32_t color, void* userData), + ArkUI_ContextHandle uiContext, void* userData); + +#ifdef __cplusplus +}; +#endif + +#endif // ARKUI_NATIVE_THEME_H +/** @} */