• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2023 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 * Defines the options of CustomDialogController.
18 *
19 * @interface CustomDialogControllerOptions
20 * @syscap SystemCapability.ArkUI.ArkUI.Full
21 * @since 7
22 */
23/**
24 * Defines the options of CustomDialogController.
25 *
26 * @interface CustomDialogControllerOptions
27 * @syscap SystemCapability.ArkUI.ArkUI.Full
28 * @crossplatform
29 * @since 10
30 */
31/**
32 * Defines the options of CustomDialogController.
33 *
34 * @interface CustomDialogControllerOptions
35 * @syscap SystemCapability.ArkUI.ArkUI.Full
36 * @crossplatform
37 * @atomicservice
38 * @since 11
39 */
40declare interface CustomDialogControllerOptions {
41  /**
42   * Custom builder function.
43   *
44   * @type { any }
45   * @syscap SystemCapability.ArkUI.ArkUI.Full
46   * @since 7
47   */
48  /**
49   * Custom builder function.
50   *
51   * @type { any }
52   * @syscap SystemCapability.ArkUI.ArkUI.Full
53   * @crossplatform
54   * @since 10
55   */
56  /**
57   * Custom builder function.
58   *
59   * @type { any }
60   * @syscap SystemCapability.ArkUI.ArkUI.Full
61   * @crossplatform
62   * @atomicservice
63   * @since 11
64   */
65  builder: any;
66
67  /**
68   * Defines the cancel function.
69   *
70   * @type { ?function }
71   * @syscap SystemCapability.ArkUI.ArkUI.Full
72   * @since 7
73   */
74  /**
75   * Defines the cancel function.
76   *
77   * @type { ?function }
78   * @syscap SystemCapability.ArkUI.ArkUI.Full
79   * @crossplatform
80   * @since 10
81   */
82  /**
83   * Defines the cancel function.
84   *
85   * @type { ?function }
86   * @syscap SystemCapability.ArkUI.ArkUI.Full
87   * @crossplatform
88   * @atomicservice
89   * @since 11
90   */
91  cancel?: () => void;
92
93  /**
94   * Defines if use auto cancel when click on the outside of the dialog.
95   *
96   * @type { ?boolean }
97   * @syscap SystemCapability.ArkUI.ArkUI.Full
98   * @since 7
99   */
100  /**
101   * Defines if use auto cancel when click on the outside of the dialog.
102   *
103   * @type { ?boolean }
104   * @syscap SystemCapability.ArkUI.ArkUI.Full
105   * @crossplatform
106   * @since 10
107   */
108  /**
109   * Defines if use auto cancel when click on the outside of the dialog.
110   *
111   * @type { ?boolean }
112   * @syscap SystemCapability.ArkUI.ArkUI.Full
113   * @crossplatform
114   * @atomicservice
115   * @since 11
116   */
117  autoCancel?: boolean;
118
119  /**
120   * Defines the dialog alignment of the screen.
121   *
122   * @type { ?DialogAlignment }
123   * @syscap SystemCapability.ArkUI.ArkUI.Full
124   * @since 7
125   */
126  /**
127   * Defines the dialog alignment of the screen.
128   *
129   * @type { ?DialogAlignment }
130   * @syscap SystemCapability.ArkUI.ArkUI.Full
131   * @crossplatform
132   * @since 10
133   */
134  /**
135   * Defines the dialog alignment of the screen.
136   *
137   * @type { ?DialogAlignment }
138   * @syscap SystemCapability.ArkUI.ArkUI.Full
139   * @crossplatform
140   * @atomicservice
141   * @since 11
142   */
143  alignment?: DialogAlignment;
144
145  /**
146   * Defines the dialog offset.
147   *
148   * @type { ?Offset }
149   * @syscap SystemCapability.ArkUI.ArkUI.Full
150   * @since 7
151   */
152  /**
153   * Defines the dialog offset.
154   *
155   * @type { ?Offset }
156   * @syscap SystemCapability.ArkUI.ArkUI.Full
157   * @crossplatform
158   * @since 10
159   */
160  /**
161   * Defines the dialog offset.
162   *
163   * @type { ?Offset }
164   * @syscap SystemCapability.ArkUI.ArkUI.Full
165   * @crossplatform
166   * @atomicservice
167   * @since 11
168   */
169  offset?: Offset;
170
171  /**
172   * Defines if use custom style.
173   *
174   * @type { ?boolean }
175   * @syscap SystemCapability.ArkUI.ArkUI.Full
176   * @since 7
177   */
178  /**
179   * Defines if use custom style.
180   *
181   * @type { ?boolean }
182   * @syscap SystemCapability.ArkUI.ArkUI.Full
183   * @crossplatform
184   * @since 10
185   */
186  /**
187   * Defines if use custom style.
188   *
189   * @type { ?boolean }
190   * @syscap SystemCapability.ArkUI.ArkUI.Full
191   * @crossplatform
192   * @atomicservice
193   * @since 11
194   */
195  customStyle?: boolean;
196
197  /**
198   * Grid count of dialog.
199   *
200   * @type { ?number }
201   * @syscap SystemCapability.ArkUI.ArkUI.Full
202   * @since 8
203   */
204  /**
205   * Grid count of dialog.
206   *
207   * @type { ?number }
208   * @syscap SystemCapability.ArkUI.ArkUI.Full
209   * @crossplatform
210   * @since 10
211   */
212  /**
213   * Grid count of dialog.
214   *
215   * @type { ?number }
216   * @syscap SystemCapability.ArkUI.ArkUI.Full
217   * @crossplatform
218   * @atomicservice
219   * @since 11
220   */
221  gridCount?: number;
222
223  /**
224   * Mask color of dialog.
225   *
226   * @type { ?ResourceColor }
227   * @syscap SystemCapability.ArkUI.ArkUI.Full
228   * @crossplatform
229   * @since 10
230   */
231  /**
232   * Mask color of dialog.
233   *
234   * @type { ?ResourceColor }
235   * @syscap SystemCapability.ArkUI.ArkUI.Full
236   * @crossplatform
237   * @atomicservice
238   * @since 11
239   */
240  maskColor?: ResourceColor;
241
242  /**
243   * Mask Region of dialog. The size cannot exceed the main window.
244   *
245   * @type { ?Rectangle }
246   * @syscap SystemCapability.ArkUI.ArkUI.Full
247   * @crossplatform
248   * @since 10
249   */
250  /**
251   * Mask Region of dialog. The size cannot exceed the main window.
252   *
253   * @type { ?Rectangle }
254   * @syscap SystemCapability.ArkUI.ArkUI.Full
255   * @crossplatform
256   * @atomicservice
257   * @since 11
258   */
259  maskRect?: Rectangle;
260
261  /**
262   * Animation parameters of dialog opening.
263   *
264   * @type { ?AnimateParam }
265   * @syscap SystemCapability.ArkUI.ArkUI.Full
266   * @crossplatform
267   * @since 10
268   */
269  /**
270   * Animation parameters of dialog opening.
271   *
272   * @type { ?AnimateParam }
273   * @syscap SystemCapability.ArkUI.ArkUI.Full
274   * @crossplatform
275   * @atomicservice
276   * @since 11
277   */
278  openAnimation?: AnimateParam;
279
280  /**
281   * Animation parameters of dialog closing.
282   *
283   * @type { ?AnimateParam }
284   * @syscap SystemCapability.ArkUI.ArkUI.Full
285   * @crossplatform
286   * @since 10
287   */
288  /**
289   * Animation parameters of dialog closing.
290   *
291   * @type { ?AnimateParam }
292   * @syscap SystemCapability.ArkUI.ArkUI.Full
293   * @crossplatform
294   * @atomicservice
295   * @since 11
296   */
297  closeAnimation?: AnimateParam;
298
299  /**
300   * Whether to display in the sub window.
301   *
302   * @type { ?boolean }
303   * @syscap SystemCapability.ArkUI.ArkUI.Full
304   * @crossplatform
305   * @since 10
306   */
307  /**
308   * Whether to display in the sub window.
309   *
310   * @type { ?boolean }
311   * @default false
312   * @syscap SystemCapability.ArkUI.ArkUI.Full
313   * @crossplatform
314   * @atomicservice
315   * @since 11
316   */
317  showInSubWindow?: boolean;
318
319  /**
320   * Background color of dialog.
321   *
322   * @type { ?ResourceColor }
323   * @syscap SystemCapability.ArkUI.ArkUI.Full
324   * @crossplatform
325   * @since 10
326   */
327  /**
328   * Background color of dialog.
329   *
330   * @type { ?ResourceColor }
331   * @syscap SystemCapability.ArkUI.ArkUI.Full
332   * @crossplatform
333   * @atomicservice
334   * @since 11
335   */
336  backgroundColor?: ResourceColor;
337
338  /**
339   * Corner radius of dialog.
340   *
341   * @type { ?(Dimension | BorderRadiuses) }
342   * @syscap SystemCapability.ArkUI.ArkUI.Full
343   * @crossplatform
344   * @since 10
345   */
346  /**
347   * Corner radius of dialog.
348   *
349   * @type { ?(Dimension | BorderRadiuses) }
350   * @syscap SystemCapability.ArkUI.ArkUI.Full
351   * @crossplatform
352   * @atomicservice
353   * @since 11
354   */
355  cornerRadius?: Dimension | BorderRadiuses;
356
357  /**
358   * Whether it is a modal dialog
359   * @type { ?boolean }
360   * @default true
361   * @syscap SystemCapability.ArkUI.ArkUI.Full
362   * @crossplatform
363   * @since 11
364   */
365  isModal?: boolean;
366}
367
368/**
369 * Use the CustomDialogController class to display the custom pop-up window.
370 *
371 * @syscap SystemCapability.ArkUI.ArkUI.Full
372 * @since 7
373 */
374/**
375 * Use the CustomDialogController class to display the custom pop-up window.
376 *
377 * @syscap SystemCapability.ArkUI.ArkUI.Full
378 * @crossplatform
379 * @since 10
380 */
381/**
382 * Use the CustomDialogController class to display the custom pop-up window.
383 *
384 * @syscap SystemCapability.ArkUI.ArkUI.Full
385 * @crossplatform
386 * @atomicservice
387 * @since 11
388 */
389declare class CustomDialogController {
390  /**
391   * The constructor transfers parameter settings.
392   *
393   * @param { CustomDialogControllerOptions } value
394   * @syscap SystemCapability.ArkUI.ArkUI.Full
395   * @since 7
396   */
397  /**
398   * The constructor transfers parameter settings.
399   *
400   * @param { CustomDialogControllerOptions } value
401   * @syscap SystemCapability.ArkUI.ArkUI.Full
402   * @crossplatform
403   * @since 10
404   */
405  /**
406   * The constructor transfers parameter settings.
407   *
408   * @param { CustomDialogControllerOptions } value
409   * @syscap SystemCapability.ArkUI.ArkUI.Full
410   * @crossplatform
411   * @atomicservice
412   * @since 11
413   */
414  constructor(value: CustomDialogControllerOptions);
415
416  /**
417   * Display the content of the customized pop-up window. If the content has been displayed, it does not take effect.
418   *
419   * @syscap SystemCapability.ArkUI.ArkUI.Full
420   * @since 7
421   */
422  /**
423   * Display the content of the customized pop-up window. If the content has been displayed, it does not take effect.
424   *
425   * @syscap SystemCapability.ArkUI.ArkUI.Full
426   * @crossplatform
427   * @since 10
428   */
429  /**
430   * Display the content of the customized pop-up window. If the content has been displayed, it does not take effect.
431   *
432   * @syscap SystemCapability.ArkUI.ArkUI.Full
433   * @crossplatform
434   * @atomicservice
435   * @since 11
436   */
437  open();
438
439  /**
440   * Closes the custom pop-up window. If the window is closed, the window does not take effect.
441   *
442   * @syscap SystemCapability.ArkUI.ArkUI.Full
443   * @since 7
444   */
445  /**
446   * Closes the custom pop-up window. If the window is closed, the window does not take effect.
447   *
448   * @syscap SystemCapability.ArkUI.ArkUI.Full
449   * @crossplatform
450   * @since 10
451   */
452  /**
453   * Closes the custom pop-up window. If the window is closed, the window does not take effect.
454   *
455   * @syscap SystemCapability.ArkUI.ArkUI.Full
456   * @crossplatform
457   * @atomicservice
458   * @since 11
459   */
460  close();
461}
462