• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024 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
16/**
17 * @file
18 * @kit ArkUI
19 */
20
21import { LengthMetrics } from './@ohos.arkui.node';
22import { ColorMetrics } from './@ohos.arkui.node';
23
24/**
25 * Declare Component ProgressButtonV2
26 * @syscap SystemCapability.ArkUI.ArkUI.Full
27 * @atomicservice
28 * @crossplatform
29 * @since 18
30 */
31@ComponentV2
32export declare struct ProgressButtonV2 {
33  /**
34   * Sets the ProgressButtonV2 progress.
35   * @type { number }.
36   * @syscap SystemCapability.ArkUI.ArkUI.Full
37   * @atomicservice
38   * @crossplatform
39   * @since 18
40   */
41  @Require
42  @Param readonly progress: number;
43
44  /**
45   * Sets the ProgressButtonV2 content.
46   * @type { ResourceStr }.
47   * @syscap SystemCapability.ArkUI.ArkUI.Full
48   * @atomicservice
49   * @crossplatform
50   * @since 18
51   */
52  @Require
53  @Param readonly content: ResourceStr;
54
55  /**
56   * Sets the ProgressButtonV2 progressButtonWidth.
57   * @type { ?LengthMetrics }.
58   * @syscap SystemCapability.ArkUI.ArkUI.Full
59   * @atomicservice
60   * @crossplatform
61   * @since 18
62   */
63  @Param @Once progressButtonWidth?: LengthMetrics;
64
65  /**
66   * Sets the ProgressButtonV2 onClicked.
67   * @type { ClickCallback }.
68   * @syscap SystemCapability.ArkUI.ArkUI.Full
69   * @atomicservice
70   * @crossplatform
71   * @since 18
72   */
73  @Param readonly onClicked: ClickCallback;
74
75  /**
76   * Sets the ProgressButtonV2 isEnabled state.
77   * @type { boolean }.
78   * @syscap SystemCapability.ArkUI.ArkUI.Full
79   * @atomicservice
80   * @crossplatform
81   * @since 18
82   */
83  @Param readonly isEnabled: boolean;
84
85  /**
86   * Set Color options of the ProgressButtonV2.
87   *
88   * @type { ?ProgressButtonV2Color }
89   * @syscap SystemCapability.ArkUI.ArkUI.Full
90   * @atomicservice
91   * @crossplatform
92   * @since 18
93   */
94  @Param colorOptions?: ProgressButtonV2Color;
95
96  /**
97   * Set border rounded corner radius of progress.
98   *
99   * @type { ?LengthMetrics }
100   * @syscap SystemCapability.ArkUI.ArkUI.Full
101   * @crossplatform
102   * @atomicservice
103   * @since 18
104   */
105  @Param progressButtonRadius?: LengthMetrics;
106}
107
108/**
109 * Declare ProgressButtonV2 Color.
110 *
111 * @syscap SystemCapability.ArkUI.ArkUI.Full
112 * @atomicservice
113 * @crossplatform
114 * @since 18
115 */
116@ObservedV2
117export declare class ProgressButtonV2Color {
118  /**
119   * Set progress color of the ProgressButtonV2.
120   *
121   * @type { ?ColorMetrics }.
122   * @syscap SystemCapability.ArkUI.ArkUI.Full
123   * @atomicservice
124   * @crossplatform
125   * @since 18
126   */
127  @Trace progressColor?: ColorMetrics;
128
129  /**
130   * Set border color of the ProgressButtonV2.
131   *
132   * @type { ?ColorMetrics }.
133   * @syscap SystemCapability.ArkUI.ArkUI.Full
134   * @atomicservice
135   * @crossplatform
136   * @since 18
137   */
138  @Trace borderColor?: ColorMetrics;
139
140  /**
141   * Set text color of the ProgressButtonV2.
142   *
143   * @type { ?ColorMetrics }.
144   * @syscap SystemCapability.ArkUI.ArkUI.Full
145   * @atomicservice
146   * @crossplatform
147   * @since 18
148   */
149  @Trace textColor?: ColorMetrics;
150
151  /**
152   * Set background color of the ProgressButtonV2.
153   *
154   * @type { ?ColorMetrics }.
155   * @syscap SystemCapability.ArkUI.ArkUI.Full
156   * @atomicservice
157   * @crossplatform
158   * @since 18
159   */
160  @Trace backgroundColor?: ColorMetrics;
161
162  /**
163   * The constructor of ProgressButtonV2
164   *
165   * @param options { ProgressButtonV2ColorOptions } the options of the ProgressButtonV2
166   * @syscap SystemCapability.ArkUI.ArkUI.Full
167   * @crossplatform
168   * @atomicservice
169   * @since 18
170   */
171  constructor(options: ProgressButtonV2ColorOptions);
172}
173
174/**
175 * Defines ClickCallback of the ProgressButtonV2.
176 *
177 * @syscap SystemCapability.ArkUI.ArkUI.Full
178 * @atomicservice
179 * @crossplatform
180 * @since 18
181 */
182export type ClickCallback = () => void;
183
184/**
185 * Declare Color options interface of the ProgressButtonV2.
186 *
187 * @interface ProgressButtonV2ColorOptions
188 * @syscap SystemCapability.ArkUI.ArkUI.Full
189 * @atomicservice
190 * @crossplatform
191 * @since 18
192 */
193export declare interface ProgressButtonV2ColorOptions {
194  /**
195   * Set progress color of the ProgressButtonV2.
196   *
197   * @type { ?ColorMetrics }.
198   * @syscap SystemCapability.ArkUI.ArkUI.Full
199   * @atomicservice
200   * @crossplatform
201   * @since 18
202   */
203   progressColor?: ColorMetrics;
204
205  /**
206   * Set border color of the ProgressButtonV2.
207   *
208   * @type { ?ColorMetrics }.
209   * @syscap SystemCapability.ArkUI.ArkUI.Full
210   * @atomicservice
211   * @crossplatform
212   * @since 18
213   */
214   borderColor?: ColorMetrics;
215
216  /**
217   * Set text color of the ProgressButtonV2.
218   *
219   * @type { ?ColorMetrics }.
220   * @syscap SystemCapability.ArkUI.ArkUI.Full
221   * @atomicservice
222   * @crossplatform
223   * @since 18
224   */
225   textColor?: ColorMetrics;
226
227  /**
228   * Set background color of the ProgressButtonV2.
229   *
230   * @type { ?ColorMetrics }.
231   * @syscap SystemCapability.ArkUI.ArkUI.Full
232   * @atomicservice
233   * @crossplatform
234   * @since 18
235   */
236   backgroundColor?: ColorMetrics;
237}