arkui_sys/native_dialog/native_dialog_ffi.rs
1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6#[cfg(feature = "api-19")]
7use crate::native_node::ArkUI_AttributeItem;
8use crate::native_type::*;
9
10#[cfg(feature = "api-12")]
11#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
12impl ArkUI_DismissReason {
13 /// Touching the system-defined Back button or pressing the Esc key.
14 pub const DIALOG_DISMISS_BACK_PRESS: ArkUI_DismissReason = ArkUI_DismissReason(0);
15 /// Touching the mask.
16 pub const DIALOG_DISMISS_TOUCH_OUTSIDE: ArkUI_DismissReason = ArkUI_DismissReason(1);
17 /// Touching the Close button.
18 pub const DIALOG_DISMISS_CLOSE_BUTTON: ArkUI_DismissReason = ArkUI_DismissReason(2);
19 /// Sliding down.
20 pub const DIALOG_DISMISS_SLIDE_DOWN: ArkUI_DismissReason = ArkUI_DismissReason(3);
21}
22#[repr(transparent)]
23/// Enumerates the actions for triggering closure of the dialog box.
24///
25///
26/// Available since API-level: 12
27#[cfg(feature = "api-12")]
28#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
29#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
30pub struct ArkUI_DismissReason(pub ::core::ffi::c_uint);
31#[cfg(feature = "api-20")]
32#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
33impl ArkUI_DialogState {
34 /// Uninitialized.
35 ///
36 /// Required System Capabilities: SystemCapability.ArkUI.ArkUI.Full
37 ///
38 /// Available since API-level: 20
39 #[cfg(feature = "api-20")]
40 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
41 pub const DIALOG_UNINITIALIZED: ArkUI_DialogState = ArkUI_DialogState(0);
42 /// Initialized.
43 ///
44 /// Required System Capabilities: SystemCapability.ArkUI.ArkUI.Full
45 ///
46 /// Available since API-level: 20
47 #[cfg(feature = "api-20")]
48 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
49 pub const DIALOG_INITIALIZED: ArkUI_DialogState = ArkUI_DialogState(1);
50 /// Appearing.
51 ///
52 /// Required System Capabilities: SystemCapability.ArkUI.ArkUI.Full
53 ///
54 /// Available since API-level: 20
55 #[cfg(feature = "api-20")]
56 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
57 pub const DIALOG_APPEARING: ArkUI_DialogState = ArkUI_DialogState(2);
58 /// Appeared.
59 ///
60 /// Required System Capabilities: SystemCapability.ArkUI.ArkUI.Full
61 ///
62 /// Available since API-level: 20
63 #[cfg(feature = "api-20")]
64 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
65 pub const DIALOG_APPEARED: ArkUI_DialogState = ArkUI_DialogState(3);
66 /// Disappearing.
67 ///
68 /// Required System Capabilities: SystemCapability.ArkUI.ArkUI.Full
69 ///
70 /// Available since API-level: 20
71 #[cfg(feature = "api-20")]
72 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
73 pub const DIALOG_DISAPPEARING: ArkUI_DialogState = ArkUI_DialogState(4);
74 /// Disappeared.
75 ///
76 /// Required System Capabilities: SystemCapability.ArkUI.ArkUI.Full
77 ///
78 /// Available since API-level: 20
79 #[cfg(feature = "api-20")]
80 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
81 pub const DIALOG_DISAPPEARED: ArkUI_DialogState = ArkUI_DialogState(5);
82}
83#[repr(transparent)]
84/// Enumerates the state of dialog.
85///
86///
87/// Required System Capabilities: SystemCapability.ArkUI.ArkUI.Full
88///
89///
90/// Available since API-level: 20
91#[cfg(feature = "api-20")]
92#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
93#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
94pub struct ArkUI_DialogState(pub ::core::ffi::c_uint);
95#[cfg(feature = "api-15")]
96#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
97impl ArkUI_LevelMode {
98 /// overlay mode.
99 pub const ARKUI_LEVEL_MODE_OVERLAY: ArkUI_LevelMode = ArkUI_LevelMode(0);
100 /// embedded mode.
101 pub const ARKUI_LEVEL_MODE_EMBEDDED: ArkUI_LevelMode = ArkUI_LevelMode(1);
102}
103#[repr(transparent)]
104/// Enumerates the level mode.
105///
106///
107/// Available since API-level: 15
108#[cfg(feature = "api-15")]
109#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
110#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
111pub struct ArkUI_LevelMode(pub ::core::ffi::c_uint);
112#[cfg(feature = "api-15")]
113#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
114impl ArkUI_ImmersiveMode {
115 /// Mask covering the parent node area.
116 pub const ARKUI_IMMERSIVE_MODE_DEFAULT: ArkUI_ImmersiveMode = ArkUI_ImmersiveMode(0);
117 /// Mask extend safe area includes status bar and navigation bar.
118 pub const ARKUI_IMMERSIVE_MODE_EXTEND: ArkUI_ImmersiveMode = ArkUI_ImmersiveMode(1);
119}
120#[repr(transparent)]
121/// Enumerates the immersive mode.
122///
123///
124/// Available since API-level: 15
125#[cfg(feature = "api-15")]
126#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
127#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
128pub struct ArkUI_ImmersiveMode(pub ::core::ffi::c_uint);
129/// Invoked when the dialog box is closed.
130///
131///
132/// Available since API-level: 12
133#[cfg(feature = "api-12")]
134#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
135pub type ArkUI_OnWillDismissEvent =
136 ::core::option::Option<unsafe extern "C" fn(reason: i32) -> bool>;
137/// Defines a struct for a dialog box dismiss event.
138///
139///
140/// Available since API-level: 12
141#[cfg(feature = "api-12")]
142#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
143#[repr(C)]
144pub struct ArkUI_DialogDismissEvent {
145 _unused: [u8; 0],
146}
147/// Defines a struct for the content object of a custom dialog box.
148///
149///
150/// Available since API-level: 19
151#[cfg(feature = "api-19")]
152#[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
153#[repr(C)]
154pub struct ArkUI_CustomDialogOptions {
155 _unused: [u8; 0],
156}
157/// Provides the custom dialog box APIs for the native side.
158///
159///
160/// Version: 1
161///
162/// Available since API-level: 12
163#[cfg(feature = "api-12")]
164#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
165#[repr(C)]
166pub struct ArkUI_NativeDialogAPI_1 {
167 /// Creates a custom dialog box and returns the pointer to the created dialog box.
168 ///
169 ///
170 /// **Note:** This method must be called before the <b>show</b> method.
171 ///
172 /// # Returns
173 ///
174 /// * Returns the pointer to the created custom dialog box; returns a null pointer if the creation fails.
175 pub create: ::core::option::Option<unsafe extern "C" fn() -> ArkUI_NativeDialogHandle>,
176 /// Destroys a custom dialog box.
177 ///
178 /// # Arguments
179 ///
180 /// * `handle` - Indicates the pointer to the custom dialog box controller.
181 pub dispose: ::core::option::Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle)>,
182 /// Attaches the content of a custom dialog box.
183 ///
184 ///
185 /// **Note:** This method must be called before the <b>show</b> method.
186 /// # Arguments
187 ///
188 /// * `handle` - Indicates the pointer to the custom dialog box controller.
189 ///
190 /// * `content` - Indicates the pointer to the root node of the custom dialog box content.
191 ///
192 /// # Returns
193 ///
194 /// * Returns the error code.
195 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
196 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
197 pub setContent: ::core::option::Option<
198 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, content: ArkUI_NodeHandle) -> i32,
199 >,
200 /// Detaches the content of a custom dialog box.
201 ///
202 ///
203 /// **Note:** This method must be called before the <b>show</b> method.
204 /// # Arguments
205 ///
206 /// * `handle` - Indicates the pointer to the custom dialog box controller.
207 ///
208 /// # Returns
209 ///
210 /// * Returns the error code.
211 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
212 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
213 pub removeContent:
214 ::core::option::Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle) -> i32>,
215 /// Sets the alignment mode for a custom dialog box.
216 ///
217 ///
218 /// **Note:** This method must be called before the <b>show</b> method.
219 /// # Arguments
220 ///
221 /// * `handle` - Indicates the pointer to the custom dialog box controller.
222 ///
223 /// * `alignment` - Indicates the alignment mode. The parameter type is [`ArkUI_Alignment`].
224 ///
225 /// * `offsetX` - Indicates the horizontal offset of the custom dialog box. The value is a floating point number.
226 ///
227 /// * `offsetY` - Indicates the vertical offset of the custom dialog box. The value is a floating point number.
228 ///
229 /// # Returns
230 ///
231 /// * Returns the error code.
232 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
233 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
234 pub setContentAlignment: ::core::option::Option<
235 unsafe extern "C" fn(
236 handle: ArkUI_NativeDialogHandle,
237 alignment: i32,
238 offsetX: f32,
239 offsetY: f32,
240 ) -> i32,
241 >,
242 /// Resets the alignment mode of a custom dialog box to its default settings.
243 ///
244 ///
245 /// **Note:** This method must be called before the <b>show</b> method.
246 /// # Arguments
247 ///
248 /// * `handle` - Indicates the pointer to the custom dialog box controller.
249 ///
250 /// # Returns
251 ///
252 /// * Returns the error code.
253 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
254 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
255 pub resetContentAlignment:
256 ::core::option::Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle) -> i32>,
257 /// Sets the modal mode for a custom dialog box.
258 ///
259 ///
260 /// **Note:** This method must be called before the <b>show</b> method.
261 /// # Arguments
262 ///
263 /// * `handle` - Indicates the pointer to the custom dialog box controller.
264 ///
265 /// * `isModal` - Specifies whether the custom dialog box is a modal, which has a mask applied. The value
266 /// <b>true</b> means that the custom dialog box is a modal, and <b>false</b> means the opposite.
267 ///
268 /// # Returns
269 ///
270 /// * Returns the error code.
271 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
272 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
273 pub setModalMode: ::core::option::Option<
274 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, isModal: bool) -> i32,
275 >,
276 /// Specifies whether to allow users to touch the mask to dismiss the custom dialog box.
277 ///
278 ///
279 /// **Note:** This method must be called before the <b>show</b> method.
280 /// # Arguments
281 ///
282 /// * `handle` - Indicates the pointer to the custom dialog box controller.
283 ///
284 /// * `autoCancel` - Specifies whether to allow users to touch the mask to dismiss the dialog box.
285 /// The value <b>true</b> means to allow users to do so, and <b>false</b> means the opposite.
286 ///
287 /// # Returns
288 ///
289 /// * Returns the error code.
290 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
291 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
292 pub setAutoCancel: ::core::option::Option<
293 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, autoCancel: bool) -> i32,
294 >,
295 /// Sets the mask for a custom dialog box.
296 ///
297 ///
298 /// **Note:** This method must be called before the <b>show</b> method.
299 /// # Arguments
300 ///
301 /// * `handle` - Indicates the pointer to the custom dialog box controller.
302 ///
303 /// * `maskColor` - Indicates the mask color, in 0xARGB format.
304 ///
305 /// * `maskRect` - Indicates the pointer to the mask area. Events outside the mask area are transparently
306 /// transmitted, and events within the mask area are not. The parameter type is [`ArkUI_Rect`].
307 ///
308 /// # Returns
309 ///
310 /// * Returns the error code.
311 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
312 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
313 pub setMask: ::core::option::Option<
314 unsafe extern "C" fn(
315 handle: ArkUI_NativeDialogHandle,
316 maskColor: u32,
317 maskRect: *const ArkUI_Rect,
318 ) -> i32,
319 >,
320 /// Sets the background color for a custom dialog box.
321 ///
322 ///
323 /// **Note:** This method must be called before the <b>show</b> method.
324 /// # Arguments
325 ///
326 /// * `handle` - Indicates the pointer to the custom dialog box controller.
327 ///
328 /// * `backgroundColor` - Indicates the background color of the custom dialog box, in 0xARGB format.
329 ///
330 /// # Returns
331 ///
332 /// * Returns the error code.
333 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
334 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
335 pub setBackgroundColor: ::core::option::Option<
336 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, backgroundColor: u32) -> i32,
337 >,
338 /// Sets the background corner radius for a custom dialog box.
339 ///
340 ///
341 /// **Note:** This method must be called before the <b>show</b> method.
342 /// # Arguments
343 ///
344 /// * `handle` - Indicates the pointer to the custom dialog box controller.
345 ///
346 /// * `topLeft` - Indicates the radius of the upper left corner of the custom dialog box background.
347 ///
348 /// * `topRight` - Indicates the radius of the upper right corner of the custom dialog box background.
349 ///
350 /// * `bottomLeft` - Indicates the radius of the lower left corner of the custom dialog box background.
351 ///
352 /// * `bottomRight` - Indicates the radius of the lower right corner of the custom dialog box background.
353 ///
354 /// # Returns
355 ///
356 /// * Returns the error code.
357 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
358 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
359 pub setCornerRadius: ::core::option::Option<
360 unsafe extern "C" fn(
361 handle: ArkUI_NativeDialogHandle,
362 topLeft: f32,
363 topRight: f32,
364 bottomLeft: f32,
365 bottomRight: f32,
366 ) -> i32,
367 >,
368 /// Sets the number of grid columns occupied by a custom dialog box.
369 ///
370 ///
371 /// **Note:** This method must be called before the <b>show</b> method.
372 /// # Arguments
373 ///
374 /// * `handle` - Indicates the pointer to the custom dialog box controller.
375 ///
376 /// * `gridCount` - Indicates the number of grid columns occupied by the dialog box. The default value is subject to
377 /// the window size, and the maximum value is the maximum number of columns supported by the system.
378 ///
379 /// # Returns
380 ///
381 /// * Returns the error code.
382 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
383 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
384 pub setGridColumnCount: ::core::option::Option<
385 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, gridCount: i32) -> i32,
386 >,
387 /// Specifies whether to use a custom style for the custom dialog box.
388 ///
389 ///
390 /// **Note:** This method must be called before the <b>show</b> method.
391 /// # Arguments
392 ///
393 /// * `handle` - Indicates the pointer to the custom dialog box controller.
394 ///
395 /// * `enableCustomStyle` - Specifies whether to use a custom style for the dialog box.
396 /// <b>true</b>: The dialog box automatically adapts its width to the child components; the rounded corner is 0;
397 /// the background color is transparent.
398 /// <b>false</b>: The dialog box automatically adapts its width to the grid system and its height to the child
399 /// components; the rounded corner is 24 vp.
400 ///
401 /// # Returns
402 ///
403 /// * Returns the error code.
404 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
405 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
406 pub enableCustomStyle: ::core::option::Option<
407 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, enableCustomStyle: bool) -> i32,
408 >,
409 /// Specifies whether to use a custom animation for a custom dialog box.
410 ///
411 ///
412 /// **Note:** This method must be called before the <b>show</b> method.
413 /// # Arguments
414 ///
415 /// * `handle` - Indicates the pointer to the custom dialog box controller.
416 ///
417 /// * `enableCustomAnimation` - Specifies whether to use a custom animation. The value <b>true</b> means to use a
418 /// custom animation, and <b>false</b> means to use the default animation.
419 ///
420 /// # Returns
421 ///
422 /// * Returns the error code.
423 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
424 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
425 pub enableCustomAnimation: ::core::option::Option<
426 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, enableCustomAnimation: bool) -> i32,
427 >,
428 /// Registers a callback for a custom dialog box so that the user can decide whether to close the dialog box
429 /// after they touch the Back button or press the Esc key.
430 ///
431 ///
432 /// **Note:** This method must be called before the <b>show</b> method.
433 /// # Arguments
434 ///
435 /// * `handle` - Indicates the pointer to the custom dialog box controller.
436 ///
437 /// * `eventHandler` - Indicates the callback to register. The parameter type is [`ArkUI_OnWillDismissEvent`].
438 ///
439 /// # Returns
440 ///
441 /// * Returns the error code.
442 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
443 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
444 pub registerOnWillDismiss: ::core::option::Option<
445 unsafe extern "C" fn(
446 handle: ArkUI_NativeDialogHandle,
447 eventHandler: ArkUI_OnWillDismissEvent,
448 ) -> i32,
449 >,
450 /// Shows a custom dialog box.
451 ///
452 /// # Arguments
453 ///
454 /// * `handle` - Indicates the pointer to the custom dialog box controller.
455 ///
456 /// * `showInSubWindow` - Specifies whether to show the dialog box in a sub-window.
457 ///
458 /// # Returns
459 ///
460 /// * Returns the error code.
461 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
462 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
463 pub show: ::core::option::Option<
464 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, showInSubWindow: bool) -> i32,
465 >,
466 /// Closes a custom dialog box. If the dialog box has been closed, this API does not take effect.
467 ///
468 /// # Arguments
469 ///
470 /// * `handle` - Indicates the pointer to the custom dialog box controller.
471 ///
472 /// # Returns
473 ///
474 /// * Returns the error code.
475 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
476 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
477 pub close:
478 ::core::option::Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle) -> i32>,
479 /// Registers a listener for the dismiss event of the custom dialog box.
480 ///
481 /// # Arguments
482 ///
483 /// * `handle` - Indicates the pointer to the custom dialog box controller.
484 ///
485 /// * `userData` - Indicates the pointer to the custom data.
486 ///
487 /// * `callback` - Indicates the callback for the dismiss event of the custom dialog box.
488 ///
489 /// # Returns
490 ///
491 /// * Returns the result code.
492 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
493 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
494 pub registerOnWillDismissWithUserData: ::core::option::Option<
495 unsafe extern "C" fn(
496 handle: ArkUI_NativeDialogHandle,
497 userData: *mut ::core::ffi::c_void,
498 callback: ::core::option::Option<
499 unsafe extern "C" fn(event: *mut ArkUI_DialogDismissEvent),
500 >,
501 ) -> i32,
502 >,
503}
504/// Provides the custom dialog box APIs for the native side.
505///
506///
507/// Version: 2
508///
509/// Available since API-level: 15
510#[cfg(feature = "api-15")]
511#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
512#[repr(C)]
513pub struct ArkUI_NativeDialogAPI_2 {
514 /// Provides the custom dialog box APIs for the native side. The API scope is [`ArkUI_NativeDialogAPI_1`]
515 ///
516 ///
517 /// Available since API-level: 15
518 pub nativeDialogAPI1: ArkUI_NativeDialogAPI_1,
519 /// Defines the distance between the customDialog and system keyboard.
520 ///
521 ///
522 /// **Note:** This method must be called before the <b>show</b> method.
523 /// # Arguments
524 ///
525 /// * `handle` - Indicates the pointer to the custom dialog box controller.
526 ///
527 /// * `distance` - distance, in vp.
528 ///
529 /// * `unit` - Indicates the unit, which is an enumerated value of [`ArkUI_LengthMetricUnit`]
530 ///
531 /// # Returns
532 ///
533 /// * Returns the result code.
534 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
535 /// Returns [`ARKUI_ERROR_CODE_CAPI_INIT_ERROR`] if the CAPI init error.
536 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
537 ///
538 /// Available since API-level: 15
539 pub setKeyboardAvoidDistance: ::core::option::Option<
540 unsafe extern "C" fn(
541 handle: ArkUI_NativeDialogHandle,
542 distance: f32,
543 unit: ArkUI_LengthMetricUnit,
544 ) -> i32,
545 >,
546 /// Sets the level mode for a custom dialog box.
547 ///
548 ///
549 /// **Note:** This method must be called before the <b>show</b> method.
550 /// # Arguments
551 ///
552 /// * `handle` - Indicates the pointer to the custom dialog box controller.
553 ///
554 /// * `levelMode` - Indicates the level mode. The parameter type is [`ArkUI_LevelMode`].
555 ///
556 /// # Returns
557 ///
558 /// * Returns the error code.
559 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
560 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
561 ///
562 /// Available since API-level: 15
563 pub setLevelMode: ::core::option::Option<
564 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, levelMode: ArkUI_LevelMode) -> i32,
565 >,
566 /// Sets the level uniqueId for a custom dialog box.
567 ///
568 ///
569 /// **Note:** This method must be called before the <b>setLevelMode</b> method.
570 /// # Arguments
571 ///
572 /// * `handle` - Indicates the pointer to the custom dialog box controller.
573 ///
574 /// * `uniqueId` - Indicates the uniquedId of any nodes in router or navigation pages.
575 ///
576 /// # Returns
577 ///
578 /// * Returns the error code.
579 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
580 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
581 ///
582 /// Available since API-level: 15
583 pub setLevelUniqueId: ::core::option::Option<
584 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, uniqueId: i32) -> i32,
585 >,
586 /// Sets the immersive mode for a custom dialog box.
587 ///
588 ///
589 /// **Note:** This method must be called before the <b>show</b> method.
590 /// # Arguments
591 ///
592 /// * `handle` - Indicates the pointer to the custom dialog box controller.
593 ///
594 /// * `immersiveMode` - Indicates the immersive mode. The parameter type is [`ArkUI_ImmersiveMode`].
595 ///
596 /// # Returns
597 ///
598 /// * Returns the error code.
599 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
600 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
601 ///
602 /// Available since API-level: 15
603 pub setImmersiveMode: ::core::option::Option<
604 unsafe extern "C" fn(
605 handle: ArkUI_NativeDialogHandle,
606 immersiveMode: ArkUI_ImmersiveMode,
607 ) -> i32,
608 >,
609}
610/// Provides the custom dialog box APIs for the native side.
611///
612///
613/// Version: 3
614///
615/// Available since API-level: 19
616#[cfg(feature = "api-19")]
617#[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
618#[repr(C)]
619pub struct ArkUI_NativeDialogAPI_3 {
620 /// Provides the custom dialog box APIs for the native side. The API scope is [`ArkUI_NativeDialogAPI_1`]
621 ///
622 ///
623 /// Available since API-level: 19
624 pub nativeDialogAPI1: ArkUI_NativeDialogAPI_1,
625 /// Provides the custom dialog box APIs for the native side. The API scope is [`ArkUI_NativeDialogAPI_2`]
626 ///
627 ///
628 /// Available since API-level: 19
629 pub nativeDialogAPI2: ArkUI_NativeDialogAPI_2,
630 /// Sets the display order for a custom dialog box.
631 ///
632 ///
633 /// **Note:** This method must be called before the <b>show</b> method.
634 /// # Arguments
635 ///
636 /// * `handle` - Indicates the pointer to the custom dialog box controller.
637 ///
638 /// * `levelOrder` - Indicates the display order. The valid range is [-100000.0, 100000.0].
639 ///
640 /// # Returns
641 ///
642 /// * Returns the error code.
643 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
644 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
645 ///
646 /// Available since API-level: 19
647 pub setLevelOrder: ::core::option::Option<
648 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, levelOrder: f64) -> i32,
649 >,
650 /// Registers a listener callback before the dialog openAnimation starts.
651 ///
652 /// # Arguments
653 ///
654 /// * `handle` - Indicates the pointer to the custom dialog box controller.
655 ///
656 /// * `userData` - Indicates the pointer to the custom data.
657 ///
658 /// * `callback` - Indicates the callback before the dialog openAnimation starts.
659 ///
660 /// # Returns
661 ///
662 /// * Returns the result code.
663 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
664 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
665 ///
666 /// Available since API-level: 19
667 pub registerOnWillAppear: ::core::option::Option<
668 unsafe extern "C" fn(
669 handle: ArkUI_NativeDialogHandle,
670 userData: *mut ::core::ffi::c_void,
671 callback: ::core::option::Option<
672 unsafe extern "C" fn(userData: *mut ::core::ffi::c_void),
673 >,
674 ) -> i32,
675 >,
676 /// Registers a listener callback when the dialog appears.
677 ///
678 /// # Arguments
679 ///
680 /// * `handle` - Indicates the pointer to the custom dialog box controller.
681 ///
682 /// * `userData` - Indicates the pointer to the custom data.
683 ///
684 /// * `callback` - Indicates the callback when the dialog appears.
685 ///
686 /// # Returns
687 ///
688 /// * Returns the result code.
689 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
690 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
691 ///
692 /// Available since API-level: 19
693 pub registerOnDidAppear: ::core::option::Option<
694 unsafe extern "C" fn(
695 handle: ArkUI_NativeDialogHandle,
696 userData: *mut ::core::ffi::c_void,
697 callback: ::core::option::Option<
698 unsafe extern "C" fn(userData: *mut ::core::ffi::c_void),
699 >,
700 ) -> i32,
701 >,
702 /// Registers a listener callback before the dialog closeAnimation starts.
703 ///
704 /// # Arguments
705 ///
706 /// * `handle` - Indicates the pointer to the custom dialog box controller.
707 ///
708 /// * `userData` - Indicates the pointer to the custom data.
709 ///
710 /// * `callback` - Indicates the callback before the dialog closeAnimation starts.
711 ///
712 /// # Returns
713 ///
714 /// * Returns the result code.
715 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
716 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
717 ///
718 /// Available since API-level: 19
719 pub registerOnWillDisappear: ::core::option::Option<
720 unsafe extern "C" fn(
721 handle: ArkUI_NativeDialogHandle,
722 userData: *mut ::core::ffi::c_void,
723 callback: ::core::option::Option<
724 unsafe extern "C" fn(userData: *mut ::core::ffi::c_void),
725 >,
726 ) -> i32,
727 >,
728 /// Registers a listener callback when the dialog disappears.
729 ///
730 /// # Arguments
731 ///
732 /// * `handle` - Indicates the pointer to the custom dialog box controller.
733 ///
734 /// * `userData` - Indicates the pointer to the custom data.
735 ///
736 /// * `callback` - Indicates the callback when the dialog disappears.
737 ///
738 /// # Returns
739 ///
740 /// * Returns the result code.
741 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
742 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
743 ///
744 /// Available since API-level: 19
745 pub registerOnDidDisappear: ::core::option::Option<
746 unsafe extern "C" fn(
747 handle: ArkUI_NativeDialogHandle,
748 userData: *mut ::core::ffi::c_void,
749 callback: ::core::option::Option<
750 unsafe extern "C" fn(userData: *mut ::core::ffi::c_void),
751 >,
752 ) -> i32,
753 >,
754 /// Sets the border width of the dialog box.
755 ///
756 ///
757 /// **Note:** This method must be called before the <b>show</b> method.
758 /// # Arguments
759 ///
760 /// * `handle` - Pointer to the dialog box controller.
761 ///
762 /// * `top` - Width of the top border.
763 ///
764 /// * `right` - Width of the right border.
765 ///
766 /// * `bottom` - Width of the bottom border.
767 ///
768 /// * `left` - Width of the left border.
769 ///
770 /// * `unit` - Unit of the width. The default value is vp.
771 ///
772 /// # Returns
773 ///
774 /// * Returns the error code.
775 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
776 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occur..
777 ///
778 /// Available since API-level: 19
779 pub setBorderWidth: ::core::option::Option<
780 unsafe extern "C" fn(
781 handle: ArkUI_NativeDialogHandle,
782 top: f32,
783 right: f32,
784 bottom: f32,
785 left: f32,
786 unit: ArkUI_LengthMetricUnit,
787 ) -> i32,
788 >,
789 /// Sets the border color of the dialog box.
790 ///
791 ///
792 /// **Note:** This method must be called before the <b>show</b> method.
793 /// # Arguments
794 ///
795 /// * `handle` - Pointer to the dialog box controller.
796 ///
797 /// * `top` - Color of the top border.
798 ///
799 /// * `right` - Color of the right border.
800 ///
801 /// * `bottom` - Color of the bottom border.
802 ///
803 /// * `left` - Color of the left border.
804 ///
805 /// # Returns
806 ///
807 /// * Returns the error code.
808 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
809 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occur..
810 ///
811 /// Available since API-level: 19
812 pub setBorderColor: ::core::option::Option<
813 unsafe extern "C" fn(
814 handle: ArkUI_NativeDialogHandle,
815 top: u32,
816 right: u32,
817 bottom: u32,
818 left: u32,
819 ) -> i32,
820 >,
821 /// Sets the border style of the dialog box.
822 ///
823 ///
824 /// **Note:** This method must be called before the <b>show</b> method.
825 /// # Arguments
826 ///
827 /// * `handle` - Pointer to the dialog box controller.
828 ///
829 /// * `top` - Style of the top border.
830 ///
831 /// * `right` - Style of the right border.
832 ///
833 /// * `bottom` - Style of the bottom border.
834 ///
835 /// * `left` - Style of the left border.
836 ///
837 /// # Returns
838 ///
839 /// * Returns the error code.
840 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
841 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occur..
842 ///
843 /// Available since API-level: 19
844 pub setBorderStyle: ::core::option::Option<
845 unsafe extern "C" fn(
846 handle: ArkUI_NativeDialogHandle,
847 top: i32,
848 right: i32,
849 bottom: i32,
850 left: i32,
851 ) -> i32,
852 >,
853 /// Sets the width of the dialog box background.
854 ///
855 ///
856 /// **Note:** This method must be called before the <b>show</b> method.
857 /// # Arguments
858 ///
859 /// * `handle` - Pointer to the dialog box controller.
860 ///
861 /// * `width` - Width of the background.
862 ///
863 /// * `unit` - Unit of the width. The default value is vp.
864 ///
865 /// # Returns
866 ///
867 /// * Returns the error code.
868 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
869 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occur..
870 ///
871 /// Available since API-level: 19
872 pub setWidth: ::core::option::Option<
873 unsafe extern "C" fn(
874 handle: ArkUI_NativeDialogHandle,
875 width: f32,
876 unit: ArkUI_LengthMetricUnit,
877 ) -> i32,
878 >,
879 /// Sets the height of the dialog box background.
880 ///
881 ///
882 /// **Note:** This method must be called before the <b>show</b> method.
883 /// # Arguments
884 ///
885 /// * `handle` - Pointer to the dialog box controller.
886 ///
887 /// * `height` - Height of the background.
888 ///
889 /// * `unit` - Unit of the height. The default value is vp.
890 ///
891 /// # Returns
892 ///
893 /// * Returns the error code.
894 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
895 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occur..
896 ///
897 /// Available since API-level: 19
898 pub setHeight: ::core::option::Option<
899 unsafe extern "C" fn(
900 handle: ArkUI_NativeDialogHandle,
901 height: f32,
902 unit: ArkUI_LengthMetricUnit,
903 ) -> i32,
904 >,
905 /// Sets the shadow of the dialog box background.
906 ///
907 ///
908 /// **Note:** This method must be called before the <b>show</b> method.
909 /// # Arguments
910 ///
911 /// * `handle` - Pointer to the dialog box controller.
912 ///
913 /// * `shadow` - Shadow style of the background, specified by an enumerated value.
914 ///
915 /// # Returns
916 ///
917 /// * Returns the error code.
918 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
919 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occur..
920 ///
921 /// Available since API-level: 19
922 pub setShadow: ::core::option::Option<
923 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, shadow: ArkUI_ShadowStyle) -> i32,
924 >,
925 /// Sets the custom shadow of the dialog box background.
926 ///
927 ///
928 /// **Note:** This method must be called before the <b>show</b> method.
929 /// # Arguments
930 ///
931 /// * `handle` - Pointer to the dialog box controller.
932 ///
933 /// * `customShadow` - Custom shadow parameter. The format is the same as that of the <b>NODE_SHADOW</b> property.
934 ///
935 /// # Returns
936 ///
937 /// * Returns the error code.
938 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
939 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occur..
940 ///
941 /// Available since API-level: 19
942 pub setCustomShadow: ::core::option::Option<
943 unsafe extern "C" fn(
944 handle: ArkUI_NativeDialogHandle,
945 customShadow: *const ArkUI_AttributeItem,
946 ) -> i32,
947 >,
948 /// Sets the background blur style of the dialog box.
949 ///
950 ///
951 /// **Note:** This method must be called before the <b>show</b> method.
952 /// # Arguments
953 ///
954 /// * `handle` - Pointer to the dialog box controller.
955 ///
956 /// * `blurStyle` - Background blur style, specified by an enumerated value.
957 ///
958 /// # Returns
959 ///
960 /// * Returns the error code.
961 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
962 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occur..
963 ///
964 /// Available since API-level: 19
965 pub setBackgroundBlurStyle: ::core::option::Option<
966 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, blurStyle: ArkUI_BlurStyle) -> i32,
967 >,
968 /// Sets the keyboard avoidance mode of the dialog box.
969 ///
970 ///
971 /// **Note:** This method must be called before the <b>show</b> method.
972 /// # Arguments
973 ///
974 /// * `handle` - Pointer to the dialog box controller.
975 ///
976 /// * `keyboardAvoidMode` - Keyboard avoidance mode, specified by an enumerated value.
977 ///
978 /// # Returns
979 ///
980 /// * Returns the error code.
981 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
982 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occur..
983 ///
984 /// Available since API-level: 19
985 pub setKeyboardAvoidMode: ::core::option::Option<
986 unsafe extern "C" fn(
987 handle: ArkUI_NativeDialogHandle,
988 keyboardAvoidMode: ArkUI_KeyboardAvoidMode,
989 ) -> i32,
990 >,
991 /// Sets whether to enable the hover mode for the dialog box.
992 ///
993 ///
994 /// **Note:** This method must be called before the <b>show</b> method.
995 /// # Arguments
996 ///
997 /// * `handle` - Pointer to the dialog box controller.
998 ///
999 /// * `enableHoverMode` - Whether to enable the hover mode. The default value is <b>false</b>.
1000 ///
1001 /// # Returns
1002 ///
1003 /// * Returns the error code.
1004 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1005 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occur..
1006 ///
1007 /// Available since API-level: 19
1008 pub enableHoverMode: ::core::option::Option<
1009 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, enableHoverMode: bool) -> i32,
1010 >,
1011 /// Set the default display area of the dialog box in hover mode.
1012 ///
1013 ///
1014 /// **Note:** This method must be called before the <b>show</b> method.
1015 /// # Arguments
1016 ///
1017 /// * `handle` - Pointer to the dialog box controller.
1018 ///
1019 /// * `hoverModeAreaType` - Display area in hover mode, specified by an enumerated value.
1020 ///
1021 /// # Returns
1022 ///
1023 /// * Returns the error code.
1024 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1025 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occur.
1026 ///
1027 /// Available since API-level: 19
1028 pub setHoverModeArea: ::core::option::Option<
1029 unsafe extern "C" fn(
1030 handle: ArkUI_NativeDialogHandle,
1031 hoverModeAreaType: ArkUI_HoverModeAreaType,
1032 ) -> i32,
1033 >,
1034 /// Sets whether to get focus when the custom dialog is displayed.
1035 ///
1036 /// # Arguments
1037 ///
1038 /// * `handle` - Indicates the pointer to the custom dialog box controller.
1039 ///
1040 /// * `focusable` - Specifies whether to get focus when the custom dialog is displayed. The default value is true.
1041 ///
1042 /// # Returns
1043 ///
1044 /// * Returns the error code.
1045 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1046 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1047 ///
1048 /// Available since API-level: 19
1049 pub setFocusable: ::core::option::Option<
1050 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, focusable: bool) -> i32,
1051 >,
1052 /// Sets the background blur effect for a custom dialog box.
1053 ///
1054 ///
1055 /// **Note:** This method must be called before the <b>show</b> method.
1056 /// # Arguments
1057 ///
1058 /// * `handle` - Indicates the pointer to the custom dialog box controller.
1059 ///
1060 /// * `backgroundBlurStyleOptions` - Background blur effect options.
1061 /// Format of the [`ArkUI_AttributeItem`] parameter:
1062 ///
1063 /// .value[0].i32: color mode. The value is an enum of [`ArkUI_ColorMode`].
1064 ///
1065 /// .value[1]?.i32: adaptive color mode. The value is an enum of [`ArkUI_AdaptiveColor`].
1066 ///
1067 /// .value[2]?.f32: blur degree. The value range is [0.0, 1.0].
1068 ///
1069 /// .value[3]?.u32: brightness of black in the grayscale blur. The value range is [0, 127].
1070 ///
1071 /// .value[4]?.u32: degree of darkening the white color in the grayscale blur. The value range is [0, 127].
1072 ///
1073 /// .value[5]?.i32: blur activation policy. The value is an enum of [`ArkUI_BlurStyleActivePolicy`].
1074 ///
1075 /// .value[6]?.u32: background color, in 0xARGB format, of the components within the window after the window
1076 /// loses focus (in which case, the blur effect on the components within the window is
1077 /// removed).
1078 ///
1079 ///
1080 /// # Returns
1081 ///
1082 /// * Returns the result code.
1083 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1084 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1085 ///
1086 /// Available since API-level: 19
1087 pub setBackgroundBlurStyleOptions: ::core::option::Option<
1088 unsafe extern "C" fn(
1089 handle: ArkUI_NativeDialogHandle,
1090 backgroundBlurStyleOptions: *const ArkUI_AttributeItem,
1091 ) -> i32,
1092 >,
1093 /// Sets the background effect parameters for a custom dialog box.
1094 ///
1095 ///
1096 /// **Note:** This method must be called before the <b>show</b> method.
1097 /// # Arguments
1098 ///
1099 /// * `handle` - Indicates the pointer to the custom dialog box controller.
1100 ///
1101 /// * `backgroundEffect` - Background effect.
1102 /// Format of the [`ArkUI_AttributeItem`] parameter:
1103 ///
1104 /// .value[0].f32: blur radius, in vp.
1105 ///
1106 /// .value[1]?.f32: saturation.
1107 ///
1108 /// .value[2]?.f32: brightness.
1109 ///
1110 /// .value[3]?.u32: color, in 0xARGB format.
1111 ///
1112 /// .value[4]?.i32: adaptive color mode. The value is an enum of [`ArkUI_AdaptiveColor`].
1113 ///
1114 /// .value[5]?.u32: brightness of black in the grayscale blur. The value range is [0, 127].
1115 ///
1116 /// .value[6]?.u32: degree of darkening the white color in the grayscale blur. The value range is [0, 127].
1117 ///
1118 /// .value[7]?.i32: blur activation policy. The value is an enum of [`ArkUI_BlurStyleActivePolicy`].
1119 ///
1120 /// .value[8]?.u32: background color, in 0xARGB format, of the components within the window after the window
1121 /// loses focus (in which case, the blur effect on the components within the window is
1122 /// removed).
1123 ///
1124 ///
1125 /// # Returns
1126 ///
1127 /// * Returns the result code.
1128 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1129 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1130 ///
1131 /// Available since API-level: 19
1132 pub setBackgroundEffect: ::core::option::Option<
1133 unsafe extern "C" fn(
1134 handle: ArkUI_NativeDialogHandle,
1135 backgroundEffect: *const ArkUI_AttributeItem,
1136 ) -> i32,
1137 >,
1138}
1139extern "C" {
1140 /// Sets whether to block the system behavior of dismissing a dialog box.
1141 ///
1142 /// # Arguments
1143 ///
1144 /// * `event` - Indicates the pointer to a dialog box dismiss event object.
1145 ///
1146 /// * `shouldBlockDismiss` - Indicates whether to block the system behavior of dismissing the dialog box. The value
1147 /// <b>true</b> means to block the system behavior, and <b>false</b> means the opposite.
1148 ///
1149 /// Available since API-level: 12
1150 #[cfg(feature = "api-12")]
1151 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1152 pub fn OH_ArkUI_DialogDismissEvent_SetShouldBlockDismiss(
1153 event: *mut ArkUI_DialogDismissEvent,
1154 shouldBlockDismiss: bool,
1155 );
1156 /// Obtains the pointer to user data in a dialog box dismiss event object.
1157 ///
1158 /// # Arguments
1159 ///
1160 /// * `event` - Indicates the pointer to a dialog box dismiss event object.
1161 ///
1162 ///
1163 /// # Returns
1164 ///
1165 /// * Returns the pointer to user data.
1166 ///
1167 /// Available since API-level: 12
1168 #[cfg(feature = "api-12")]
1169 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1170 pub fn OH_ArkUI_DialogDismissEvent_GetUserData(
1171 event: *mut ArkUI_DialogDismissEvent,
1172 ) -> *mut ::core::ffi::c_void;
1173 /// Obtains the c from a dialog box dismiss event object.
1174 ///
1175 /// # Arguments
1176 ///
1177 /// * `event` - Indicates the pointer to a dialog box dismiss event object.
1178 ///
1179 ///
1180 /// # Returns
1181 ///
1182 /// * Returns the dismissal reason. Returns <b>-1</b> if an exception occurs.
1183 /// [`DIALOG_DISMISS_BACK_PRESS`]: touching the Back button, swiping left or right on the screen, or
1184 /// pressing the Esc key.
1185 /// [`DIALOG_DISMISS_TOUCH_OUTSIDE`]: touching the mask.
1186 /// [`DIALOG_DISMISS_CLOSE_BUTTON`]: touching the Close button.
1187 /// [`DIALOG_DISMISS_SLIDE_DOWN`]: sliding down.
1188 ///
1189 /// Available since API-level: 12
1190 #[cfg(feature = "api-12")]
1191 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1192 pub fn OH_ArkUI_DialogDismissEvent_GetDismissReason(
1193 event: *mut ArkUI_DialogDismissEvent,
1194 ) -> i32;
1195 /// Displays a custom dialog box.
1196 ///
1197 /// # Arguments
1198 ///
1199 /// * `options` - Dialog box parameters.
1200 ///
1201 /// * `callback` - Callback to be invoked when the custom dialog box displays.
1202 ///
1203 /// # Returns
1204 ///
1205 /// * Returns the error code.
1206 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1207 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1208 ///
1209 /// Available since API-level: 19
1210 #[cfg(feature = "api-19")]
1211 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1212 pub fn OH_ArkUI_CustomDialog_OpenDialog(
1213 options: *mut ArkUI_CustomDialogOptions,
1214 callback: ::core::option::Option<unsafe extern "C" fn(dialogId: i32)>,
1215 ) -> i32;
1216 /// Updates a custom dialog box.
1217 ///
1218 /// # Arguments
1219 ///
1220 /// * `options` - Dialog box parameters.
1221 ///
1222 /// * `callback` - Callback to be invoked when the custom dialog box updates.
1223 ///
1224 /// # Returns
1225 ///
1226 /// * Returns the error code.
1227 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1228 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1229 ///
1230 /// Available since API-level: 19
1231 #[cfg(feature = "api-19")]
1232 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1233 pub fn OH_ArkUI_CustomDialog_UpdateDialog(
1234 options: *mut ArkUI_CustomDialogOptions,
1235 callback: ::core::option::Option<unsafe extern "C" fn(dialogId: i32)>,
1236 ) -> i32;
1237 /// Closes a custom dialog box.
1238 ///
1239 /// # Arguments
1240 ///
1241 /// * `dialogId` - Dialog id.
1242 ///
1243 /// # Returns
1244 ///
1245 /// * Returns the error code.
1246 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1247 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1248 ///
1249 /// Available since API-level: 19
1250 #[cfg(feature = "api-19")]
1251 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1252 pub fn OH_ArkUI_CustomDialog_CloseDialog(dialogId: i32) -> i32;
1253 /// Creates custom dialog box options.
1254 ///
1255 /// # Arguments
1256 ///
1257 /// * `content` - Content of the custom dialog box.
1258 ///
1259 /// # Returns
1260 ///
1261 /// * Returns the pointer to the custom dialog box options.
1262 ///
1263 /// Available since API-level: 19
1264 #[cfg(feature = "api-19")]
1265 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1266 pub fn OH_ArkUI_CustomDialog_CreateOptions(
1267 content: ArkUI_NodeHandle,
1268 ) -> *mut ArkUI_CustomDialogOptions;
1269 /// Destroys the custom dialog box options.
1270 ///
1271 /// # Arguments
1272 ///
1273 /// * `options` - The pointer to the custom dialog box options.
1274 ///
1275 /// Available since API-level: 19
1276 #[cfg(feature = "api-19")]
1277 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1278 pub fn OH_ArkUI_CustomDialog_DisposeOptions(options: *mut ArkUI_CustomDialogOptions);
1279 /// Sets the level mode for a custom dialog box.
1280 ///
1281 ///
1282 /// **Note:** This method must be called before the <b>OH_ArkUI_CustomDialog_OpenDialog</b> method.
1283 /// # Arguments
1284 ///
1285 /// * `options` - Indicates the pointer to the custom dialog options.
1286 ///
1287 /// * `levelMode` - Indicates the level mode. The parameter type is [`ArkUI_LevelMode`].
1288 ///
1289 /// # Returns
1290 ///
1291 /// * Returns the error code.
1292 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1293 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1294 ///
1295 /// Available since API-level: 19
1296 #[cfg(feature = "api-19")]
1297 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1298 pub fn OH_ArkUI_CustomDialog_SetLevelMode(
1299 options: *mut ArkUI_CustomDialogOptions,
1300 levelMode: ArkUI_LevelMode,
1301 ) -> i32;
1302 /// Sets the level uniqueId for a custom dialog box.
1303 ///
1304 /// # Arguments
1305 ///
1306 /// * `options` - Indicates the pointer to the custom dialog options.
1307 ///
1308 /// * `uniqueId` - Indicates the unique id of any nodes in router or navigation pages.
1309 ///
1310 /// # Returns
1311 ///
1312 /// * Returns the error code.
1313 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1314 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1315 ///
1316 /// Available since API-level: 19
1317 #[cfg(feature = "api-19")]
1318 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1319 pub fn OH_ArkUI_CustomDialog_SetLevelUniqueId(
1320 options: *mut ArkUI_CustomDialogOptions,
1321 uniqueId: i32,
1322 ) -> i32;
1323 /// Sets the immersive mode for a custom dialog box.
1324 ///
1325 ///
1326 /// **Note:** This method must be called before the <b>OH_ArkUI_CustomDialog_OpenDialog</b> method.
1327 /// # Arguments
1328 ///
1329 /// * `options` - Indicates the pointer to the custom dialog options.
1330 ///
1331 /// * `immersiveMode` - Indicates the immersive mode. The parameter type is [`ArkUI_ImmersiveMode`].
1332 ///
1333 /// # Returns
1334 ///
1335 /// * Returns the error code.
1336 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1337 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1338 ///
1339 /// Available since API-level: 19
1340 #[cfg(feature = "api-19")]
1341 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1342 pub fn OH_ArkUI_CustomDialog_SetImmersiveMode(
1343 options: *mut ArkUI_CustomDialogOptions,
1344 immersiveMode: ArkUI_ImmersiveMode,
1345 ) -> i32;
1346 /// Sets the background color of the dialog box.
1347 ///
1348 /// # Arguments
1349 ///
1350 /// * `options` - Dialog box parameters.
1351 ///
1352 /// * `backgroundColor` - Background color of the dialog box.
1353 ///
1354 /// # Returns
1355 ///
1356 /// * Returns the error code.
1357 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1358 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1359 ///
1360 /// Available since API-level: 19
1361 #[cfg(feature = "api-19")]
1362 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1363 pub fn OH_ArkUI_CustomDialog_SetBackgroundColor(
1364 options: *mut ArkUI_CustomDialogOptions,
1365 backgroundColor: u32,
1366 ) -> i32;
1367 /// Sets the corner radius for a custom dialog box.
1368 ///
1369 /// # Arguments
1370 ///
1371 /// * `options` - Dialog box parameters.
1372 ///
1373 /// * `topLeft` - Corner radius of the upper left corner.
1374 ///
1375 /// * `topRight` - Corner radius of the upper right corner.
1376 ///
1377 /// * `bottomLeft` - Corner radius of the lower left corner.
1378 ///
1379 /// * `bottomRight` - Corner radius of the lower right corner.
1380 ///
1381 /// # Returns
1382 ///
1383 /// * Returns the error code.
1384 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1385 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1386 ///
1387 /// Available since API-level: 19
1388 #[cfg(feature = "api-19")]
1389 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1390 pub fn OH_ArkUI_CustomDialog_SetCornerRadius(
1391 options: *mut ArkUI_CustomDialogOptions,
1392 topLeft: f32,
1393 topRight: f32,
1394 bottomLeft: f32,
1395 bottomRight: f32,
1396 ) -> i32;
1397 /// Sets the border width of the dialog box.
1398 ///
1399 /// # Arguments
1400 ///
1401 /// * `options` - Dialog box parameters.
1402 ///
1403 /// * `top` - Width of the top border.
1404 ///
1405 /// * `right` - Width of the right border.
1406 ///
1407 /// * `bottom` - Width of the bottom border.
1408 ///
1409 /// * `left` - Width of the left border.
1410 ///
1411 /// * `unit` - Unit of the width. The default value is vp.
1412 ///
1413 /// # Returns
1414 ///
1415 /// * Returns the error code.
1416 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1417 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1418 ///
1419 /// Available since API-level: 19
1420 #[cfg(feature = "api-19")]
1421 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1422 pub fn OH_ArkUI_CustomDialog_SetBorderWidth(
1423 options: *mut ArkUI_CustomDialogOptions,
1424 top: f32,
1425 right: f32,
1426 bottom: f32,
1427 left: f32,
1428 unit: ArkUI_LengthMetricUnit,
1429 ) -> i32;
1430 /// Sets the border color of the dialog box.
1431 ///
1432 /// # Arguments
1433 ///
1434 /// * `options` - Dialog box parameters.
1435 ///
1436 /// * `top` - Color of the top border.
1437 ///
1438 /// * `right` - Color of the right border.
1439 ///
1440 /// * `bottom` - Color of the bottom border.
1441 ///
1442 /// * `left` - Color of the left border.
1443 ///
1444 /// # Returns
1445 ///
1446 /// * Returns the error code.
1447 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1448 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1449 ///
1450 /// Available since API-level: 19
1451 #[cfg(feature = "api-19")]
1452 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1453 pub fn OH_ArkUI_CustomDialog_SetBorderColor(
1454 options: *mut ArkUI_CustomDialogOptions,
1455 top: u32,
1456 right: u32,
1457 bottom: u32,
1458 left: u32,
1459 ) -> i32;
1460 /// Sets the border style of the dialog box.
1461 ///
1462 /// # Arguments
1463 ///
1464 /// * `options` - Dialog box parameters.
1465 ///
1466 /// * `top` - Style of the top border.
1467 ///
1468 /// * `right` - Style of the right border.
1469 ///
1470 /// * `bottom` - Style of the bottom border.
1471 ///
1472 /// * `left` - Style of the left border.
1473 ///
1474 /// # Returns
1475 ///
1476 /// * Returns the error code.
1477 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1478 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1479 ///
1480 /// Available since API-level: 19
1481 #[cfg(feature = "api-19")]
1482 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1483 pub fn OH_ArkUI_CustomDialog_SetBorderStyle(
1484 options: *mut ArkUI_CustomDialogOptions,
1485 top: i32,
1486 right: i32,
1487 bottom: i32,
1488 left: i32,
1489 ) -> i32;
1490 /// Sets the width of the dialog box background.
1491 ///
1492 /// # Arguments
1493 ///
1494 /// * `options` - Dialog box parameters.
1495 ///
1496 /// * `width` - Width of the background.
1497 ///
1498 /// * `unit` - Unit of the width. The default value is vp.
1499 ///
1500 /// # Returns
1501 ///
1502 /// * Returns the error code.
1503 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1504 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1505 ///
1506 /// Available since API-level: 19
1507 #[cfg(feature = "api-19")]
1508 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1509 pub fn OH_ArkUI_CustomDialog_SetWidth(
1510 options: *mut ArkUI_CustomDialogOptions,
1511 width: f32,
1512 unit: ArkUI_LengthMetricUnit,
1513 ) -> i32;
1514 /// Sets the height of the dialog box background.
1515 ///
1516 /// # Arguments
1517 ///
1518 /// * `options` - Dialog box parameters.
1519 ///
1520 /// * `height` - Height of the background.
1521 ///
1522 /// * `unit` - Unit of the height. The default value is vp.
1523 ///
1524 /// # Returns
1525 ///
1526 /// * Returns the error code.
1527 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1528 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1529 ///
1530 /// Available since API-level: 19
1531 #[cfg(feature = "api-19")]
1532 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1533 pub fn OH_ArkUI_CustomDialog_SetHeight(
1534 options: *mut ArkUI_CustomDialogOptions,
1535 height: f32,
1536 unit: ArkUI_LengthMetricUnit,
1537 ) -> i32;
1538 /// Sets the shadow of the dialog box background.
1539 ///
1540 /// # Arguments
1541 ///
1542 /// * `options` - Dialog box parameters.
1543 ///
1544 /// * `shadow` - Shadow style of the background, specified by an enumerated value.
1545 ///
1546 /// # Returns
1547 ///
1548 /// * Returns the error code.
1549 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1550 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1551 ///
1552 /// Available since API-level: 19
1553 #[cfg(feature = "api-19")]
1554 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1555 pub fn OH_ArkUI_CustomDialog_SetShadow(
1556 options: *mut ArkUI_CustomDialogOptions,
1557 shadow: ArkUI_ShadowStyle,
1558 ) -> i32;
1559 /// Sets the custom shadow of the dialog box background.
1560 ///
1561 /// # Arguments
1562 ///
1563 /// * `options` - Dialog box parameters.
1564 ///
1565 /// * `customShadow` - Custom shadow parameter. The format is the same as that of
1566 /// the <b>NODE_CUSTOM_SHADOW</b> property.
1567 ///
1568 /// # Returns
1569 ///
1570 /// * Returns the error code.
1571 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1572 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1573 ///
1574 /// Available since API-level: 19
1575 #[cfg(feature = "api-19")]
1576 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1577 pub fn OH_ArkUI_CustomDialog_SetCustomShadow(
1578 options: *mut ArkUI_CustomDialogOptions,
1579 customShadow: *const ArkUI_AttributeItem,
1580 ) -> i32;
1581 /// Sets the background blur style of the dialog box.
1582 ///
1583 /// # Arguments
1584 ///
1585 /// * `options` - Dialog box parameters.
1586 ///
1587 /// * `blurStyle` - Background blur style, specified by an enumerated value.
1588 ///
1589 /// # Returns
1590 ///
1591 /// * Returns the error code.
1592 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1593 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1594 ///
1595 /// Available since API-level: 19
1596 #[cfg(feature = "api-19")]
1597 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1598 pub fn OH_ArkUI_CustomDialog_SetBackgroundBlurStyle(
1599 options: *mut ArkUI_CustomDialogOptions,
1600 blurStyle: ArkUI_BlurStyle,
1601 ) -> i32;
1602 /// Sets the alignment mode of the dialog box.
1603 ///
1604 /// # Arguments
1605 ///
1606 /// * `options` - Dialog box parameters.
1607 ///
1608 /// * `alignment` - Alignment mode of the dialog box. The parameter type is [`ArkUI_Alignment`].
1609 ///
1610 /// * `offsetX` - Indicates the horizontal offset of the custom dialog box. The value is a floating point number.
1611 ///
1612 /// * `offsetY` - Indicates the vertical offset of the custom dialog box. The value is a floating point number.
1613 ///
1614 /// # Returns
1615 ///
1616 /// * Returns the error code.
1617 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1618 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1619 ///
1620 /// Available since API-level: 19
1621 #[cfg(feature = "api-19")]
1622 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1623 pub fn OH_ArkUI_CustomDialog_SetAlignment(
1624 options: *mut ArkUI_CustomDialogOptions,
1625 alignment: i32,
1626 offsetX: f32,
1627 offsetY: f32,
1628 ) -> i32;
1629 /// Sets the modal mode for a custom dialog box.
1630 ///
1631 /// # Arguments
1632 ///
1633 /// * `options` - Dialog box parameters.
1634 ///
1635 /// * `isModal` - Whether the dialog box is a modal. A modal dialog box has a mask applied,
1636 /// while a non-modal dialog box does not. The value <b>true</b> means that the dialog box is a modal.
1637 ///
1638 /// # Returns
1639 ///
1640 /// * Returns the error code.
1641 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1642 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1643 ///
1644 /// Available since API-level: 19
1645 #[cfg(feature = "api-19")]
1646 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1647 pub fn OH_ArkUI_CustomDialog_SetModalMode(
1648 options: *mut ArkUI_CustomDialogOptions,
1649 isModal: bool,
1650 ) -> i32;
1651 /// Specifies whether to allow users to touch the mask to dismiss the custom dialog box.
1652 ///
1653 /// # Arguments
1654 ///
1655 /// * `options` - Dialog box parameters.
1656 ///
1657 /// * `autoCancel` - Specifies whether to allow users to touch the mask to dismiss the dialog box.
1658 /// The value <b>true</b> means to allow users to do so, and <b>false</b> means the opposite.
1659 ///
1660 /// # Returns
1661 ///
1662 /// * Returns the error code.
1663 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1664 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1665 ///
1666 /// Available since API-level: 19
1667 #[cfg(feature = "api-19")]
1668 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1669 pub fn OH_ArkUI_CustomDialog_SetAutoCancel(
1670 options: *mut ArkUI_CustomDialogOptions,
1671 autoCancel: bool,
1672 ) -> i32;
1673 /// Sets whether to display the dialog box in a subwindow.
1674 ///
1675 /// # Arguments
1676 ///
1677 /// * `options` - Dialog box parameters.
1678 ///
1679 /// * `showInSubwindow` - Whether to display the dialog box in a subwindow when it is not in the main window.
1680 /// The default value is <b>false</b>, meaning the dialog box is displayed within the application, not in a
1681 /// separate subwindow.
1682 ///
1683 /// # Returns
1684 ///
1685 /// * Returns the error code.
1686 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1687 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1688 ///
1689 /// Available since API-level: 19
1690 #[cfg(feature = "api-19")]
1691 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1692 pub fn OH_ArkUI_CustomDialog_SetSubwindowMode(
1693 options: *mut ArkUI_CustomDialogOptions,
1694 showInSubwindow: bool,
1695 ) -> i32;
1696 /// Sets the mask for a custom dialog box.
1697 ///
1698 /// # Arguments
1699 ///
1700 /// * `options` - Dialog box parameters.
1701 ///
1702 /// * `maskColor` - Mask color, in 0xargb format.
1703 ///
1704 /// * `maskRect` - Pointer to the mask area. Events outside the mask area are transparently transmitted,
1705 /// and events within the mask area are not. The parameter type is [`ArkUI_Rect`].
1706 ///
1707 /// # Returns
1708 ///
1709 /// * Returns the error code.
1710 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1711 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1712 ///
1713 /// Available since API-level: 19
1714 #[cfg(feature = "api-19")]
1715 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1716 pub fn OH_ArkUI_CustomDialog_SetMask(
1717 options: *mut ArkUI_CustomDialogOptions,
1718 maskColor: u32,
1719 maskRect: *const ArkUI_Rect,
1720 ) -> i32;
1721 /// Sets the keyboard avoidance mode of the dialog box.
1722 ///
1723 /// # Arguments
1724 ///
1725 /// * `options` - Dialog box parameters.
1726 ///
1727 /// * `keyboardAvoidMode` - Keyboard avoidance mode, specified by an enumerated value.
1728 ///
1729 /// # Returns
1730 ///
1731 /// * Returns the error code.
1732 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1733 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1734 ///
1735 /// Available since API-level: 19
1736 #[cfg(feature = "api-19")]
1737 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1738 pub fn OH_ArkUI_CustomDialog_SetKeyboardAvoidMode(
1739 options: *mut ArkUI_CustomDialogOptions,
1740 keyboardAvoidMode: ArkUI_KeyboardAvoidMode,
1741 ) -> i32;
1742 /// Sets whether to enable the hover mode for the dialog box.
1743 ///
1744 /// # Arguments
1745 ///
1746 /// * `options` - Dialog box parameters.
1747 ///
1748 /// * `enabled` - Whether to enable the hover mode. The default value is <b>false</b>.
1749 ///
1750 /// # Returns
1751 ///
1752 /// * Returns the error code.
1753 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1754 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1755 ///
1756 /// Available since API-level: 19
1757 #[cfg(feature = "api-19")]
1758 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1759 pub fn OH_ArkUI_CustomDialog_SetHoverModeEnabled(
1760 options: *mut ArkUI_CustomDialogOptions,
1761 enabled: bool,
1762 ) -> i32;
1763 /// Set the default display area of the dialog box in hover mode.
1764 ///
1765 /// # Arguments
1766 ///
1767 /// * `options` - Dialog box parameters.
1768 ///
1769 /// * `hoverModeAreaType` - Display area in hover mode, specified by an enumerated value.
1770 ///
1771 /// # Returns
1772 ///
1773 /// * Returns the error code.
1774 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1775 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1776 ///
1777 /// Available since API-level: 19
1778 #[cfg(feature = "api-19")]
1779 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1780 pub fn OH_ArkUI_CustomDialog_SetHoverModeArea(
1781 options: *mut ArkUI_CustomDialogOptions,
1782 hoverModeAreaType: ArkUI_HoverModeAreaType,
1783 ) -> i32;
1784 /// Registers a callback for the dismissal event of the custom dialog box.
1785 ///
1786 /// # Arguments
1787 ///
1788 /// * `options` - Dialog box parameters.
1789 ///
1790 /// * `userData` - Pointer to the user-defined data.
1791 ///
1792 /// * `callback` - Callback for the dismissal event of the custom dialog box.
1793 ///
1794 /// # Returns
1795 ///
1796 /// * Returns the error code.
1797 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1798 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1799 ///
1800 /// Available since API-level: 19
1801 #[cfg(feature = "api-19")]
1802 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1803 pub fn OH_ArkUI_CustomDialog_RegisterOnWillDismissCallback(
1804 options: *mut ArkUI_CustomDialogOptions,
1805 userData: *mut ::core::ffi::c_void,
1806 callback: ::core::option::Option<
1807 unsafe extern "C" fn(event: *mut ArkUI_DialogDismissEvent),
1808 >,
1809 ) -> i32;
1810 /// Registers a callback to be invoked when the custom dialog box is about to appear.
1811 ///
1812 /// # Arguments
1813 ///
1814 /// * `options` - Dialog box parameters.
1815 ///
1816 /// * `userData` - Pointer to the user-defined data.
1817 ///
1818 /// * `callback` - Callback to be invoked when the dialog box is about to appear.
1819 ///
1820 /// # Returns
1821 ///
1822 /// * Returns the error code.
1823 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1824 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1825 ///
1826 /// Available since API-level: 19
1827 #[cfg(feature = "api-19")]
1828 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1829 pub fn OH_ArkUI_CustomDialog_RegisterOnWillAppearCallback(
1830 options: *mut ArkUI_CustomDialogOptions,
1831 userData: *mut ::core::ffi::c_void,
1832 callback: ::core::option::Option<unsafe extern "C" fn(userData: *mut ::core::ffi::c_void)>,
1833 ) -> i32;
1834 /// Registers a callback to be invoked when the custom dialog box appears.
1835 ///
1836 /// # Arguments
1837 ///
1838 /// * `options` - Dialog box parameters.
1839 ///
1840 /// * `userData` - Pointer to the user-defined data.
1841 ///
1842 /// * `callback` - Callback to be invoked when the custom dialog box appears.
1843 ///
1844 /// # Returns
1845 ///
1846 /// * Returns the error code.
1847 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1848 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1849 ///
1850 /// Available since API-level: 19
1851 #[cfg(feature = "api-19")]
1852 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1853 pub fn OH_ArkUI_CustomDialog_RegisterOnDidAppearCallback(
1854 options: *mut ArkUI_CustomDialogOptions,
1855 userData: *mut ::core::ffi::c_void,
1856 callback: ::core::option::Option<unsafe extern "C" fn(userData: *mut ::core::ffi::c_void)>,
1857 ) -> i32;
1858 /// Registers a callback to be invoked when the custom dialog box is about to disappear.
1859 ///
1860 /// # Arguments
1861 ///
1862 /// * `options` - Dialog box parameters.
1863 ///
1864 /// * `userData` - Pointer to the user-defined data.
1865 ///
1866 /// * `callback` - Callback to be invoked when the dialog box is about to disappear.
1867 ///
1868 /// # Returns
1869 ///
1870 /// * Returns the error code.
1871 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1872 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1873 ///
1874 /// Available since API-level: 19
1875 #[cfg(feature = "api-19")]
1876 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1877 pub fn OH_ArkUI_CustomDialog_RegisterOnWillDisappearCallback(
1878 options: *mut ArkUI_CustomDialogOptions,
1879 userData: *mut ::core::ffi::c_void,
1880 callback: ::core::option::Option<unsafe extern "C" fn(userData: *mut ::core::ffi::c_void)>,
1881 ) -> i32;
1882 /// Registers a callback to be invoked when the custom dialog box disappears.
1883 ///
1884 /// # Arguments
1885 ///
1886 /// * `options` - Dialog box parameters.
1887 ///
1888 /// * `userData` - Pointer to the user-defined data.
1889 ///
1890 /// * `callback` - Callback to be invoked when the custom dialog box disappears.
1891 ///
1892 /// # Returns
1893 ///
1894 /// * Returns the error code.
1895 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1896 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1897 ///
1898 /// Available since API-level: 19
1899 #[cfg(feature = "api-19")]
1900 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1901 pub fn OH_ArkUI_CustomDialog_RegisterOnDidDisappearCallback(
1902 options: *mut ArkUI_CustomDialogOptions,
1903 userData: *mut ::core::ffi::c_void,
1904 callback: ::core::option::Option<unsafe extern "C" fn(userData: *mut ::core::ffi::c_void)>,
1905 ) -> i32;
1906 /// Get state of dialog.
1907 ///
1908 /// # Arguments
1909 ///
1910 /// * `handle` - Indicates the pointer to the custom dialog box controller.
1911 ///
1912 /// * `state` - Dialog state object.
1913 ///
1914 /// # Returns
1915 ///
1916 /// * Returns the error code.
1917 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1918 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1919 ///
1920 /// Available since API-level: 20
1921 #[cfg(feature = "api-20")]
1922 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
1923 pub fn OH_ArkUI_CustomDialog_GetState(
1924 handle: ArkUI_NativeDialogHandle,
1925 state: *mut ArkUI_DialogState,
1926 ) -> i32;
1927 /// Sets the background blur effect for a dialog box.
1928 ///
1929 /// # Arguments
1930 ///
1931 /// * `options` - Dialog box parameters.
1932 ///
1933 /// * `backgroundBlurStyleOptions` - Background blur effect options of the dialog box.
1934 /// Format of the [`ArkUI_AttributeItem`] parameter:
1935 ///
1936 /// .value[0].i32: color mode. The value is an enum of [`ArkUI_ColorMode`].
1937 ///
1938 /// .value[1]?.i32: adaptive color mode. The value is an enum of [`ArkUI_AdaptiveColor`].
1939 ///
1940 /// .value[2]?.f32: blur degree. The value range is [0.0, 1.0].
1941 ///
1942 /// .value[3]?.u32: brightness of black in the grayscale blur. The value range is [0, 127].
1943 ///
1944 /// .value[4]?.u32: degree of darkening the white color in the grayscale blur. The value range is [0, 127].
1945 ///
1946 /// .value[5]?.i32: blur activation policy. The value is an enum of [`ArkUI_BlurStyleActivePolicy`].
1947 ///
1948 /// .value[6]?.u32: background color, in 0xARGB format, of the components within the window after the window loses
1949 /// focus (in which case, the blur effect on the components within the window is removed).
1950 ///
1951 ///
1952 /// # Returns
1953 ///
1954 /// * Returns the result code.
1955 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1956 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1957 ///
1958 /// Available since API-level: 19
1959 #[cfg(feature = "api-19")]
1960 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1961 pub fn OH_ArkUI_CustomDialog_SetBackgroundBlurStyleOptions(
1962 options: *mut ArkUI_CustomDialogOptions,
1963 backgroundBlurStyleOptions: *const ArkUI_AttributeItem,
1964 ) -> i32;
1965 /// Sets the background effect parameters for a dialog box.
1966 ///
1967 /// # Arguments
1968 ///
1969 /// * `options` - Dialog box parameters.
1970 ///
1971 /// * `backgroundEffect` - Background effect of the dialog box.
1972 /// Format of the [`ArkUI_AttributeItem`] parameter:
1973 ///
1974 /// .value[0].f32: blur radius, in vp.
1975 ///
1976 /// .value[1]?.f32: saturation.
1977 ///
1978 /// .value[2]?.f32: brightness.
1979 ///
1980 /// .value[3]?.u32: color, in 0xARGB format.
1981 ///
1982 /// .value[4]?.i32: adaptive color mode. The value is an enum of [`ArkUI_AdaptiveColor`].
1983 ///
1984 /// .value[5]?.u32: brightness of black in the grayscale blur. The value range is [0, 127].
1985 ///
1986 /// .value[6]?.u32: degree of darkening the white color in the grayscale blur. The value range is [0, 127].
1987 ///
1988 /// .value[7]?.i32: blur activation policy. The value is an enum of [`ArkUI_BlurStyleActivePolicy`].
1989 ///
1990 /// .value[8]?.u32: background color, in 0xARGB format, of the components within the window after the window loses
1991 /// focus (in which case, the blur effect on the components within the window is removed).
1992 ///
1993 ///
1994 /// # Returns
1995 ///
1996 /// * Returns the result code.
1997 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1998 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1999 ///
2000 /// Available since API-level: 19
2001 #[cfg(feature = "api-19")]
2002 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
2003 pub fn OH_ArkUI_CustomDialog_SetBackgroundEffect(
2004 options: *mut ArkUI_CustomDialogOptions,
2005 backgroundEffect: *const ArkUI_AttributeItem,
2006 ) -> i32;
2007}