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 * Defines the LinearIndicator Controller. 1861847f8eSopenharmony_ci * 1961847f8eSopenharmony_ci * @interface LinearIndicatorController 2061847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 2161847f8eSopenharmony_ci * @crossplatform 2261847f8eSopenharmony_ci * @atomicservice 2361847f8eSopenharmony_ci * @since 13 2461847f8eSopenharmony_ci */ 2561847f8eSopenharmony_cideclare class LinearIndicatorController { 2661847f8eSopenharmony_ci /** 2761847f8eSopenharmony_ci * constructor. 2861847f8eSopenharmony_ci * 2961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 3061847f8eSopenharmony_ci * @crossplatform 3161847f8eSopenharmony_ci * @atomicservice 3261847f8eSopenharmony_ci * @since 13 3361847f8eSopenharmony_ci */ 3461847f8eSopenharmony_ci constructor(); 3561847f8eSopenharmony_ci 3661847f8eSopenharmony_ci /** 3761847f8eSopenharmony_ci * Sets the progress of indicator. 3861847f8eSopenharmony_ci * 3961847f8eSopenharmony_ci * @param { number } index - the index of current indicator, value range: [0, count - 1]. 4061847f8eSopenharmony_ci * If index value is out of range, do nothing. 4161847f8eSopenharmony_ci * @param { number } progress - current indicator progress value, value range: [0, 100]. 4261847f8eSopenharmony_ci * If the progress value is out of range, do nothing. 4361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 4461847f8eSopenharmony_ci * @crossplatform 4561847f8eSopenharmony_ci * @atomicservice 4661847f8eSopenharmony_ci * @since 13 4761847f8eSopenharmony_ci */ 4861847f8eSopenharmony_ci setProgress(index: number, progress: number): void; 4961847f8eSopenharmony_ci 5061847f8eSopenharmony_ci /** 5161847f8eSopenharmony_ci * Start indicator auto play. 5261847f8eSopenharmony_ci * 5361847f8eSopenharmony_ci * @param { LinearIndicatorStartOptions } [options] - the options of indicator auto play. 5461847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 5561847f8eSopenharmony_ci * @crossplatform 5661847f8eSopenharmony_ci * @atomicservice 5761847f8eSopenharmony_ci * @since 13 5861847f8eSopenharmony_ci */ 5961847f8eSopenharmony_ci start(options?: LinearIndicatorStartOptions): void; 6061847f8eSopenharmony_ci 6161847f8eSopenharmony_ci /** 6261847f8eSopenharmony_ci * Pause indicator auto play. 6361847f8eSopenharmony_ci * Start auto play will be resumed from this paused position. 6461847f8eSopenharmony_ci * 6561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 6661847f8eSopenharmony_ci * @crossplatform 6761847f8eSopenharmony_ci * @atomicservice 6861847f8eSopenharmony_ci * @since 13 6961847f8eSopenharmony_ci */ 7061847f8eSopenharmony_ci pause(): void; 7161847f8eSopenharmony_ci 7261847f8eSopenharmony_ci /** 7361847f8eSopenharmony_ci * Stop indicator auto play. 7461847f8eSopenharmony_ci * Start auto play will restart from the very beginning. 7561847f8eSopenharmony_ci * 7661847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 7761847f8eSopenharmony_ci * @crossplatform 7861847f8eSopenharmony_ci * @atomicservice 7961847f8eSopenharmony_ci * @since 13 8061847f8eSopenharmony_ci */ 8161847f8eSopenharmony_ci stop(): void; 8261847f8eSopenharmony_ci} 8361847f8eSopenharmony_ci 8461847f8eSopenharmony_ci/** 8561847f8eSopenharmony_ci * Provides options of indicator auto play. 8661847f8eSopenharmony_ci * 8761847f8eSopenharmony_ci * @interface LinearIndicatorAutoPlayOptions 8861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 8961847f8eSopenharmony_ci * @crossplatform 9061847f8eSopenharmony_ci * @atomicservice 9161847f8eSopenharmony_ci * @since 13 9261847f8eSopenharmony_ci */ 9361847f8eSopenharmony_cideclare interface LinearIndicatorStartOptions { 9461847f8eSopenharmony_ci /** 9561847f8eSopenharmony_ci * The interval between twice auto play. The unit is ms. 9661847f8eSopenharmony_ci * 9761847f8eSopenharmony_ci * @type { ?number } 9861847f8eSopenharmony_ci * @default The default value is 0. if value is less than 0, the value will be 0. 9961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 10061847f8eSopenharmony_ci * @crossplatform 10161847f8eSopenharmony_ci * @atomicservice 10261847f8eSopenharmony_ci * @since 13 10361847f8eSopenharmony_ci */ 10461847f8eSopenharmony_ci interval?: number; 10561847f8eSopenharmony_ci 10661847f8eSopenharmony_ci /** 10761847f8eSopenharmony_ci * The animation curve duration. The unit is ms. 10861847f8eSopenharmony_ci * 10961847f8eSopenharmony_ci * @type { ?number } 11061847f8eSopenharmony_ci * @default 4000 11161847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 11261847f8eSopenharmony_ci * @crossplatform 11361847f8eSopenharmony_ci * @atomicservice 11461847f8eSopenharmony_ci * @since 13 11561847f8eSopenharmony_ci */ 11661847f8eSopenharmony_ci duration?: number; 11761847f8eSopenharmony_ci} 11861847f8eSopenharmony_ci 11961847f8eSopenharmony_ci/** 12061847f8eSopenharmony_ci * Provides linear indicator style. 12161847f8eSopenharmony_ci * 12261847f8eSopenharmony_ci * @interface LinearIndicatorStyle 12361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 12461847f8eSopenharmony_ci * @crossplatform 12561847f8eSopenharmony_ci * @atomicservice 12661847f8eSopenharmony_ci * @since 13 12761847f8eSopenharmony_ci */ 12861847f8eSopenharmony_cideclare interface LinearIndicatorStyle { 12961847f8eSopenharmony_ci /** 13061847f8eSopenharmony_ci * The space of two linear indicator. 13161847f8eSopenharmony_ci * 13261847f8eSopenharmony_ci * @type { ?LengthMetrics } 13361847f8eSopenharmony_ci * @default The default value is 4.0vp. if value is less than 0, the value will be 4.0vp. 13461847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 13561847f8eSopenharmony_ci * @crossplatform 13661847f8eSopenharmony_ci * @atomicservice 13761847f8eSopenharmony_ci * @since 13 13861847f8eSopenharmony_ci */ 13961847f8eSopenharmony_ci space?: LengthMetrics; 14061847f8eSopenharmony_ci 14161847f8eSopenharmony_ci /** 14261847f8eSopenharmony_ci * Stroke width of the progress indicator. 14361847f8eSopenharmony_ci * 14461847f8eSopenharmony_ci * @type { ?LengthMetrics } 14561847f8eSopenharmony_ci * @default The default value is 2.0vp. if value is less than 0, the value will be 2.0vp. 14661847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 14761847f8eSopenharmony_ci * @crossplatform 14861847f8eSopenharmony_ci * @atomicservice 14961847f8eSopenharmony_ci * @since 13 15061847f8eSopenharmony_ci */ 15161847f8eSopenharmony_ci strokeWidth?: LengthMetrics; 15261847f8eSopenharmony_ci 15361847f8eSopenharmony_ci /** 15461847f8eSopenharmony_ci * The stroke radius of linear indicator. 15561847f8eSopenharmony_ci * 15661847f8eSopenharmony_ci * @type { ?LengthMetrics } 15761847f8eSopenharmony_ci * @default The default value is 1.0vp. if value is more than strokeWidth/2, the value will be strokeWidth/2. 15861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 15961847f8eSopenharmony_ci * @crossplatform 16061847f8eSopenharmony_ci * @atomicservice 16161847f8eSopenharmony_ci * @since 13 16261847f8eSopenharmony_ci */ 16361847f8eSopenharmony_ci strokeRadius?: LengthMetrics; 16461847f8eSopenharmony_ci 16561847f8eSopenharmony_ci /** 16661847f8eSopenharmony_ci * The track background color of linear indicator. 16761847f8eSopenharmony_ci * 16861847f8eSopenharmony_ci * @type { ?ColorMetrics } 16961847f8eSopenharmony_ci * @default comp_background_tertiary 17061847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 17161847f8eSopenharmony_ci * @crossplatform 17261847f8eSopenharmony_ci * @atomicservice 17361847f8eSopenharmony_ci * @since 13 17461847f8eSopenharmony_ci */ 17561847f8eSopenharmony_ci trackBackgroundColor?: ColorMetrics; 17661847f8eSopenharmony_ci 17761847f8eSopenharmony_ci /** 17861847f8eSopenharmony_ci * The track color of linear indicator. 17961847f8eSopenharmony_ci * 18061847f8eSopenharmony_ci * @type { ?ColorMetrics } 18161847f8eSopenharmony_ci * @default comp_background_emphasize 18261847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 18361847f8eSopenharmony_ci * @crossplatform 18461847f8eSopenharmony_ci * @atomicservice 18561847f8eSopenharmony_ci * @since 13 18661847f8eSopenharmony_ci */ 18761847f8eSopenharmony_ci trackColor?: ColorMetrics; 18861847f8eSopenharmony_ci} 18961847f8eSopenharmony_ci 19061847f8eSopenharmony_ci/** 19161847f8eSopenharmony_ci * Provides an interface for indicator. 19261847f8eSopenharmony_ci * 19361847f8eSopenharmony_ci * @interface LinearIndicatorInterface 19461847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 19561847f8eSopenharmony_ci * @crossplatform 19661847f8eSopenharmony_ci * @atomicservice 19761847f8eSopenharmony_ci * @since 13 19861847f8eSopenharmony_ci */ 19961847f8eSopenharmony_ciinterface LinearIndicatorInterface { 20061847f8eSopenharmony_ci /** 20161847f8eSopenharmony_ci * Constructor parameters 20261847f8eSopenharmony_ci * 20361847f8eSopenharmony_ci * @param { number } count - the number of progress in LinearIndicator. minimum value is 2(default is 5). 20461847f8eSopenharmony_ci * if count is less than 2, the value will be 2. 20561847f8eSopenharmony_ci * @param { LinearIndicatorController } controller - Controller of LinearIndicator. 20661847f8eSopenharmony_ci * @returns { LinearIndicatorAttribute } return the instance of the LinearIndicatorAttribute 20761847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 20861847f8eSopenharmony_ci * @crossplatform 20961847f8eSopenharmony_ci * @atomicservice 21061847f8eSopenharmony_ci * @since 13 21161847f8eSopenharmony_ci */ 21261847f8eSopenharmony_ci (count?: number, controller?: LinearIndicatorController): LinearIndicatorAttribute; 21361847f8eSopenharmony_ci} 21461847f8eSopenharmony_ci 21561847f8eSopenharmony_ci/** 21661847f8eSopenharmony_ci * Defines the Indicator attribute functions. 21761847f8eSopenharmony_ci * 21861847f8eSopenharmony_ci * @extends CommonMethod<LinearIndicatorAttribute> 21961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 22061847f8eSopenharmony_ci * @crossplatform 22161847f8eSopenharmony_ci * @atomicservice 22261847f8eSopenharmony_ci * @since 13 22361847f8eSopenharmony_ci */ 22461847f8eSopenharmony_cideclare class LinearIndicatorAttribute extends CommonMethod<LinearIndicatorAttribute> { 22561847f8eSopenharmony_ci /** 22661847f8eSopenharmony_ci * Sets the indicator style. 22761847f8eSopenharmony_ci * 22861847f8eSopenharmony_ci * @param { Optional<LinearIndicatorStyle> } style - the style of LinearIndicator 22961847f8eSopenharmony_ci * @returns { LinearIndicatorAttribute } return the instance of the LinearIndicatorAttribute 23061847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 23161847f8eSopenharmony_ci * @crossplatform 23261847f8eSopenharmony_ci * @atomicservice 23361847f8eSopenharmony_ci * @since 13 23461847f8eSopenharmony_ci */ 23561847f8eSopenharmony_ci indicatorStyle(style: Optional<LinearIndicatorStyle>): LinearIndicatorAttribute; 23661847f8eSopenharmony_ci 23761847f8eSopenharmony_ci /** 23861847f8eSopenharmony_ci * Sets whether indicator supports loop, default is true. 23961847f8eSopenharmony_ci * 24061847f8eSopenharmony_ci * @param { Optional<boolean> } loop - indicate whether loop playback is supported 24161847f8eSopenharmony_ci * @returns { LinearIndicatorAttribute } return the instance of the LinearIndicatorAttribute 24261847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 24361847f8eSopenharmony_ci * @crossplatform 24461847f8eSopenharmony_ci * @atomicservice 24561847f8eSopenharmony_ci * @since 13 24661847f8eSopenharmony_ci */ 24761847f8eSopenharmony_ci indicatorLoop(loop: Optional<boolean>): LinearIndicatorAttribute; 24861847f8eSopenharmony_ci 24961847f8eSopenharmony_ci /** 25061847f8eSopenharmony_ci * Called when progress value update. 25161847f8eSopenharmony_ci * 25261847f8eSopenharmony_ci * @param { Optional<OnLinearIndicatorChangeCallback> } callback - callback of the progress change event. 25361847f8eSopenharmony_ci * @returns { LinearIndicatorAttribute } return the instance of the LinearIndicatorAttribute 25461847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 25561847f8eSopenharmony_ci * @crossplatform 25661847f8eSopenharmony_ci * @atomicservice 25761847f8eSopenharmony_ci * @since 13 25861847f8eSopenharmony_ci */ 25961847f8eSopenharmony_ci onChange(callback: Optional<OnLinearIndicatorChangeCallback>): LinearIndicatorAttribute; 26061847f8eSopenharmony_ci} 26161847f8eSopenharmony_ci 26261847f8eSopenharmony_ci/** 26361847f8eSopenharmony_ci * Defines the callback type used in the indicator progress change event. 26461847f8eSopenharmony_ci * 26561847f8eSopenharmony_ci * @typedef { function } OnLinearIndicatorChangeCallback 26661847f8eSopenharmony_ci * @param { number } index - index of current indicator. 26761847f8eSopenharmony_ci * @param { number } progress - current indicator progress value. 26861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 26961847f8eSopenharmony_ci * @crossplatform 27061847f8eSopenharmony_ci * @atomicservice 27161847f8eSopenharmony_ci * @since 13 27261847f8eSopenharmony_ci */ 27361847f8eSopenharmony_cideclare type OnLinearIndicatorChangeCallback = (index: number, progress: number) => void; 27461847f8eSopenharmony_ci 27561847f8eSopenharmony_ci/** 27661847f8eSopenharmony_ci * Defines Indicator Component. 27761847f8eSopenharmony_ci * 27861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 27961847f8eSopenharmony_ci * @crossplatform 28061847f8eSopenharmony_ci * @atomicservice 28161847f8eSopenharmony_ci * @since 13 28261847f8eSopenharmony_ci */ 28361847f8eSopenharmony_cideclare const LinearIndicator: LinearIndicatorInterface; 28461847f8eSopenharmony_ci 28561847f8eSopenharmony_ci/** 28661847f8eSopenharmony_ci * Defines Indicator Component instance. 28761847f8eSopenharmony_ci * 28861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 28961847f8eSopenharmony_ci * @crossplatform 29061847f8eSopenharmony_ci * @atomicservice 29161847f8eSopenharmony_ci * @since 13 29261847f8eSopenharmony_ci */ 29361847f8eSopenharmony_cideclare const LinearIndicatorInstance: LinearIndicatorAttribute 294