1 /* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef ARKUI_CAPI_XTS_LIST_SCROLL_TO_TEST_H 16 #define ARKUI_CAPI_XTS_LIST_SCROLL_TO_TEST_H 17 18 #include "../common/common.h" 19 #include <ace/xcomponent/native_interface_xcomponent.h> 20 21 namespace ArkUICapiTest { 22 23 class ListScrollToTest { 24 public: 25 ~ListScrollToTest(); 26 static napi_value ListScrollToIndexTest(napi_env env, napi_callback_info info); 27 private: 28 static ArkUI_NodeHandle CreateButton(ArkUI_NativeNodeAPI_1 *nodeAPI, std::string buttonName, int eventId); 29 static void ProcessEvent(ArkUI_NativeNodeAPI_1 *nodeAPI, int eventId); 30 static void AddListItem(ArkUI_NativeNodeAPI_1 *nodeAPI, ArkUI_NodeHandle &list); 31 static void AddListItemGroup(ArkUI_NativeNodeAPI_1 *nodeAPI, ArkUI_NodeHandle &list2); 32 static void AddListItemGroup1(ArkUI_NativeNodeAPI_1 *nodeAPI, ArkUI_NodeHandle &list); 33 static ArkUI_NodeHandle CreateChildNode(ArkUI_NativeNodeAPI_1 *nodeAPI); 34 }; 35 } // namespace ArkUICapiTest 36 #endif // ARKUI_CAPI_XTS_LIST_SCROLL_TO_TEST_H