• 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
21/**
22 * Declare the action when the button of dialog is clicked.
23 *
24 * @typedef { function } AdvancedDialogV2ButtonAction
25 * @syscap SystemCapability.ArkUI.ArkUI.Full
26 * @crossplatform
27 * @atomicservice
28 * @since 18
29 */
30export declare type AdvancedDialogV2ButtonAction = () => void;
31
32/**
33 * Declare AdvancedDialogV2Button.
34 *
35 * @class AdvancedDialogV2Button
36 * @syscap SystemCapability.ArkUI.ArkUI.Full
37 * @crossplatform
38 * @atomicservice
39 * @since 18
40 */
41@ObservedV2
42export declare class AdvancedDialogV2Button {
43  /**
44   * Sets the Display Content of a Button.
45   *
46   * @type { ResourceStr }.
47   * @syscap SystemCapability.ArkUI.ArkUI.Full
48   * @crossplatform
49   * @atomicservice
50   * @since 18
51   */
52  @Trace
53  content: ResourceStr;
54  /**
55   * Sets the Button Callback.
56   *
57   * @type { ?AdvancedDialogV2ButtonAction }.
58   * @syscap SystemCapability.ArkUI.ArkUI.Full
59   * @crossplatform
60   * @atomicservice
61   * @since 18
62   */
63  @Trace
64  action?: AdvancedDialogV2ButtonAction;
65  /**
66   * Sets the background color of a button.
67   *
68   * @type { ?ColorMetrics }.
69   * @syscap SystemCapability.ArkUI.ArkUI.Full
70   * @crossplatform
71   * @atomicservice
72   * @since 18
73   */
74  @Trace
75  background?: ColorMetrics;
76  /**
77   * Sets the Button Text Color.
78   *
79   * @type { ?ColorMetrics }.
80   * @syscap SystemCapability.ArkUI.ArkUI.Full
81   * @crossplatform
82   * @atomicservice
83   * @since 18
84   */
85  @Trace
86  fontColor?: ColorMetrics;
87  /**
88   * Describes the Button style.
89   *
90   * @type { ?ButtonStyleMode }
91   * @default ButtonStyleMode.TEXTUAL
92   * @syscap SystemCapability.ArkUI.ArkUI.Full
93   * @crossplatform
94   * @atomicservice
95   * @since 18
96   */
97  @Trace
98  buttonStyle?: ButtonStyleMode;
99  /**
100   * Describes the Button role.
101   *
102   * @type { ?ButtonRole }
103   * @default ButtonRole.NORMAL
104   * @syscap SystemCapability.ArkUI.ArkUI.Full
105   * @crossplatform
106   * @atomicservice
107   * @since 18
108   */
109  @Trace
110  role?: ButtonRole;
111  /**
112   * Set the default focus of a button.
113   *
114   * @type { ?boolean }
115   * @default { false }
116   * @syscap SystemCapability.ArkUI.ArkUI.Full
117   * @crossplatform
118   * @atomicservice
119   * @since 18
120   */
121  @Trace
122  defaultFocus?: boolean;
123  /**
124   * Set the availability of the button.
125   *
126   * @type { ?boolean }
127   * @default { true }
128   * @syscap SystemCapability.ArkUI.ArkUI.Full
129   * @crossplatform
130   * @atomicservice
131   * @since 18
132   */
133  @Trace
134  enabled?: boolean;
135  /**
136   * The constructor used to create a AdvancedDialogV2Button object.
137   *
138   * @param { AdvancedDialogV2ButtonOptions } options - button info.
139   * @syscap SystemCapability.ArkUI.ArkUI.Full
140   * @crossplatform
141   * @atomicservice
142   * @since 18
143   */
144  constructor(options: AdvancedDialogV2ButtonOptions);
145}
146
147/**
148 * Declare the options of AdvancedDialogV2Button
149 *
150 * @interface AdvancedDialogV2ButtonOptions
151 * @syscap SystemCapability.ArkUI.ArkUI.Full
152 * @crossplatform
153 * @atomicservice
154 * @since 18
155 */
156export declare interface AdvancedDialogV2ButtonOptions {
157  /**
158   * Sets the Display Content of a Button.
159   *
160   * @type { ResourceStr }.
161   * @syscap SystemCapability.ArkUI.ArkUI.Full
162   * @crossplatform
163   * @atomicservice
164   * @since 18
165   */
166  content: ResourceStr;
167  /**
168   * Sets the Button Callback.
169   *
170   * @type { ?AdvancedDialogV2ButtonAction }.
171   * @syscap SystemCapability.ArkUI.ArkUI.Full
172   * @crossplatform
173   * @atomicservice
174   * @since 18
175   */
176  action?: AdvancedDialogV2ButtonAction;
177  /**
178   * Sets the background color of a button.
179   *
180   * @type { ?ColorMetrics }.
181   * @syscap SystemCapability.ArkUI.ArkUI.Full
182   * @crossplatform
183   * @atomicservice
184   * @since 18
185   */
186  background?: ColorMetrics;
187  /**
188   * Sets the Button Text Color.
189   *
190   * @type { ?ColorMetrics }.
191   * @syscap SystemCapability.ArkUI.ArkUI.Full
192   * @crossplatform
193   * @atomicservice
194   * @since 18
195   */
196  fontColor?: ColorMetrics;
197  /**
198   * Describes the Button style.
199   *
200   * @type { ?ButtonStyleMode }
201   * @default ButtonStyleMode.TEXTUAL
202   * @syscap SystemCapability.ArkUI.ArkUI.Full
203   * @crossplatform
204   * @atomicservice
205   * @since 18
206   */
207  buttonStyle?: ButtonStyleMode;
208  /**
209   * Describes the Button role.
210   *
211   * @type { ?ButtonRole }
212   * @default ButtonRole.NORMAL
213   * @syscap SystemCapability.ArkUI.ArkUI.Full
214   * @crossplatform
215   * @atomicservice
216   * @since 18
217   */
218  role?: ButtonRole;
219  /**
220   * Set the default focus of a button.
221   *
222   * @type { ?boolean }
223   * @default { false }
224   * @syscap SystemCapability.ArkUI.ArkUI.Full
225   * @crossplatform
226   * @atomicservice
227   * @since 18
228   */
229  defaultFocus?: boolean;
230  /**
231   * Set the availability of the button.
232   *
233   * @type { ?boolean }
234   * @default { true }
235   * @syscap SystemCapability.ArkUI.ArkUI.Full
236   * @crossplatform
237   * @atomicservice
238   * @since 18
239   */
240  enabled?: boolean;
241}
242
243/**
244 * Declare the callback when the checkbox of dialog is changed.
245 *
246 * @typedef { function } AdvancedDialogV2OnCheckedChange
247 * @param { boolean } checked - Checkbox status.
248 * @syscap SystemCapability.ArkUI.ArkUI.Full
249 * @crossplatform
250 * @atomicservice
251 * @since 18
252 */
253export declare type AdvancedDialogV2OnCheckedChange = (checked: boolean) => void;
254
255/**
256 * Declare CustomDialog TipsDialogV2
257 *
258 * @struct { TipsDialogV2 }
259 * @syscap SystemCapability.ArkUI.ArkUI.Full
260 * @crossplatform
261 * @atomicservice
262 * @since 18
263 */
264@ComponentV2
265export declare struct TipsDialogV2 {
266  /**
267   * Sets the TipsDialogV2 imageRes.
268   *
269   * @type { ResourceStr | PixelMap }
270   * @syscap SystemCapability.ArkUI.ArkUI.Full
271   * @crossplatform
272   * @atomicservice
273   * @since 18
274   */
275  @Require
276  @Param
277  imageRes: ResourceStr | PixelMap;
278  /**
279   * Sets the TipsDialogV2 image size.
280   *
281   * @type { ?SizeOptions }.
282   * @syscap SystemCapability.ArkUI.ArkUI.Full
283   * @crossplatform
284   * @atomicservice
285   * @since 18
286   */
287  @Param
288  imageSize?: SizeOptions;
289  /**
290   * Sets the borderColor of TipsDialogV2 image.
291   *
292   * @type { ?ColorMetrics }.
293   * @syscap SystemCapability.ArkUI.ArkUI.Full
294   * @crossplatform
295   * @atomicservice
296   * @since 18
297   */
298  @Param
299  imageBorderColor?: ColorMetrics;
300  /**
301   * Sets the borderWidth of TipsDialogV2 image.
302   *
303   * @type { ?LengthMetrics }.
304   * @syscap SystemCapability.ArkUI.ArkUI.Full
305   * @crossplatform
306   * @atomicservice
307   * @since 18
308   */
309  @Param
310  imageBorderWidth?: LengthMetrics;
311  /**
312   * Sets the TipsDialogV2 title.
313   *
314   * @type { ?ResourceStr }.
315   * @syscap SystemCapability.ArkUI.ArkUI.Full
316   * @crossplatform
317   * @atomicservice
318   * @since 18
319   */
320  @Param
321  title?: ResourceStr;
322  /**
323   * Sets the TipsDialogV2 content.
324   *
325   * @type { ?ResourceStr }.
326   * @syscap SystemCapability.ArkUI.ArkUI.Full
327   * @crossplatform
328   * @atomicservice
329   * @since 18
330   */
331  @Param
332  content?: ResourceStr;
333  /**
334   * Sets the TipsDialogV2 checkbox tips.
335   *
336   * @type { ?ResourceStr }.
337   * @syscap SystemCapability.ArkUI.ArkUI.Full
338   * @crossplatform
339   * @atomicservice
340   * @since 18
341   */
342  @Param
343  checkTips?: ResourceStr;
344  /**
345   * Sets the TipsDialogV2 checkbox check state.
346   *
347   * @type { ?boolean }.
348   * @syscap SystemCapability.ArkUI.ArkUI.Full
349   * @crossplatform
350   * @atomicservice
351   * @since 18
352   */
353  @Param
354  checked?: boolean;
355  /**
356   * Sets the TipsDialogV2 primary button.
357   *
358   * @type { ?AdvancedDialogV2Button }.
359   * @syscap SystemCapability.ArkUI.ArkUI.Full
360   * @crossplatform
361   * @atomicservice
362   * @since 18
363   */
364  @Param
365  primaryButton?: AdvancedDialogV2Button;
366  /**
367   * Sets the TipsDialogV2 secondary button.
368   *
369   * @type { ?AdvancedDialogV2Button }.
370   * @syscap SystemCapability.ArkUI.ArkUI.Full
371   * @crossplatform
372   * @atomicservice
373   * @since 18
374   */
375  @Param
376  secondaryButton?: AdvancedDialogV2Button;
377  /**
378   * Sets the TipsDialogV2 CheckBox Callback.
379   * @type { ?AdvancedDialogV2OnCheckedChange }
380   * @syscap SystemCapability.ArkUI.ArkUI.Full
381   * @crossplatform
382   * @atomicservice
383   * @since 18
384   */
385  @Param
386  onCheckedChange?: AdvancedDialogV2OnCheckedChange;
387}
388
389/**
390 * Declare CustomDialog SelectDialogV2
391 *
392 * @struct { SelectDialogV2 }
393 * @syscap SystemCapability.ArkUI.ArkUI.Full
394 * @crossplatform
395 * @atomicservice
396 * @since 18
397 */
398@ComponentV2
399export declare struct SelectDialogV2 {
400  /**
401   * Sets the SelectDialogV2 title.
402   *
403   * @type { ResourceStr }.
404   * @syscap SystemCapability.ArkUI.ArkUI.Full
405   * @crossplatform
406   * @atomicservice
407   * @since 18
408   */
409  @Require
410  @Param
411  title: ResourceStr;
412  /**
413   * Sets the SelectDialogV2 content.
414   *
415   * @type { ?ResourceStr }.
416   * @syscap SystemCapability.ArkUI.ArkUI.Full
417   * @crossplatform
418   * @atomicservice
419   * @since 18
420   */
421  @Param
422  content?: ResourceStr;
423  /**
424   * Sets the SelectDialogV2 selected index.
425   *
426   * @type { ?number }.
427   * @syscap SystemCapability.ArkUI.ArkUI.Full
428   * @crossplatform
429   * @atomicservice
430   * @since 18
431   */
432  @Param
433  selectedIndex?: number;
434  /**
435   * Sets the SelectDialogV2 confirm button.
436   *
437   * @type { ?AdvancedDialogV2Button }.
438   * @syscap SystemCapability.ArkUI.ArkUI.Full
439   * @crossplatform
440   * @atomicservice
441   * @since 18
442   */
443  @Param
444  confirm?: AdvancedDialogV2Button;
445  /**
446   * Sets the SelectDialog sheets.
447   * @type { SheetInfo[] }.
448   * @syscap SystemCapability.ArkUI.ArkUI.Full
449   * @crossplatform
450   * @atomicservice
451   * @since 18
452   */
453  @Require
454  @Param
455  radioContent: SheetInfo[];
456}
457
458/**
459 * Declare CustomDialog ConfirmDialogV2
460 *
461 * @struct { ConfirmDialogV2 }
462 * @syscap SystemCapability.ArkUI.ArkUI.Full
463 * @crossplatform
464 * @atomicservice
465 * @since 18
466 */
467@ComponentV2
468export declare struct ConfirmDialogV2 {
469  /**
470   * Sets the ConfirmDialogV2 title.
471   *
472   * @type { ResourceStr }.
473   * @syscap SystemCapability.ArkUI.ArkUI.Full
474   * @crossplatform
475   * @atomicservice
476   * @since 18
477   */
478  @Require
479  @Param
480  title: ResourceStr;
481  /**
482   * Sets the ConfirmDialogV2 content.
483   *
484   * @type { ?ResourceStr }.
485   * @syscap SystemCapability.ArkUI.ArkUI.Full
486   * @crossplatform
487   * @atomicservice
488   * @since 18
489   */
490  @Param
491  content?: ResourceStr;
492  /**
493   * Sets the ConfirmDialogV2 checkbox tips.
494   *
495   * @type { ?ResourceStr }.
496   * @syscap SystemCapability.ArkUI.ArkUI.Full
497   * @crossplatform
498   * @atomicservice
499   * @since 18
500   */
501  @Param
502  checkTips?: ResourceStr;
503  /**
504   * Sets the ConfirmDialogV2 checkbox state.
505   *
506   * @type { ?boolean }.
507   * @syscap SystemCapability.ArkUI.ArkUI.Full
508   * @crossplatform
509   * @atomicservice
510   * @since 18
511   */
512  @Param
513  checked?: boolean;
514  /**
515   * Sets the ConfirmDialogV2 primary button.
516   *
517   * @type { ?AdvancedDialogV2Button }.
518   * @syscap SystemCapability.ArkUI.ArkUI.Full
519   * @crossplatform
520   * @atomicservice
521   * @since 18
522   */
523  @Param
524  primaryButton?: AdvancedDialogV2Button;
525  /**
526   * Sets the ConfirmDialogV2 secondary button.
527   *
528   * @type { ?AdvancedDialogV2Button }.
529   * @syscap SystemCapability.ArkUI.ArkUI.Full
530   * @crossplatform
531   * @atomicservice
532   * @since 18
533   */
534  @Param
535  secondaryButton?: AdvancedDialogV2Button;
536  /**
537   * Sets the ConfirmDialogV2 CheckBox Callback.
538   *
539   * @type { ?AdvancedDialogV2OnCheckedChange }
540   * @syscap SystemCapability.ArkUI.ArkUI.Full
541   * @crossplatform
542   * @atomicservice
543   * @since 18
544   */
545  @Param
546  onCheckedChange?: AdvancedDialogV2OnCheckedChange;
547}
548
549/**
550 * Declare CustomDialog AlertDialogV2.
551 *
552 * @struct { AlertDialogV2 }
553 * @syscap SystemCapability.ArkUI.ArkUI.Full
554 * @crossplatform
555 * @atomicservice
556 * @since 18
557 */
558@ComponentV2
559export declare struct AlertDialogV2 {
560  /**
561   * Sets the AlertDialogV2 title.
562   *
563   * @type { ?ResourceStr }
564   * @syscap SystemCapability.ArkUI.ArkUI.Full
565   * @crossplatform
566   * @atomicservice
567   * @since 18
568   */
569  @Param
570  primaryTitle?: ResourceStr;
571  /**
572   * Sets the AlertDialogV2 secondary title.
573   *
574   * @type { ?ResourceStr }
575   * @syscap SystemCapability.ArkUI.ArkUI.Full
576   * @crossplatform
577   * @atomicservice
578   * @since 18
579   */
580  @Param
581  secondaryTitle?: ResourceStr;
582  /**
583   * Sets the AlertDialogV2 content.
584   *
585   * @type { ResourceStr }.
586   * @syscap SystemCapability.ArkUI.ArkUI.Full
587   * @crossplatform
588   * @atomicservice
589   * @since 18
590   */
591  @Require
592  @Param
593  content: ResourceStr;
594  /**
595   * Sets the AlertDialogV2 primary button.
596   *
597   * @type { ?AdvancedDialogV2Button }.
598   * @syscap SystemCapability.ArkUI.ArkUI.Full
599   * @crossplatform
600   * @atomicservice
601   * @since 18
602   */
603  @Param
604  primaryButton?: AdvancedDialogV2Button;
605  /**
606   * Sets the AlertDialogV2 secondary button.
607   *
608   * @type { ?AdvancedDialogV2Button }.
609   * @syscap SystemCapability.ArkUI.ArkUI.Full
610   * @crossplatform
611   * @atomicservice
612   * @since 18
613   */
614  @Param
615  secondaryButton?: AdvancedDialogV2Button;
616}
617
618/**
619 * Declare CustomDialog LoadingDialogV2
620 *
621 * @struct { LoadingDialogV2 }
622 * @syscap SystemCapability.ArkUI.ArkUI.Full
623 * @crossplatform
624 * @atomicservice
625 * @since 18
626 */
627@ComponentV2
628export declare struct LoadingDialogV2 {
629  /**
630   * Sets the LoadingDialogV2 content.
631   *
632   * @type { ?ResourceStr }.
633   * @syscap SystemCapability.ArkUI.ArkUI.Full
634   * @crossplatform
635   * @atomicservice
636   * @since 18
637   */
638  @Param
639  content?: ResourceStr;
640}
641
642/**
643 * Declare custom content dialog
644 *
645 * @struct { CustomContentDialogV2 }
646 * @syscap SystemCapability.ArkUI.ArkUI.Full
647 * @crossplatform
648 * @atomicservice
649 * @since 18
650 */
651@ComponentV2
652export declare struct CustomContentDialogV2 {
653  /**
654   * Sets the CustomContentDialogV2 title.
655   *
656   * @type { ?ResourceStr }
657   * @syscap SystemCapability.ArkUI.ArkUI.Full
658   * @crossplatform
659   * @atomicservice
660   * @since 18
661   */
662  @Param
663  primaryTitle?: ResourceStr;
664  /**
665   * Sets the CustomContentDialogV2 secondary title.
666   *
667   * @type { ?ResourceStr }
668   * @syscap SystemCapability.ArkUI.ArkUI.Full
669   * @crossplatform
670   * @atomicservice
671   * @since 18
672   */
673  @Param
674  secondaryTitle?: ResourceStr;
675  /**
676   * Sets the CustomContentDialogV2 content.
677   *
678   * @type { CustomBuilder }
679   * @syscap SystemCapability.ArkUI.ArkUI.Full
680   * @crossplatform
681   * @atomicservice
682   * @since 18
683   */
684  @BuilderParam
685  contentBuilder: CustomBuilder;
686  /**
687   * Sets the CustomContentDialogV2 content area padding.
688   *
689   * @type { ?LocalizedPadding }
690   * @syscap SystemCapability.ArkUI.ArkUI.Full
691   * @crossplatform
692   * @atomicservice
693   * @since 18
694   */
695  @Param
696  contentAreaPadding?: LocalizedPadding;
697  /**
698   * Sets the CustomContentDialogV2 buttons.
699   * @type { ?AdvancedDialogV2Button[] }
700   * @syscap SystemCapability.ArkUI.ArkUI.Full
701   * @crossplatform
702   * @atomicservice
703   * @since 18
704   */
705  @Param
706  buttons?: AdvancedDialogV2Button[];
707}
708
709/**
710 * Declare struct PopoverDialogV2
711 *
712 * @struct { PopoverDialogV2 }
713 * @syscap SystemCapability.ArkUI.ArkUI.Full
714 * @crossplatform
715 * @atomicservice
716 * @since 18
717 */
718@ComponentV2
719export declare struct PopoverDialogV2 {
720  /**
721   * Sets the PopoverDialogV2 Visible Status.
722   *
723   * @type { boolean }
724   * @syscap SystemCapability.ArkUI.ArkUI.Full
725   * @crossplatform
726   * @atomicservice
727   * @since 18
728   */
729  @Require
730  @Param
731  visible: boolean;
732  /**
733   * Sets the callback when visibility changed.
734   *
735   * @type { ?PopoverDialogV2OnVisibleChange }
736   * @syscap SystemCapability.ArkUI.ArkUI.Full
737   * @crossplatform
738   * @atomicservice
739   * @since 18
740   */
741  @Event
742  $visible?: PopoverDialogV2OnVisibleChange;
743  /**
744   * Sets the PopoverDialogV2 options.
745   *
746   * @type { PopoverDialogV2Options }
747   * @syscap SystemCapability.ArkUI.ArkUI.Full
748   * @crossplatform
749   * @atomicservice
750   * @since 18
751   */
752  @Require
753  @Param
754  popover: PopoverDialogV2Options;
755  /**
756   * Sets the targetBuilder content.
757   *
758   * @type { CustomBuilder }
759   * @syscap SystemCapability.ArkUI.ArkUI.Full
760   * @crossplatform
761   * @atomicservice
762   * @since 18
763   */
764  @BuilderParam
765  targetBuilder: CustomBuilder;
766}
767
768/**
769 * Declare the callback when the visibility of PopoverDialogV2 is changed.
770 *
771 * @typedef { function } PopoverDialogV2OnVisibleChange
772 * @param { boolean } visible - The visibility of PopoverDialogV2.
773 * @syscap SystemCapability.ArkUI.ArkUI.Full
774 * @crossplatform
775 * @atomicservice
776 * @since 18
777 */
778export declare type PopoverDialogV2OnVisibleChange = (visible: boolean) => void;
779
780/**
781 * Defines PopoverDialogV2 Options
782 *
783 * @interface PopoverDialogV2Options
784 * @extends CustomPopupOptions
785 * @syscap SystemCapability.ArkUI.ArkUI.Full
786 * @crossplatform
787 * @atomicservice
788 * @since 18
789 */
790export declare interface PopoverDialogV2Options extends CustomPopupOptions {
791}
792