161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit ArkUI 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ci/** 2261847f8eSopenharmony_ci * Provides methods for switching components. 2361847f8eSopenharmony_ci * 2461847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 2561847f8eSopenharmony_ci * @crossplatform 2661847f8eSopenharmony_ci * @form 2761847f8eSopenharmony_ci * @atomicservice 2861847f8eSopenharmony_ci * @since 13 2961847f8eSopenharmony_ci */ 3061847f8eSopenharmony_cideclare class IndicatorComponentController { 3161847f8eSopenharmony_ci /** 3261847f8eSopenharmony_ci * constructor. 3361847f8eSopenharmony_ci * 3461847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 3561847f8eSopenharmony_ci * @crossplatform 3661847f8eSopenharmony_ci * @form 3761847f8eSopenharmony_ci * @atomicservice 3861847f8eSopenharmony_ci * @since 13 3961847f8eSopenharmony_ci */ 4061847f8eSopenharmony_ci constructor(); 4161847f8eSopenharmony_ci 4261847f8eSopenharmony_ci /** 4361847f8eSopenharmony_ci * Called when the next child component is displayed. 4461847f8eSopenharmony_ci * 4561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 4661847f8eSopenharmony_ci * @crossplatform 4761847f8eSopenharmony_ci * @form 4861847f8eSopenharmony_ci * @atomicservice 4961847f8eSopenharmony_ci * @since 13 5061847f8eSopenharmony_ci */ 5161847f8eSopenharmony_ci showNext():void; 5261847f8eSopenharmony_ci 5361847f8eSopenharmony_ci /** 5461847f8eSopenharmony_ci * Called when the previous subcomponent is displayed. 5561847f8eSopenharmony_ci * 5661847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 5761847f8eSopenharmony_ci * @crossplatform 5861847f8eSopenharmony_ci * @form 5961847f8eSopenharmony_ci * @atomicservice 6061847f8eSopenharmony_ci * @since 13 6161847f8eSopenharmony_ci */ 6261847f8eSopenharmony_ci showPrevious():void; 6361847f8eSopenharmony_ci 6461847f8eSopenharmony_ci /** 6561847f8eSopenharmony_ci * Controlling IndicatorComponent to change to the specified subcomponent. 6661847f8eSopenharmony_ci * 6761847f8eSopenharmony_ci * @param { number } index - The index of item to be redirected. 6861847f8eSopenharmony_ci * @param { boolean } [useAnimation] - If true, swipe to index item with animation. If false, swipe to index item without animation. 6961847f8eSopenharmony_ci * The default value is false. 7061847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 7161847f8eSopenharmony_ci * @crossplatform 7261847f8eSopenharmony_ci * @form 7361847f8eSopenharmony_ci * @atomicservice 7461847f8eSopenharmony_ci * @since 13 7561847f8eSopenharmony_ci */ 7661847f8eSopenharmony_ci changeIndex(index: number, useAnimation?: boolean):void; 7761847f8eSopenharmony_ci} 7861847f8eSopenharmony_ci 7961847f8eSopenharmony_ci/** 8061847f8eSopenharmony_ci * Provides an interface for indicator. 8161847f8eSopenharmony_ci * 8261847f8eSopenharmony_ci * @interface IndicatorComponentInterface 8361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 8461847f8eSopenharmony_ci * @crossplatform 8561847f8eSopenharmony_ci * @form 8661847f8eSopenharmony_ci * @atomicservice 8761847f8eSopenharmony_ci * @since 13 8861847f8eSopenharmony_ci */ 8961847f8eSopenharmony_ciinterface IndicatorComponentInterface { 9061847f8eSopenharmony_ci 9161847f8eSopenharmony_ci /** 9261847f8eSopenharmony_ci * Called when a indicator is set. 9361847f8eSopenharmony_ci * 9461847f8eSopenharmony_ci * @param { IndicatorComponentController } controller - indicator component controller. 9561847f8eSopenharmony_ci * @returns { IndicatorComponentAttribute } 9661847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 9761847f8eSopenharmony_ci * @crossplatform 9861847f8eSopenharmony_ci * @form 9961847f8eSopenharmony_ci * @atomicservice 10061847f8eSopenharmony_ci * @since 13 10161847f8eSopenharmony_ci */ 10261847f8eSopenharmony_ci (controller?: IndicatorComponentController): IndicatorComponentAttribute; 10361847f8eSopenharmony_ci} 10461847f8eSopenharmony_ci 10561847f8eSopenharmony_ci/** 10661847f8eSopenharmony_ci * Defines the IndicatorComponent attribute functions. 10761847f8eSopenharmony_ci * 10861847f8eSopenharmony_ci * @extends CommonMethod<IndicatorComponentAttribute> 10961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 11061847f8eSopenharmony_ci * @crossplatform 11161847f8eSopenharmony_ci * @form 11261847f8eSopenharmony_ci * @atomicservice 11361847f8eSopenharmony_ci * @since 13 11461847f8eSopenharmony_ci */ 11561847f8eSopenharmony_cideclare class IndicatorComponentAttribute extends CommonMethod<IndicatorComponentAttribute> { 11661847f8eSopenharmony_ci /** 11761847f8eSopenharmony_ci * Called when the index value of the displayed subcomponent is set in the container. 11861847f8eSopenharmony_ci * 11961847f8eSopenharmony_ci * @param { number } index 12061847f8eSopenharmony_ci * @returns { IndicatorComponentAttribute } 12161847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 12261847f8eSopenharmony_ci * @crossplatform 12361847f8eSopenharmony_ci * @form 12461847f8eSopenharmony_ci * @atomicservice 12561847f8eSopenharmony_ci * @since 13 12661847f8eSopenharmony_ci */ 12761847f8eSopenharmony_ci initialIndex(index: number): IndicatorComponentAttribute; 12861847f8eSopenharmony_ci 12961847f8eSopenharmony_ci /** 13061847f8eSopenharmony_ci * Sets the total number of indicator. 13161847f8eSopenharmony_ci * 13261847f8eSopenharmony_ci * @param { number } totalCount 13361847f8eSopenharmony_ci * @returns { IndicatorComponentAttribute } 13461847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 13561847f8eSopenharmony_ci * @crossplatform 13661847f8eSopenharmony_ci * @form 13761847f8eSopenharmony_ci * @atomicservice 13861847f8eSopenharmony_ci * @since 13 13961847f8eSopenharmony_ci */ 14061847f8eSopenharmony_ci count(totalCount: number): IndicatorComponentAttribute; 14161847f8eSopenharmony_ci 14261847f8eSopenharmony_ci /** 14361847f8eSopenharmony_ci * Sets the indicator style. 14461847f8eSopenharmony_ci * 14561847f8eSopenharmony_ci * @param { DotIndicator | DigitIndicator } indicatorStyle - the style value 14661847f8eSopenharmony_ci * @returns { IndicatorComponentAttribute } 14761847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 14861847f8eSopenharmony_ci * @crossplatform 14961847f8eSopenharmony_ci * @form 15061847f8eSopenharmony_ci * @atomicservice 15161847f8eSopenharmony_ci * @since 13 15261847f8eSopenharmony_ci */ 15361847f8eSopenharmony_ci style(indicatorStyle: DotIndicator | DigitIndicator): IndicatorComponentAttribute; 15461847f8eSopenharmony_ci 15561847f8eSopenharmony_ci /** 15661847f8eSopenharmony_ci * Called when setting whether to turn on cyclic sliding. 15761847f8eSopenharmony_ci * 15861847f8eSopenharmony_ci * @param { boolean } isLoop 15961847f8eSopenharmony_ci * @returns { IndicatorComponentAttribute } 16061847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 16161847f8eSopenharmony_ci * @crossplatform 16261847f8eSopenharmony_ci * @form 16361847f8eSopenharmony_ci * @atomicservice 16461847f8eSopenharmony_ci * @since 13 16561847f8eSopenharmony_ci */ 16661847f8eSopenharmony_ci loop(isLoop: boolean): IndicatorComponentAttribute; 16761847f8eSopenharmony_ci 16861847f8eSopenharmony_ci /** 16961847f8eSopenharmony_ci * Called when setting whether to slide vertically. 17061847f8eSopenharmony_ci * 17161847f8eSopenharmony_ci * @param { boolean } isVertical 17261847f8eSopenharmony_ci * @returns { IndicatorComponentAttribute } 17361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 17461847f8eSopenharmony_ci * @crossplatform 17561847f8eSopenharmony_ci * @form 17661847f8eSopenharmony_ci * @atomicservice 17761847f8eSopenharmony_ci * @since 13 17861847f8eSopenharmony_ci */ 17961847f8eSopenharmony_ci vertical(isVertical: boolean): IndicatorComponentAttribute; 18061847f8eSopenharmony_ci 18161847f8eSopenharmony_ci /** 18261847f8eSopenharmony_ci * Called when the index value changes. 18361847f8eSopenharmony_ci * 18461847f8eSopenharmony_ci * @param { Callback<number> } event 18561847f8eSopenharmony_ci * @returns { IndicatorComponentAttribute } 18661847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 18761847f8eSopenharmony_ci * @crossplatform 18861847f8eSopenharmony_ci * @form 18961847f8eSopenharmony_ci * @atomicservice 19061847f8eSopenharmony_ci * @since 13 19161847f8eSopenharmony_ci */ 19261847f8eSopenharmony_ci onChange(event: Callback<number>): IndicatorComponentAttribute; 19361847f8eSopenharmony_ci} 19461847f8eSopenharmony_ci 19561847f8eSopenharmony_ci/** 19661847f8eSopenharmony_ci * Defines IndicatorComponent. 19761847f8eSopenharmony_ci * 19861847f8eSopenharmony_ci * @constant 19961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 20061847f8eSopenharmony_ci * @crossplatform 20161847f8eSopenharmony_ci * @form 20261847f8eSopenharmony_ci * @atomicservice 20361847f8eSopenharmony_ci * @since 13 20461847f8eSopenharmony_ci */ 20561847f8eSopenharmony_cideclare const IndicatorComponent: IndicatorComponentInterface; 20661847f8eSopenharmony_ci 20761847f8eSopenharmony_ci/** 20861847f8eSopenharmony_ci * Defines IndicatorComponent instance. 20961847f8eSopenharmony_ci * 21061847f8eSopenharmony_ci * @constant 21161847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 21261847f8eSopenharmony_ci * @crossplatform 21361847f8eSopenharmony_ci * @form 21461847f8eSopenharmony_ci * @atomicservice 21561847f8eSopenharmony_ci * @since 13 21661847f8eSopenharmony_ci */ 21761847f8eSopenharmony_cideclare const IndicatorComponentInstance: IndicatorComponentAttribute; 218